@fluidframework/container-runtime 2.23.0 → 2.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +593 -537
- package/api-report/container-runtime.legacy.alpha.api.md +0 -246
- package/dist/blobManager/blobManager.d.ts +11 -9
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +38 -39
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.d.ts +2 -4
- package/dist/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.js +6 -6
- package/dist/blobManager/blobManagerSnapSum.js.map +1 -1
- package/dist/channelCollection.d.ts +1 -7
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +2 -27
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.d.ts +0 -43
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +40 -145
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +149 -364
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +6 -14
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +14 -26
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +2 -20
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +0 -2
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +8 -24
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +1 -3
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +1 -4
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +0 -1
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +6 -18
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +0 -29
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +16 -5
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +12 -3
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +41 -21
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts +1 -0
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +12 -2
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/runCounter.d.ts +11 -0
- package/dist/runCounter.d.ts.map +1 -0
- package/dist/runCounter.js +43 -0
- package/dist/runCounter.js.map +1 -0
- package/dist/runtimeLayerCompatState.d.ts +51 -0
- package/dist/runtimeLayerCompatState.d.ts.map +1 -0
- package/dist/runtimeLayerCompatState.js +123 -0
- package/dist/runtimeLayerCompatState.js.map +1 -0
- package/dist/signalTelemetryProcessing.d.ts +33 -0
- package/dist/signalTelemetryProcessing.d.ts.map +1 -0
- package/dist/signalTelemetryProcessing.js +149 -0
- package/dist/signalTelemetryProcessing.js.map +1 -0
- package/dist/summary/documentSchema.d.ts +7 -31
- package/dist/summary/documentSchema.d.ts.map +1 -1
- package/dist/summary/documentSchema.js +2 -18
- package/dist/summary/documentSchema.js.map +1 -1
- package/dist/summary/index.d.ts +2 -1
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js +7 -1
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +1 -3
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -3
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +2 -7
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +1 -2
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +4 -23
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +2 -5
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +3 -11
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js +0 -1
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.d.ts +1 -1
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +2 -2
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +4 -4
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -18
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +0 -27
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +1 -2
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +109 -22
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +3 -9
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +3 -9
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryHelpers.d.ts +19 -0
- package/dist/summary/summaryHelpers.d.ts.map +1 -0
- package/dist/summary/summaryHelpers.js +90 -0
- package/dist/summary/summaryHelpers.js.map +1 -0
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +0 -2
- package/dist/summary/summaryManager.js.map +1 -1
- package/lib/blobManager/blobManager.d.ts +11 -9
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +37 -37
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.d.ts +2 -4
- package/lib/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.js +6 -6
- package/lib/blobManager/blobManagerSnapSum.js.map +1 -1
- package/lib/channelCollection.d.ts +1 -7
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +3 -30
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.d.ts +0 -43
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +40 -145
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +151 -372
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +6 -14
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +14 -26
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +3 -23
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +0 -2
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +8 -24
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +1 -3
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +1 -4
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +0 -1
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +7 -21
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +0 -29
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +16 -5
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +12 -3
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +43 -23
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts +1 -0
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +12 -2
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/runCounter.d.ts +11 -0
- package/lib/runCounter.d.ts.map +1 -0
- package/lib/runCounter.js +39 -0
- package/lib/runCounter.js.map +1 -0
- package/lib/runtimeLayerCompatState.d.ts +51 -0
- package/lib/runtimeLayerCompatState.d.ts.map +1 -0
- package/lib/runtimeLayerCompatState.js +118 -0
- package/lib/runtimeLayerCompatState.js.map +1 -0
- package/lib/signalTelemetryProcessing.d.ts +33 -0
- package/lib/signalTelemetryProcessing.d.ts.map +1 -0
- package/lib/signalTelemetryProcessing.js +145 -0
- package/lib/signalTelemetryProcessing.js.map +1 -0
- package/lib/summary/documentSchema.d.ts +7 -31
- package/lib/summary/documentSchema.d.ts.map +1 -1
- package/lib/summary/documentSchema.js +2 -18
- package/lib/summary/documentSchema.js.map +1 -1
- package/lib/summary/index.d.ts +2 -1
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js +1 -0
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +1 -3
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +1 -3
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +2 -7
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +1 -2
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +4 -23
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +2 -5
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +3 -11
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js +0 -1
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.d.ts +1 -1
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +2 -2
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +5 -5
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -18
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +1 -25
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +1 -2
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +109 -22
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +3 -9
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +3 -9
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryHelpers.d.ts +19 -0
- package/lib/summary/summaryHelpers.d.ts.map +1 -0
- package/lib/summary/summaryHelpers.js +84 -0
- package/lib/summary/summaryHelpers.js.map +1 -0
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +0 -2
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +20 -23
- package/src/blobManager/blobManager.ts +70 -62
- package/src/blobManager/blobManagerSnapSum.ts +7 -9
- package/src/channelCollection.ts +4 -32
- package/src/connectionTelemetry.ts +0 -51
- package/src/containerRuntime.ts +259 -622
- package/src/dataStoreContext.ts +24 -33
- package/src/gc/{garbageCollection.md → README.md} +17 -19
- package/src/gc/garbageCollection.ts +9 -26
- package/src/gc/gcConfigs.ts +3 -6
- package/src/gc/gcDefinitions.ts +10 -28
- package/src/gc/gcHelpers.ts +0 -5
- package/src/gc/gcSummaryStateTracker.ts +1 -2
- package/src/gc/gcTelemetry.ts +8 -15
- package/src/index.ts +6 -6
- package/src/messageTypes.ts +0 -2
- package/src/opLifecycle/batchManager.ts +20 -6
- package/src/opLifecycle/outbox.ts +64 -24
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +18 -2
- package/src/runCounter.ts +25 -0
- package/src/runtimeLayerCompatState.ts +143 -0
- package/src/signalTelemetryProcessing.ts +233 -0
- package/src/summary/documentSchema.ts +7 -38
- package/src/summary/index.ts +12 -0
- package/src/summary/orderedClientElection.ts +1 -3
- package/src/summary/runWhileConnectedCoordinator.ts +3 -8
- package/src/summary/runningSummarizer.ts +12 -20
- package/src/summary/summarizer.ts +6 -18
- package/src/summary/summarizerClientElection.ts +0 -2
- package/src/summary/summarizerHeuristics.ts +1 -2
- package/src/summary/summarizerNode/summarizerNode.ts +6 -5
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +1 -27
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +2 -3
- package/src/summary/summarizerTypes.ts +119 -23
- package/src/summary/summaryFormat.ts +4 -13
- package/src/summary/summaryGenerator.ts +1 -8
- package/src/summary/summaryHelpers.ts +118 -0
- package/src/summary/summaryManager.ts +0 -2
- package/tsconfig.json +1 -0
- package/dist/layerCompatState.d.ts +0 -19
- package/dist/layerCompatState.d.ts.map +0 -1
- package/dist/layerCompatState.js +0 -64
- package/dist/layerCompatState.js.map +0 -1
- package/lib/layerCompatState.d.ts +0 -19
- package/lib/layerCompatState.d.ts.map +0 -1
- package/lib/layerCompatState.js +0 -60
- package/lib/layerCompatState.js.map +0 -1
- package/prettier.config.cjs +0 -8
- package/src/layerCompatState.ts +0 -75
package/src/dataStoreContext.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
6
|
+
import { TypedEventEmitter, type ILayerCompatDetails } from "@fluid-internal/client-utils";
|
|
7
7
|
import { AttachState, IAudience } from "@fluidframework/container-definitions";
|
|
8
8
|
import { IDeltaManager } from "@fluidframework/container-definitions/internal";
|
|
9
9
|
import {
|
|
@@ -77,6 +77,10 @@ import {
|
|
|
77
77
|
tagCodeArtifacts,
|
|
78
78
|
} from "@fluidframework/telemetry-utils/internal";
|
|
79
79
|
|
|
80
|
+
import {
|
|
81
|
+
runtimeCompatDetailsForDataStore,
|
|
82
|
+
validateDatastoreCompatibility,
|
|
83
|
+
} from "./runtimeLayerCompatState.js";
|
|
80
84
|
import {
|
|
81
85
|
// eslint-disable-next-line import/no-deprecated
|
|
82
86
|
ReadFluidDataStoreAttributes,
|
|
@@ -278,6 +282,14 @@ export abstract class FluidDataStoreContext
|
|
|
278
282
|
return this.registry;
|
|
279
283
|
}
|
|
280
284
|
|
|
285
|
+
/**
|
|
286
|
+
* The compatibility details of the Runtime layer that is exposed to the DataStore layer
|
|
287
|
+
* for validating DataStore-Runtime compatibility.
|
|
288
|
+
*/
|
|
289
|
+
public get ILayerCompatDetails(): ILayerCompatDetails {
|
|
290
|
+
return runtimeCompatDetailsForDataStore;
|
|
291
|
+
}
|
|
292
|
+
|
|
281
293
|
private baseSnapshotSequenceNumber: number | undefined;
|
|
282
294
|
|
|
283
295
|
/**
|
|
@@ -573,6 +585,7 @@ export abstract class FluidDataStoreContext
|
|
|
573
585
|
|
|
574
586
|
const channel = await factory.instantiateDataStore(this, existing);
|
|
575
587
|
assert(channel !== undefined, 0x140 /* "undefined channel on datastore context" */);
|
|
588
|
+
|
|
576
589
|
await this.bindRuntime(channel, existing);
|
|
577
590
|
// This data store may have been disposed before the channel is created during realization. If so,
|
|
578
591
|
// dispose the channel now.
|
|
@@ -604,30 +617,6 @@ export abstract class FluidDataStoreContext
|
|
|
604
617
|
this.channel!.setConnectionState(connected, clientId);
|
|
605
618
|
}
|
|
606
619
|
|
|
607
|
-
/**
|
|
608
|
-
* back-compat ADO 21575: This is temporary and will be removed once the compat requirement across Runtime and
|
|
609
|
-
* Datastore boundary is satisfied.
|
|
610
|
-
* Process the messages to maintain backwards compatibility. The `processMessages` function is added to
|
|
611
|
-
* IFluidDataStoreChannel in 2.5.0. For channels before that, call `process` for each message.
|
|
612
|
-
*/
|
|
613
|
-
private processMessagesCompat(
|
|
614
|
-
channel: IFluidDataStoreChannel,
|
|
615
|
-
messageCollection: IRuntimeMessageCollection,
|
|
616
|
-
): void {
|
|
617
|
-
if (channel.processMessages === undefined) {
|
|
618
|
-
const { envelope, messagesContent, local } = messageCollection;
|
|
619
|
-
for (const { contents, localOpMetadata, clientSequenceNumber } of messagesContent) {
|
|
620
|
-
channel.process(
|
|
621
|
-
{ ...envelope, contents, clientSequenceNumber },
|
|
622
|
-
local,
|
|
623
|
-
localOpMetadata,
|
|
624
|
-
);
|
|
625
|
-
}
|
|
626
|
-
} else {
|
|
627
|
-
channel.processMessages(messageCollection);
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
|
|
631
620
|
/**
|
|
632
621
|
* Process messages for this data store. The messages here are contiguous messages for this data store in a batch.
|
|
633
622
|
* @param messageCollection - The collection of messages to process.
|
|
@@ -643,7 +632,7 @@ export abstract class FluidDataStoreContext
|
|
|
643
632
|
|
|
644
633
|
if (this.loaded) {
|
|
645
634
|
assert(this.channel !== undefined, 0xa68 /* Channel is not loaded */);
|
|
646
|
-
this.
|
|
635
|
+
this.channel.processMessages(messageCollection);
|
|
647
636
|
} else {
|
|
648
637
|
assert(!local, 0x142 /* "local store channel is not loaded" */);
|
|
649
638
|
assert(
|
|
@@ -849,12 +838,6 @@ export abstract class FluidDataStoreContext
|
|
|
849
838
|
}
|
|
850
839
|
}
|
|
851
840
|
|
|
852
|
-
/**
|
|
853
|
-
* Submits the signal to be sent to other clients.
|
|
854
|
-
* @param type - Type of the signal.
|
|
855
|
-
* @param content - Content of the signal. Should be a JSON serializable object or primitive.
|
|
856
|
-
* @param targetClientId - When specified, the signal is only sent to the provided client id.
|
|
857
|
-
*/
|
|
858
841
|
public submitSignal(type: string, content: unknown, targetClientId?: string): void {
|
|
859
842
|
this.verifyNotClosed("submitSignal");
|
|
860
843
|
|
|
@@ -881,7 +864,7 @@ export abstract class FluidDataStoreContext
|
|
|
881
864
|
for (const messageCollection of this.pendingMessagesState.messageCollections) {
|
|
882
865
|
// Only process ops whose seq number is greater than snapshot sequence number from which it loaded.
|
|
883
866
|
if (messageCollection.envelope.sequenceNumber > baseSequenceNumber) {
|
|
884
|
-
|
|
867
|
+
channel.processMessages(messageCollection);
|
|
885
868
|
}
|
|
886
869
|
}
|
|
887
870
|
|
|
@@ -890,6 +873,13 @@ export abstract class FluidDataStoreContext
|
|
|
890
873
|
}
|
|
891
874
|
|
|
892
875
|
protected completeBindingRuntime(channel: IFluidDataStoreChannel): void {
|
|
876
|
+
// Validate that the DataStore is compatible with this Runtime.
|
|
877
|
+
const maybeDataStoreCompatDetails = channel as FluidObject<ILayerCompatDetails>;
|
|
878
|
+
validateDatastoreCompatibility(
|
|
879
|
+
maybeDataStoreCompatDetails.ILayerCompatDetails,
|
|
880
|
+
this.dispose.bind(this),
|
|
881
|
+
);
|
|
882
|
+
|
|
893
883
|
// And now mark the runtime active
|
|
894
884
|
this.loaded = true;
|
|
895
885
|
this.channel = channel;
|
|
@@ -1035,6 +1025,7 @@ export abstract class FluidDataStoreContext
|
|
|
1035
1025
|
callSite,
|
|
1036
1026
|
undefined /* sequencedMessage */,
|
|
1037
1027
|
safeTelemetryProps,
|
|
1028
|
+
30 /* stackTraceLimit */,
|
|
1038
1029
|
);
|
|
1039
1030
|
|
|
1040
1031
|
this.mc.logger.sendTelemetryEvent(
|
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
# Garbage Collection
|
|
2
2
|
|
|
3
|
-
Garbage collection (GC) is the process by which Fluid Framework safely
|
|
3
|
+
Garbage collection (GC) is the process by which Fluid Framework safely deletes objects that are not used.
|
|
4
|
+
GC reduces the size of the Fluid file at rest, the in-memory content and the summary that is uploaded to / downloaded from the server.
|
|
5
|
+
It saves COGS on the server and it makes containers load faster as there is less data to download and process.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
All Fluid objects that are in use must be properly referenced so that they are not deleted by GC. Similarly, references to all unused Fluid objects should be removed so that they can be deleted by GC.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
It is the responsibility of the users of Fluid Framework to correctly add and remove references to Fluid objects.
|
|
8
10
|
|
|
9
|
-
##
|
|
11
|
+
## Referencing / unreferencing Fluid objects
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
Currently, the only Fluid objects that are eligible for GC are data stores and attachment blobs. The following sections describe how you can mark them as referenced or unreferenced.
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Currently, the only Fluid objects that are eligible for GC are data stores and attachment blobs. The following sections describe how you can mark them as referenced or unreferenced. These sections speak of a "referenced DDS" which refers to a DDS that is created by a referenced data store.
|
|
15
|
+
These sections speak of a "referenced DDS" which refers to a DDS that is created by a referenced data store.
|
|
16
16
|
|
|
17
17
|
### Data stores
|
|
18
18
|
|
|
19
19
|
There are 2 ways to reference a data store:
|
|
20
20
|
|
|
21
|
-
- Store the data
|
|
21
|
+
- Store the data store's handle (see [IFluidHandle](../../../../../packages/common/core-interfaces/src/handles.ts)) in a referenced DDS that supports handle in its data.
|
|
22
|
+
For example, a data store's handle can be stored in a referenced `SharedMap` DDS.
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
Storing a handle of any of a data store's DDS will also mark the data store as referenced.
|
|
24
25
|
|
|
25
|
-
- Alias the data store. Aliased data stores are rooted in the container, i.e., they are always referenced and cannot be unreferenced later.
|
|
26
|
+
- Alias the data store by calling [trySetAlias](../../../runtime-definitions/src/dataStoreContext.ts) on a data store during creation. Aliased data stores are rooted in the container, i.e., they are always referenced and cannot be unreferenced later.
|
|
27
|
+
Aliased data stores can never be deleted so only do so if you want them to live forever.
|
|
26
28
|
|
|
27
29
|
Once there are no more referenced DDSes in the container containing a handle to a particular data store, that data store is unreferenced and is eligible for GC.
|
|
28
30
|
|
|
@@ -30,7 +32,7 @@ Once there are no more referenced DDSes in the container containing a handle to
|
|
|
30
32
|
|
|
31
33
|
### Attachment blobs
|
|
32
34
|
|
|
33
|
-
The only way to reference an attachment blob is to store its IFluidHandle in a referenced DDS similar to data stores.
|
|
35
|
+
The only way to reference an attachment blob is to store its [IFluidHandle](../../../../../packages/common/core-interfaces/src/handles.ts) in a referenced DDS similar to data stores.
|
|
34
36
|
|
|
35
37
|
Once there are no more referenced DDSes in the container containing a handle to a particular attachment blob, that attachment blob is unreferenced and is eligible for GC.
|
|
36
38
|
|
|
@@ -59,8 +61,9 @@ GC sweep phase runs in two stages:
|
|
|
59
61
|
|
|
60
62
|
- The first stage is the "Tombstone" stage, where objects are marked as Tombstones, meaning GC believes they will
|
|
61
63
|
never be referenced again and are safe to delete. They are not yet deleted at this point, but any attempt to
|
|
62
|
-
load them will fail.
|
|
63
|
-
|
|
64
|
+
load them will fail. Loading them will trigger "auto recovery" where the timestamp of when this object is unreferenced will be reset to now, thereby extending its lifetime.
|
|
65
|
+
This way, there's a chance to recover a Tombstoned object in case we detect it's still being used.
|
|
66
|
+
- The second stage is the "Sweep" stage, where the objects are fully deleted.
|
|
64
67
|
This occurs after a configurable delay called the "Sweep Grace Period", to give time for application teams
|
|
65
68
|
to monitor for Tombstone-related errors and react before delete occurs.
|
|
66
69
|
|
|
@@ -91,8 +94,3 @@ and then later update the passed-in GC Options to finalize the configuration in
|
|
|
91
94
|
### Enabling Sweep Phase
|
|
92
95
|
|
|
93
96
|
To enable the Sweep Phase for new documents, you must set the `enableGCSweep` GC Option to true.
|
|
94
|
-
|
|
95
|
-
### More Advanced Configuration
|
|
96
|
-
|
|
97
|
-
For additional behaviors that can be configured (e.g. for testing), please see these
|
|
98
|
-
[Advanced Configuration](./gcEarlyAdoption.md#more-advanced-configurations) docs.
|
|
@@ -34,22 +34,17 @@ import { IRefreshSummaryResult } from "../summary/index.js";
|
|
|
34
34
|
|
|
35
35
|
import { generateGCConfigs } from "./gcConfigs.js";
|
|
36
36
|
import {
|
|
37
|
-
// eslint-disable-next-line import/no-deprecated
|
|
38
37
|
GCNodeType,
|
|
39
38
|
GarbageCollectionMessage,
|
|
40
39
|
GarbageCollectionMessageType,
|
|
41
|
-
// eslint-disable-next-line import/no-deprecated
|
|
42
40
|
IGCMetadata,
|
|
43
41
|
IGCResult,
|
|
44
|
-
// eslint-disable-next-line import/no-deprecated
|
|
45
42
|
IGCStats,
|
|
46
43
|
IGarbageCollectionRuntime,
|
|
47
44
|
IGarbageCollector,
|
|
48
45
|
IGarbageCollectorConfigs,
|
|
49
46
|
IGarbageCollectorCreateParams,
|
|
50
|
-
// eslint-disable-next-line import/no-deprecated
|
|
51
47
|
IMarkPhaseStats,
|
|
52
|
-
// eslint-disable-next-line import/no-deprecated
|
|
53
48
|
ISweepPhaseStats,
|
|
54
49
|
UnreferencedState,
|
|
55
50
|
type IGCNodeUpdatedProps,
|
|
@@ -516,7 +511,6 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
516
511
|
fullGC?: boolean;
|
|
517
512
|
},
|
|
518
513
|
telemetryContext?: ITelemetryContext,
|
|
519
|
-
// eslint-disable-next-line import/no-deprecated
|
|
520
514
|
): Promise<IGCStats | undefined> {
|
|
521
515
|
const fullGC =
|
|
522
516
|
options.fullGC ?? (this.configs.runFullGC === true || this.autoRecovery.useFullGC());
|
|
@@ -614,7 +608,6 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
614
608
|
fullGC: boolean,
|
|
615
609
|
currentReferenceTimestampMs: number,
|
|
616
610
|
logger: ITelemetryLoggerExt,
|
|
617
|
-
// eslint-disable-next-line import/no-deprecated
|
|
618
611
|
): Promise<IGCStats> {
|
|
619
612
|
// 1. Generate / analyze the runtime's reference graph.
|
|
620
613
|
// Get the reference graph (gcData) and run GC algorithm to get referenced / unreferenced nodes.
|
|
@@ -770,7 +763,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
770
763
|
// local state when processing the op.
|
|
771
764
|
const sweepReadyDSAndBlobs = nodesToDelete.filter((nodeId) => {
|
|
772
765
|
const nodeType = this.runtime.getNodeType(nodeId);
|
|
773
|
-
|
|
766
|
+
|
|
774
767
|
return nodeType === GCNodeType.DataStore || nodeType === GCNodeType.Blob;
|
|
775
768
|
});
|
|
776
769
|
const contents: GarbageCollectionMessage = {
|
|
@@ -902,7 +895,6 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
902
895
|
);
|
|
903
896
|
}
|
|
904
897
|
|
|
905
|
-
// eslint-disable-next-line import/no-deprecated
|
|
906
898
|
public getMetadata(): IGCMetadata {
|
|
907
899
|
return {
|
|
908
900
|
/**
|
|
@@ -1065,7 +1057,6 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1065
1057
|
// Unless this is a Loaded event for a Blob or DataStore, we're done after telemetry tracking
|
|
1066
1058
|
const loadedBlobOrDataStore =
|
|
1067
1059
|
reason === "Loaded" &&
|
|
1068
|
-
// eslint-disable-next-line import/no-deprecated
|
|
1069
1060
|
(nodeType === GCNodeType.Blob || nodeType === GCNodeType.DataStore);
|
|
1070
1061
|
if (!loadedBlobOrDataStore) {
|
|
1071
1062
|
return;
|
|
@@ -1193,9 +1184,8 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1193
1184
|
* @param gcResult - The result of the current GC run.
|
|
1194
1185
|
* @returns the stats of the mark phase run.
|
|
1195
1186
|
*/
|
|
1196
|
-
|
|
1187
|
+
|
|
1197
1188
|
private getMarkPhaseStats(gcResult: IGCResult): IMarkPhaseStats {
|
|
1198
|
-
// eslint-disable-next-line import/no-deprecated
|
|
1199
1189
|
const markPhaseStats: IMarkPhaseStats = {
|
|
1200
1190
|
nodeCount: 0,
|
|
1201
1191
|
dataStoreCount: 0,
|
|
@@ -1222,7 +1212,6 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1222
1212
|
markPhaseStats.unrefNodeCount++;
|
|
1223
1213
|
}
|
|
1224
1214
|
|
|
1225
|
-
// eslint-disable-next-line import/no-deprecated
|
|
1226
1215
|
if (this.runtime.getNodeType(nodeId) === GCNodeType.DataStore) {
|
|
1227
1216
|
markPhaseStats.dataStoreCount++;
|
|
1228
1217
|
if (stateUpdated) {
|
|
@@ -1232,7 +1221,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1232
1221
|
markPhaseStats.unrefDataStoreCount++;
|
|
1233
1222
|
}
|
|
1234
1223
|
}
|
|
1235
|
-
|
|
1224
|
+
|
|
1236
1225
|
if (this.runtime.getNodeType(nodeId) === GCNodeType.Blob) {
|
|
1237
1226
|
markPhaseStats.attachmentBlobCount++;
|
|
1238
1227
|
if (stateUpdated) {
|
|
@@ -1266,13 +1255,12 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1266
1255
|
private getSweepPhaseStats(
|
|
1267
1256
|
deletedNodes: Set<string>,
|
|
1268
1257
|
sweepReadyNodes: Set<string>,
|
|
1269
|
-
|
|
1258
|
+
|
|
1270
1259
|
markPhaseStats: IMarkPhaseStats,
|
|
1271
|
-
// eslint-disable-next-line import/no-deprecated
|
|
1272
1260
|
): ISweepPhaseStats {
|
|
1273
1261
|
// Initialize the life time node counts to the mark phase node counts. If sweep is not enabled,
|
|
1274
1262
|
// these will be the life time node count for this container.
|
|
1275
|
-
|
|
1263
|
+
|
|
1276
1264
|
const sweepPhaseStats: ISweepPhaseStats = {
|
|
1277
1265
|
lifetimeNodeCount: markPhaseStats.nodeCount,
|
|
1278
1266
|
lifetimeDataStoreCount: markPhaseStats.dataStoreCount,
|
|
@@ -1284,32 +1272,28 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1284
1272
|
|
|
1285
1273
|
// The runtime can't reliably identify the type of deleted nodes. So, get the type here. This should
|
|
1286
1274
|
// be good enough because the only types that participate in GC today are data stores, DDSes and blobs.
|
|
1287
|
-
// eslint-disable-next-line
|
|
1275
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping
|
|
1288
1276
|
const getDeletedNodeType = (nodeId: string): GCNodeType => {
|
|
1289
1277
|
const pathParts = nodeId.split("/");
|
|
1290
1278
|
if (pathParts[1] === blobManagerBasePath) {
|
|
1291
|
-
// eslint-disable-next-line import/no-deprecated
|
|
1292
1279
|
return GCNodeType.Blob;
|
|
1293
1280
|
}
|
|
1294
1281
|
if (pathParts.length === 2) {
|
|
1295
|
-
// eslint-disable-next-line import/no-deprecated
|
|
1296
1282
|
return GCNodeType.DataStore;
|
|
1297
1283
|
}
|
|
1298
1284
|
if (pathParts.length === 3) {
|
|
1299
|
-
// eslint-disable-next-line import/no-deprecated
|
|
1300
1285
|
return GCNodeType.SubDataStore;
|
|
1301
1286
|
}
|
|
1302
|
-
|
|
1287
|
+
|
|
1303
1288
|
return GCNodeType.Other;
|
|
1304
1289
|
};
|
|
1305
1290
|
|
|
1306
1291
|
for (const nodeId of deletedNodes) {
|
|
1307
1292
|
sweepPhaseStats.deletedNodeCount++;
|
|
1308
1293
|
const nodeType = getDeletedNodeType(nodeId);
|
|
1309
|
-
|
|
1294
|
+
|
|
1310
1295
|
if (nodeType === GCNodeType.DataStore) {
|
|
1311
1296
|
sweepPhaseStats.deletedDataStoreCount++;
|
|
1312
|
-
// eslint-disable-next-line import/no-deprecated
|
|
1313
1297
|
} else if (nodeType === GCNodeType.Blob) {
|
|
1314
1298
|
sweepPhaseStats.deletedAttachmentBlobCount++;
|
|
1315
1299
|
}
|
|
@@ -1330,10 +1314,9 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1330
1314
|
for (const nodeId of sweepReadyNodes) {
|
|
1331
1315
|
sweepPhaseStats.deletedNodeCount++;
|
|
1332
1316
|
const nodeType = this.runtime.getNodeType(nodeId);
|
|
1333
|
-
|
|
1317
|
+
|
|
1334
1318
|
if (nodeType === GCNodeType.DataStore) {
|
|
1335
1319
|
sweepPhaseStats.deletedDataStoreCount++;
|
|
1336
|
-
// eslint-disable-next-line import/no-deprecated
|
|
1337
1320
|
} else if (nodeType === GCNodeType.Blob) {
|
|
1338
1321
|
sweepPhaseStats.deletedAttachmentBlobCount++;
|
|
1339
1322
|
}
|
package/src/gc/gcConfigs.ts
CHANGED
|
@@ -9,13 +9,10 @@ import {
|
|
|
9
9
|
validatePrecondition,
|
|
10
10
|
} from "@fluidframework/telemetry-utils/internal";
|
|
11
11
|
|
|
12
|
-
// eslint-disable-next-line import/no-deprecated
|
|
13
12
|
import { IContainerRuntimeMetadata } from "../summary/index.js";
|
|
14
13
|
|
|
15
14
|
import {
|
|
16
|
-
// eslint-disable-next-line import/no-deprecated
|
|
17
15
|
GCFeatureMatrix,
|
|
18
|
-
// eslint-disable-next-line import/no-deprecated
|
|
19
16
|
GCVersion,
|
|
20
17
|
IGCMetadata_Deprecated,
|
|
21
18
|
IGCRuntimeOptions,
|
|
@@ -45,7 +42,7 @@ export function generateGCConfigs(
|
|
|
45
42
|
mc: MonitoringContext,
|
|
46
43
|
createParams: {
|
|
47
44
|
gcOptions: IGCRuntimeOptions;
|
|
48
|
-
|
|
45
|
+
|
|
49
46
|
metadata: IContainerRuntimeMetadata | undefined;
|
|
50
47
|
existing: boolean;
|
|
51
48
|
isSummarizerClient: boolean;
|
|
@@ -54,9 +51,9 @@ export function generateGCConfigs(
|
|
|
54
51
|
let gcAllowed: boolean = true;
|
|
55
52
|
let sessionExpiryTimeoutMs: number | undefined;
|
|
56
53
|
let tombstoneTimeoutMs: number | undefined;
|
|
57
|
-
|
|
54
|
+
|
|
58
55
|
let persistedGcFeatureMatrix: GCFeatureMatrix | undefined;
|
|
59
|
-
|
|
56
|
+
|
|
60
57
|
let gcVersionInBaseSnapshot: GCVersion | undefined;
|
|
61
58
|
|
|
62
59
|
/**
|
package/src/gc/gcDefinitions.ts
CHANGED
|
@@ -21,17 +21,13 @@ import {
|
|
|
21
21
|
import { RuntimeHeaderData } from "../containerRuntime.js";
|
|
22
22
|
import { ContainerRuntimeGCMessage } from "../messageTypes.js";
|
|
23
23
|
import {
|
|
24
|
-
// eslint-disable-next-line import/no-deprecated
|
|
25
24
|
IContainerRuntimeMetadata,
|
|
26
|
-
// eslint-disable-next-line import/no-deprecated
|
|
27
25
|
ICreateContainerMetadata,
|
|
28
26
|
IRefreshSummaryResult,
|
|
29
27
|
} from "../summary/index.js";
|
|
30
28
|
|
|
31
29
|
/**
|
|
32
|
-
* @
|
|
33
|
-
* @alpha
|
|
34
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
30
|
+
* @internal
|
|
35
31
|
*/
|
|
36
32
|
export type GCVersion = number;
|
|
37
33
|
|
|
@@ -92,9 +88,7 @@ export const defaultSweepGracePeriodMs = 1 * oneDayMs; // 1 day
|
|
|
92
88
|
|
|
93
89
|
/**
|
|
94
90
|
* @see IGCMetadata.gcFeatureMatrix and @see gcGenerationOptionName
|
|
95
|
-
* @
|
|
96
|
-
* @alpha
|
|
97
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
91
|
+
* @internal
|
|
98
92
|
*/
|
|
99
93
|
export type GCFeatureMatrix =
|
|
100
94
|
| {
|
|
@@ -133,9 +127,7 @@ export interface IGCMetadata_Deprecated {
|
|
|
133
127
|
/**
|
|
134
128
|
* GC-specific metadata to be written into the summary.
|
|
135
129
|
*
|
|
136
|
-
* @
|
|
137
|
-
* @alpha
|
|
138
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
130
|
+
* @internal
|
|
139
131
|
*/
|
|
140
132
|
export interface IGCMetadata {
|
|
141
133
|
/**
|
|
@@ -184,9 +176,7 @@ export interface IGCMetadata {
|
|
|
184
176
|
|
|
185
177
|
/**
|
|
186
178
|
* The statistics of the system state after a garbage collection mark phase run.
|
|
187
|
-
* @
|
|
188
|
-
* @alpha
|
|
189
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
179
|
+
* @internal
|
|
190
180
|
*/
|
|
191
181
|
export interface IMarkPhaseStats {
|
|
192
182
|
/**
|
|
@@ -229,9 +219,7 @@ export interface IMarkPhaseStats {
|
|
|
229
219
|
|
|
230
220
|
/**
|
|
231
221
|
* The statistics of the system state after a garbage collection sweep phase run.
|
|
232
|
-
* @
|
|
233
|
-
* @alpha
|
|
234
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
222
|
+
* @internal
|
|
235
223
|
*/
|
|
236
224
|
export interface ISweepPhaseStats {
|
|
237
225
|
/**
|
|
@@ -262,17 +250,13 @@ export interface ISweepPhaseStats {
|
|
|
262
250
|
|
|
263
251
|
/**
|
|
264
252
|
* The statistics of the system state after a garbage collection run.
|
|
265
|
-
* @
|
|
266
|
-
* @alpha
|
|
267
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
253
|
+
* @internal
|
|
268
254
|
*/
|
|
269
255
|
export interface IGCStats extends IMarkPhaseStats, ISweepPhaseStats {}
|
|
270
256
|
|
|
271
257
|
/**
|
|
272
258
|
* The types of GC nodes in the GC reference graph.
|
|
273
|
-
* @
|
|
274
|
-
* @alpha
|
|
275
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
259
|
+
* @internal
|
|
276
260
|
*/
|
|
277
261
|
export const GCNodeType = {
|
|
278
262
|
// Nodes that are for data stores.
|
|
@@ -286,9 +270,7 @@ export const GCNodeType = {
|
|
|
286
270
|
} as const;
|
|
287
271
|
|
|
288
272
|
/**
|
|
289
|
-
* @
|
|
290
|
-
* @alpha
|
|
291
|
-
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
273
|
+
* @internal
|
|
292
274
|
*/
|
|
293
275
|
export type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];
|
|
294
276
|
|
|
@@ -512,9 +494,9 @@ export interface IGarbageCollectorCreateParams {
|
|
|
512
494
|
readonly gcOptions: IGCRuntimeOptions;
|
|
513
495
|
readonly baseLogger: ITelemetryLoggerExt;
|
|
514
496
|
readonly existing: boolean;
|
|
515
|
-
|
|
497
|
+
|
|
516
498
|
readonly metadata: IContainerRuntimeMetadata | undefined;
|
|
517
|
-
|
|
499
|
+
|
|
518
500
|
readonly createContainerMetadata: ICreateContainerMetadata;
|
|
519
501
|
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
520
502
|
readonly isSummarizerClient: boolean;
|
package/src/gc/gcHelpers.ts
CHANGED
|
@@ -15,11 +15,8 @@ import {
|
|
|
15
15
|
import type { IConfigProvider } from "@fluidframework/telemetry-utils/internal";
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
|
-
// eslint-disable-next-line import/no-deprecated
|
|
19
18
|
GCFeatureMatrix,
|
|
20
|
-
// eslint-disable-next-line import/no-deprecated
|
|
21
19
|
GCVersion,
|
|
22
|
-
// eslint-disable-next-line import/no-deprecated
|
|
23
20
|
IGCMetadata,
|
|
24
21
|
gcVersionUpgradeToV4Key,
|
|
25
22
|
nextGCVersion,
|
|
@@ -31,7 +28,6 @@ import {
|
|
|
31
28
|
IGarbageCollectionState,
|
|
32
29
|
} from "./gcSummaryDefinitions.js";
|
|
33
30
|
|
|
34
|
-
// eslint-disable-next-line import/no-deprecated
|
|
35
31
|
export function getGCVersion(metadata?: IGCMetadata): GCVersion {
|
|
36
32
|
if (!metadata) {
|
|
37
33
|
// Force to 0/disallowed in prior versions
|
|
@@ -67,7 +63,6 @@ export function getGCVersionInEffect(configProvider: IConfigProvider): number {
|
|
|
67
63
|
* @returns true if GC Sweep should be allowed for this document
|
|
68
64
|
*/
|
|
69
65
|
export function shouldAllowGcSweep(
|
|
70
|
-
// eslint-disable-next-line import/no-deprecated
|
|
71
66
|
featureMatrix: GCFeatureMatrix,
|
|
72
67
|
currentGeneration: number | undefined,
|
|
73
68
|
): boolean {
|
|
@@ -16,7 +16,6 @@ import { SummaryTreeBuilder, mergeStats } from "@fluidframework/runtime-utils/in
|
|
|
16
16
|
|
|
17
17
|
import { IRefreshSummaryResult } from "../summary/index.js";
|
|
18
18
|
|
|
19
|
-
// eslint-disable-next-line import/no-deprecated
|
|
20
19
|
import { IGCStats, IGarbageCollectorConfigs } from "./gcDefinitions.js";
|
|
21
20
|
import { generateSortedGCState } from "./gcHelpers.js";
|
|
22
21
|
import {
|
|
@@ -231,7 +230,7 @@ export class GCSummaryStateTracker {
|
|
|
231
230
|
/**
|
|
232
231
|
* Called to update the state from a GC run's stats. Used to update the count of data stores whose state updated.
|
|
233
232
|
*/
|
|
234
|
-
|
|
233
|
+
|
|
235
234
|
public updateStateFromGCRunStats(stats: IGCStats): void {
|
|
236
235
|
this.updatedDSCountSinceLastSummary += stats.updatedDataStoreCount;
|
|
237
236
|
}
|
package/src/gc/gcTelemetry.ts
CHANGED
|
@@ -14,13 +14,10 @@ import {
|
|
|
14
14
|
} from "@fluidframework/telemetry-utils/internal";
|
|
15
15
|
|
|
16
16
|
import { RuntimeHeaderData } from "../containerRuntime.js";
|
|
17
|
-
// eslint-disable-next-line import/no-deprecated
|
|
18
17
|
import { ICreateContainerMetadata } from "../summary/index.js";
|
|
19
18
|
|
|
20
19
|
import {
|
|
21
|
-
// eslint-disable-next-line import/no-deprecated
|
|
22
20
|
GCFeatureMatrix,
|
|
23
|
-
// eslint-disable-next-line import/no-deprecated
|
|
24
21
|
GCNodeType,
|
|
25
22
|
IGarbageCollectorConfigs,
|
|
26
23
|
UnreferencedState,
|
|
@@ -44,7 +41,7 @@ interface ICommonProps {
|
|
|
44
41
|
/**
|
|
45
42
|
* The event that is logged when unreferenced node is used after a certain time.
|
|
46
43
|
*/
|
|
47
|
-
|
|
44
|
+
|
|
48
45
|
interface IUnreferencedEventProps extends ICreateContainerMetadata, ICommonProps {
|
|
49
46
|
/**
|
|
50
47
|
* The id that GC uses to track the node. May or may not match id
|
|
@@ -56,13 +53,12 @@ interface IUnreferencedEventProps extends ICreateContainerMetadata, ICommonProps
|
|
|
56
53
|
*/
|
|
57
54
|
id: Tagged<string>;
|
|
58
55
|
fromId?: Tagged<string>;
|
|
59
|
-
|
|
56
|
+
|
|
60
57
|
type: GCNodeType;
|
|
61
58
|
unrefTime: number;
|
|
62
59
|
age: number;
|
|
63
60
|
// Expanding GC feature matrix. Without doing this, the configs cannot be logged in telemetry directly.
|
|
64
61
|
gcConfigs: Omit<IGarbageCollectorConfigs, "persistedGcFeatureMatrix"> & {
|
|
65
|
-
// eslint-disable-next-line import/no-deprecated
|
|
66
62
|
[K in keyof GCFeatureMatrix]: GCFeatureMatrix[K];
|
|
67
63
|
};
|
|
68
64
|
timeout?: number;
|
|
@@ -129,9 +125,9 @@ export class GCTelemetryTracker {
|
|
|
129
125
|
private readonly mc: MonitoringContext,
|
|
130
126
|
private readonly configs: IGarbageCollectorConfigs,
|
|
131
127
|
private readonly isSummarizerClient: boolean,
|
|
132
|
-
|
|
128
|
+
|
|
133
129
|
private readonly createContainerMetadata: ICreateContainerMetadata,
|
|
134
|
-
|
|
130
|
+
|
|
135
131
|
private readonly getNodeType: (nodeId: string) => GCNodeType,
|
|
136
132
|
private readonly getNodeStateTracker: (
|
|
137
133
|
nodeId: string,
|
|
@@ -152,7 +148,6 @@ export class GCTelemetryTracker {
|
|
|
152
148
|
* 2. An event is logged only once per container instance per event per node.
|
|
153
149
|
*/
|
|
154
150
|
private shouldLogNonActiveEvent(
|
|
155
|
-
// eslint-disable-next-line import/no-deprecated
|
|
156
151
|
nodeType: GCNodeType,
|
|
157
152
|
usageType: NodeUsageType,
|
|
158
153
|
nodeStateTracker: UnreferencedStateTracker,
|
|
@@ -162,14 +157,13 @@ export class GCTelemetryTracker {
|
|
|
162
157
|
return false;
|
|
163
158
|
}
|
|
164
159
|
|
|
165
|
-
// eslint-disable-next-line import/no-deprecated
|
|
166
160
|
if (nodeType === GCNodeType.Other) {
|
|
167
161
|
return false;
|
|
168
162
|
}
|
|
169
163
|
|
|
170
164
|
// For sub data store (DDS) nodes, if they are changed, its data store will also be changed,
|
|
171
165
|
// so skip logging to make the telemetry less noisy.
|
|
172
|
-
|
|
166
|
+
|
|
173
167
|
if (nodeType === GCNodeType.SubDataStore && usageType === "Changed") {
|
|
174
168
|
return false;
|
|
175
169
|
}
|
|
@@ -285,7 +279,7 @@ export class GCTelemetryTracker {
|
|
|
285
279
|
const event = {
|
|
286
280
|
eventName: `${state}Object_${usageType}`,
|
|
287
281
|
...tagCodeArtifacts({ pkg: packagePath?.join("/") }),
|
|
288
|
-
stack: generateStack(),
|
|
282
|
+
stack: generateStack(30),
|
|
289
283
|
id,
|
|
290
284
|
fromId,
|
|
291
285
|
headers: { ...headers },
|
|
@@ -305,7 +299,7 @@ export class GCTelemetryTracker {
|
|
|
305
299
|
*/
|
|
306
300
|
private logTombstoneUsageTelemetry(
|
|
307
301
|
unrefEventProps: Omit<IUnreferencedEventProps, "state" | "usageType">,
|
|
308
|
-
|
|
302
|
+
|
|
309
303
|
nodeType: GCNodeType,
|
|
310
304
|
usageType: NodeUsageType,
|
|
311
305
|
packagePath?: readonly string[],
|
|
@@ -320,7 +314,7 @@ export class GCTelemetryTracker {
|
|
|
320
314
|
const event = {
|
|
321
315
|
eventName: `GC_Tombstone_${nodeType}_${eventUsageName}`,
|
|
322
316
|
...tagCodeArtifacts({ pkg: packagePath?.join("/") }),
|
|
323
|
-
stack: generateStack(),
|
|
317
|
+
stack: generateStack(30),
|
|
324
318
|
id,
|
|
325
319
|
fromId,
|
|
326
320
|
headers: { ...headers },
|
|
@@ -373,7 +367,6 @@ export class GCTelemetryTracker {
|
|
|
373
367
|
for (const route of currentOutboundRoutes) {
|
|
374
368
|
const nodeType = this.getNodeType(route);
|
|
375
369
|
if (
|
|
376
|
-
// eslint-disable-next-line import/no-deprecated
|
|
377
370
|
(nodeType === GCNodeType.DataStore || nodeType === GCNodeType.Blob) &&
|
|
378
371
|
!nodeId.startsWith(route) &&
|
|
379
372
|
!previousRoutes.includes(route) &&
|
package/src/index.ts
CHANGED
|
@@ -5,10 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
7
|
ISummaryRuntimeOptions,
|
|
8
|
-
ISummaryBaseConfiguration,
|
|
9
|
-
ISummaryConfigurationHeuristics,
|
|
10
|
-
ISummaryConfigurationDisableSummarizer,
|
|
11
|
-
ISummaryConfigurationDisableHeuristics,
|
|
12
8
|
IContainerRuntimeOptions,
|
|
13
9
|
IContainerRuntimeOptionsInternal,
|
|
14
10
|
loadContainerRuntime,
|
|
@@ -18,8 +14,6 @@ export {
|
|
|
18
14
|
DeletedResponseHeaderKey,
|
|
19
15
|
TombstoneResponseHeaderKey,
|
|
20
16
|
InactiveResponseHeaderKey,
|
|
21
|
-
ISummaryConfiguration,
|
|
22
|
-
DefaultSummaryConfiguration,
|
|
23
17
|
ICompressionRuntimeOptions,
|
|
24
18
|
CompressionAlgorithms,
|
|
25
19
|
RuntimeHeaderData,
|
|
@@ -106,6 +100,12 @@ export {
|
|
|
106
100
|
IFluidDataStoreAttributes1,
|
|
107
101
|
IFluidDataStoreAttributes2,
|
|
108
102
|
OmitAttributesVersions,
|
|
103
|
+
ISummaryBaseConfiguration,
|
|
104
|
+
ISummaryConfigurationHeuristics,
|
|
105
|
+
ISummaryConfigurationDisableSummarizer,
|
|
106
|
+
ISummaryConfigurationDisableHeuristics,
|
|
107
|
+
ISummaryConfiguration,
|
|
108
|
+
DefaultSummaryConfiguration,
|
|
109
109
|
} from "./summary/index.js";
|
|
110
110
|
export { IChunkedOp, unpackRuntimeMessage } from "./opLifecycle/index.js";
|
|
111
111
|
export { ChannelCollection } from "./channelCollection.js";
|