@fluidframework/container-runtime 2.20.0 → 2.21.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/.eslintrc.cjs +36 -6
- package/CHANGELOG.md +38 -0
- package/api-report/container-runtime.legacy.alpha.api.md +31 -31
- package/dist/batchTracker.d.ts +1 -2
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +14 -11
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.d.ts +1 -0
- package/dist/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.js +7 -5
- package/dist/blobManager/blobManagerSnapSum.js.map +1 -1
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +63 -41
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.d.ts +2 -2
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +4 -4
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +14 -30
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +264 -194
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +6 -3
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +16 -11
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +1 -0
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +5 -5
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +36 -14
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +2 -0
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +8 -0
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +1 -0
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +8 -5
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +2 -1
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +29 -15
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/inboundBatchAggregator.js +3 -3
- package/dist/inboundBatchAggregator.js.map +1 -1
- package/dist/layerCompatState.d.ts +19 -0
- package/dist/layerCompatState.d.ts.map +1 -0
- package/dist/layerCompatState.js +64 -0
- package/dist/layerCompatState.js.map +1 -0
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/duplicateBatchDetector.js +2 -2
- package/dist/opLifecycle/duplicateBatchDetector.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts +3 -2
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +13 -19
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +3 -0
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +4 -1
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +5 -3
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +13 -10
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +14 -11
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +3 -3
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +11 -15
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +3 -1
- package/dist/opLifecycle/remoteMessageProcessor.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 +3 -4
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +11 -10
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/summary/documentSchema.d.ts +7 -0
- package/dist/summary/documentSchema.d.ts.map +1 -1
- package/dist/summary/documentSchema.js +6 -4
- package/dist/summary/documentSchema.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +1 -0
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +13 -11
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -0
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +7 -2
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +2 -2
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +38 -17
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +1 -0
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +18 -9
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js +1 -0
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js +1 -1
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/index.d.ts.map +1 -1
- package/dist/summary/summarizerNode/index.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +30 -31
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +3 -3
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +7 -0
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +3 -4
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +9 -6
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +4 -1
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js +3 -2
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +19 -8
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +12 -9
- package/dist/summary/summaryManager.js.map +1 -1
- package/lib/batchTracker.d.ts +1 -2
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +2 -2
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +14 -11
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.d.ts +1 -0
- package/lib/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.js +7 -5
- package/lib/blobManager/blobManagerSnapSum.js.map +1 -1
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +66 -42
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.d.ts +2 -2
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +5 -5
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +14 -30
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +271 -196
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +6 -3
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +16 -11
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +1 -0
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +6 -6
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +39 -15
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +2 -0
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +8 -0
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +1 -0
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +8 -5
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +2 -1
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +32 -16
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/inboundBatchAggregator.js +4 -4
- package/lib/inboundBatchAggregator.js.map +1 -1
- package/lib/layerCompatState.d.ts +19 -0
- package/lib/layerCompatState.d.ts.map +1 -0
- package/lib/layerCompatState.js +60 -0
- package/lib/layerCompatState.js.map +1 -0
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js.map +1 -1
- package/lib/opLifecycle/duplicateBatchDetector.js +2 -2
- package/lib/opLifecycle/duplicateBatchDetector.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts +3 -2
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +13 -19
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts +3 -0
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +4 -1
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +5 -3
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +13 -10
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +14 -11
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +3 -3
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +11 -15
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +3 -1
- package/lib/opLifecycle/remoteMessageProcessor.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 +3 -4
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +12 -11
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/summary/documentSchema.d.ts +7 -0
- package/lib/summary/documentSchema.d.ts.map +1 -1
- package/lib/summary/documentSchema.js +6 -4
- package/lib/summary/documentSchema.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +1 -0
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +13 -11
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +1 -0
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +7 -2
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +2 -2
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +38 -17
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +1 -0
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +18 -9
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js +1 -0
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.js +1 -1
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/index.d.ts.map +1 -1
- package/lib/summary/summarizerNode/index.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +30 -31
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +3 -3
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +7 -0
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +3 -4
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +9 -6
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +4 -1
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js +2 -2
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +19 -8
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +12 -9
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +21 -43
- package/src/batchTracker.ts +3 -3
- package/src/blobManager/blobManager.ts +16 -14
- package/src/blobManager/blobManagerSnapSum.ts +8 -8
- package/src/channelCollection.ts +63 -44
- package/src/connectionTelemetry.ts +12 -6
- package/src/containerRuntime.ts +306 -235
- package/src/dataStore.ts +6 -3
- package/src/dataStoreContext.ts +16 -16
- package/src/dataStoreContexts.ts +1 -0
- package/src/deltaScheduler.ts +6 -6
- package/src/gc/garbageCollection.ts +47 -20
- package/src/gc/gcConfigs.ts +9 -1
- package/src/gc/gcDefinitions.ts +12 -0
- package/src/gc/gcHelpers.ts +9 -4
- package/src/gc/gcSummaryStateTracker.ts +3 -1
- package/src/gc/gcTelemetry.ts +26 -11
- package/src/inboundBatchAggregator.ts +4 -4
- package/src/layerCompatState.ts +75 -0
- package/src/messageTypes.ts +2 -0
- package/src/opLifecycle/README.md +43 -34
- package/src/opLifecycle/duplicateBatchDetector.ts +2 -2
- package/src/opLifecycle/opCompressor.ts +16 -23
- package/src/opLifecycle/opDecompressor.ts +4 -1
- package/src/opLifecycle/opGroupingManager.ts +5 -4
- package/src/opLifecycle/opSplitter.ts +14 -11
- package/src/opLifecycle/outbox.ts +13 -20
- package/src/opLifecycle/remoteMessageProcessor.ts +3 -1
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +15 -10
- package/src/summary/documentSchema.ts +11 -4
- package/src/summary/orderedClientElection.ts +14 -11
- package/src/summary/runWhileConnectedCoordinator.ts +6 -0
- package/src/summary/runningSummarizer.ts +43 -19
- package/src/summary/summarizer.ts +24 -11
- package/src/summary/summarizerClientElection.ts +2 -0
- package/src/summary/summarizerHeuristics.ts +1 -1
- package/src/summary/summarizerNode/index.ts +1 -0
- package/src/summary/summarizerNode/summarizerNode.ts +32 -31
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +4 -4
- package/src/summary/summarizerTypes.ts +7 -0
- package/src/summary/summaryCollection.ts +19 -8
- package/src/summary/summaryFormat.ts +10 -5
- package/src/summary/summaryGenerator.ts +25 -10
- package/src/summary/summaryManager.ts +14 -12
- package/container-runtime.test-files.tar +0 -0
package/src/dataStore.ts
CHANGED
|
@@ -82,18 +82,20 @@ class DataStore implements IDataStore {
|
|
|
82
82
|
switch (this.aliasState) {
|
|
83
83
|
// If we're already aliasing, check if it's for the same value and return
|
|
84
84
|
// the stored promise, otherwise return 'AlreadyAliased'
|
|
85
|
-
case AliasState.Aliasing:
|
|
85
|
+
case AliasState.Aliasing: {
|
|
86
86
|
assert(
|
|
87
87
|
this.aliasResult !== undefined,
|
|
88
88
|
0x316 /* There should be a cached promise of in-progress aliasing */,
|
|
89
89
|
);
|
|
90
90
|
await this.aliasResult;
|
|
91
91
|
return this.alias === alias ? "Success" : "AlreadyAliased";
|
|
92
|
+
}
|
|
92
93
|
|
|
93
94
|
// If this datastore is already aliased, return true only if this
|
|
94
95
|
// is a repeated call for the same alias
|
|
95
|
-
case AliasState.Aliased:
|
|
96
|
+
case AliasState.Aliased: {
|
|
96
97
|
return this.alias === alias ? "Success" : "AlreadyAliased";
|
|
98
|
+
}
|
|
97
99
|
|
|
98
100
|
case AliasState.None: {
|
|
99
101
|
const existingAlias = this.pendingAliases.get(alias);
|
|
@@ -108,8 +110,9 @@ class DataStore implements IDataStore {
|
|
|
108
110
|
break;
|
|
109
111
|
}
|
|
110
112
|
|
|
111
|
-
default:
|
|
113
|
+
default: {
|
|
112
114
|
unreachableCase(this.aliasState);
|
|
115
|
+
}
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
this.aliasState = AliasState.Aliasing;
|
package/src/dataStoreContext.ts
CHANGED
|
@@ -300,7 +300,8 @@ export abstract class FluidDataStoreContext
|
|
|
300
300
|
return aliasedDataStores.has(this.id);
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
|
|
303
|
+
const snapshotDetails = await this.getInitialSnapshotDetails();
|
|
304
|
+
return snapshotDetails.isRootDataStore;
|
|
304
305
|
}
|
|
305
306
|
|
|
306
307
|
/**
|
|
@@ -383,15 +384,9 @@ export abstract class FluidDataStoreContext
|
|
|
383
384
|
? this.parentContext.attachState
|
|
384
385
|
: AttachState.Detached;
|
|
385
386
|
|
|
386
|
-
const thisSummarizeInternal = async (
|
|
387
|
-
fullTree: boolean,
|
|
388
|
-
trackState: boolean,
|
|
389
|
-
telemetryContext?: ITelemetryContext,
|
|
390
|
-
): Promise<ISummarizeInternalResult> =>
|
|
391
|
-
this.summarizeInternal(fullTree, trackState, telemetryContext);
|
|
392
|
-
|
|
393
387
|
this.summarizerNode = props.createSummarizerNodeFn(
|
|
394
|
-
|
|
388
|
+
async (fullTree, trackState, telemetryContext) =>
|
|
389
|
+
this.summarizeInternal(fullTree, trackState, telemetryContext),
|
|
395
390
|
async (fullGC?: boolean) => this.getGCDataInternal(fullGC),
|
|
396
391
|
);
|
|
397
392
|
|
|
@@ -619,9 +614,7 @@ export abstract class FluidDataStoreContext
|
|
|
619
614
|
channel: IFluidDataStoreChannel,
|
|
620
615
|
messageCollection: IRuntimeMessageCollection,
|
|
621
616
|
): void {
|
|
622
|
-
if (channel.processMessages
|
|
623
|
-
channel.processMessages(messageCollection);
|
|
624
|
-
} else {
|
|
617
|
+
if (channel.processMessages === undefined) {
|
|
625
618
|
const { envelope, messagesContent, local } = messageCollection;
|
|
626
619
|
for (const { contents, localOpMetadata, clientSequenceNumber } of messagesContent) {
|
|
627
620
|
channel.process(
|
|
@@ -630,6 +623,8 @@ export abstract class FluidDataStoreContext
|
|
|
630
623
|
localOpMetadata,
|
|
631
624
|
);
|
|
632
625
|
}
|
|
626
|
+
} else {
|
|
627
|
+
channel.processMessages(messageCollection);
|
|
633
628
|
}
|
|
634
629
|
}
|
|
635
630
|
|
|
@@ -657,7 +652,7 @@ export abstract class FluidDataStoreContext
|
|
|
657
652
|
);
|
|
658
653
|
this.pendingMessagesState.messageCollections.push({
|
|
659
654
|
...messageCollection,
|
|
660
|
-
messagesContent:
|
|
655
|
+
messagesContent: [...messagesContent],
|
|
661
656
|
});
|
|
662
657
|
this.pendingMessagesState.pendingCount += messagesContent.length;
|
|
663
658
|
this.thresholdOpsCounter.sendIfMultiple(
|
|
@@ -1149,6 +1144,7 @@ export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
1149
1144
|
*/
|
|
1150
1145
|
public setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {}
|
|
1151
1146
|
|
|
1147
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda
|
|
1152
1148
|
private readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {
|
|
1153
1149
|
// Sequence number of the snapshot.
|
|
1154
1150
|
let sequenceNumber: number | undefined;
|
|
@@ -1281,7 +1277,7 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1281
1277
|
|
|
1282
1278
|
public setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {
|
|
1283
1279
|
switch (attachState) {
|
|
1284
|
-
case AttachState.Attaching:
|
|
1280
|
+
case AttachState.Attaching: {
|
|
1285
1281
|
assert(
|
|
1286
1282
|
this.attachState === AttachState.Detached,
|
|
1287
1283
|
0x14d /* "Should move from detached to attaching" */,
|
|
@@ -1295,7 +1291,8 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1295
1291
|
this.emit("attaching");
|
|
1296
1292
|
}
|
|
1297
1293
|
break;
|
|
1298
|
-
|
|
1294
|
+
}
|
|
1295
|
+
case AttachState.Attached: {
|
|
1299
1296
|
// We can get called into here twice, as result of both container and data store being attached, if
|
|
1300
1297
|
// those processes overlapped, for example, in a flow like that one:
|
|
1301
1298
|
// 1. Container attach started
|
|
@@ -1318,8 +1315,10 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1318
1315
|
}
|
|
1319
1316
|
}
|
|
1320
1317
|
break;
|
|
1321
|
-
|
|
1318
|
+
}
|
|
1319
|
+
default: {
|
|
1322
1320
|
unreachableCase(attachState, "unreached");
|
|
1321
|
+
}
|
|
1323
1322
|
}
|
|
1324
1323
|
}
|
|
1325
1324
|
|
|
@@ -1364,6 +1363,7 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1364
1363
|
return this.channel.getAttachGCData(telemetryContext);
|
|
1365
1364
|
}
|
|
1366
1365
|
|
|
1366
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda
|
|
1367
1367
|
private readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {
|
|
1368
1368
|
let snapshot = this.snapshotTree;
|
|
1369
1369
|
// eslint-disable-next-line import/no-deprecated
|
package/src/dataStoreContexts.ts
CHANGED
|
@@ -34,6 +34,7 @@ export class DataStoreContexts
|
|
|
34
34
|
*/
|
|
35
35
|
private readonly deferredContexts = new Map<string, Deferred<FluidDataStoreContext>>();
|
|
36
36
|
|
|
37
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda
|
|
37
38
|
private readonly disposeOnce = new Lazy<void>(() => {
|
|
38
39
|
// close/stop all store contexts
|
|
39
40
|
for (const [fluidDataStoreId, contextD] of this.deferredContexts) {
|
package/src/deltaScheduler.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { performanceNow, type TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
7
|
import { IDeltaManagerFull } from "@fluidframework/container-definitions/internal";
|
|
8
8
|
import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
9
9
|
import type { IContainerRuntimeBaseEvents } from "@fluidframework/runtime-definitions/internal";
|
|
@@ -67,7 +67,7 @@ export class DeltaScheduler {
|
|
|
67
67
|
|
|
68
68
|
private readonly batchBegin = (message: ISequencedDocumentMessage): void => {
|
|
69
69
|
if (!this.processingStartTime) {
|
|
70
|
-
this.processingStartTime =
|
|
70
|
+
this.processingStartTime = performanceNow();
|
|
71
71
|
}
|
|
72
72
|
if (this.schedulingLog === undefined && this.schedulingCount % 500 === 0) {
|
|
73
73
|
// Every 500th time we are scheduling the inbound queue, we log telemetry for the
|
|
@@ -79,7 +79,7 @@ export class DeltaScheduler {
|
|
|
79
79
|
numberOfBatchesProcessed: 0,
|
|
80
80
|
firstSequenceNumber: message.sequenceNumber,
|
|
81
81
|
lastSequenceNumber: message.sequenceNumber,
|
|
82
|
-
startTime:
|
|
82
|
+
startTime: performanceNow(),
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
};
|
|
@@ -92,7 +92,7 @@ export class DeltaScheduler {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
if (this.shouldRunScheduler()) {
|
|
95
|
-
const currentTime =
|
|
95
|
+
const currentTime = performanceNow();
|
|
96
96
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
97
97
|
const elapsedTime = currentTime - this.processingStartTime!;
|
|
98
98
|
if (elapsedTime > this.currentAllowedProcessingTimeForTurn) {
|
|
@@ -126,7 +126,7 @@ export class DeltaScheduler {
|
|
|
126
126
|
processingTime: formatTick(this.schedulingLog.totalProcessingTime),
|
|
127
127
|
numberOfTurns: this.schedulingLog.numberOfTurns,
|
|
128
128
|
batchesProcessed: this.schedulingLog.numberOfBatchesProcessed,
|
|
129
|
-
timeToResume: formatTick(
|
|
129
|
+
timeToResume: formatTick(performanceNow() - currentTime),
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
this.deltaManager.inbound.resume();
|
|
@@ -141,7 +141,7 @@ export class DeltaScheduler {
|
|
|
141
141
|
if (this.schedulingLog) {
|
|
142
142
|
// Add the time taken for processing the final ops to the total processing time in the
|
|
143
143
|
// telemetry log object.
|
|
144
|
-
const currentTime =
|
|
144
|
+
const currentTime = performanceNow();
|
|
145
145
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
146
146
|
this.schedulingLog.totalProcessingTime += currentTime - this.processingStartTime!;
|
|
147
147
|
|
|
@@ -34,17 +34,22 @@ 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
|
|
37
38
|
GCNodeType,
|
|
38
39
|
GarbageCollectionMessage,
|
|
39
40
|
GarbageCollectionMessageType,
|
|
41
|
+
// eslint-disable-next-line import/no-deprecated
|
|
40
42
|
IGCMetadata,
|
|
41
43
|
IGCResult,
|
|
44
|
+
// eslint-disable-next-line import/no-deprecated
|
|
42
45
|
IGCStats,
|
|
43
46
|
IGarbageCollectionRuntime,
|
|
44
47
|
IGarbageCollector,
|
|
45
48
|
IGarbageCollectorConfigs,
|
|
46
49
|
IGarbageCollectorCreateParams,
|
|
50
|
+
// eslint-disable-next-line import/no-deprecated
|
|
47
51
|
IMarkPhaseStats,
|
|
52
|
+
// eslint-disable-next-line import/no-deprecated
|
|
48
53
|
ISweepPhaseStats,
|
|
49
54
|
UnreferencedState,
|
|
50
55
|
type IGCNodeUpdatedProps,
|
|
@@ -305,7 +310,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
305
310
|
),
|
|
306
311
|
);
|
|
307
312
|
}
|
|
308
|
-
gcNodes[nodeId] =
|
|
313
|
+
gcNodes[nodeId] = [...nodeData.outboundRoutes];
|
|
309
314
|
}
|
|
310
315
|
this.gcDataFromLastRun = { gcNodes };
|
|
311
316
|
});
|
|
@@ -324,7 +329,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
324
329
|
|
|
325
330
|
const gcNodes: { [id: string]: string[] } = {};
|
|
326
331
|
for (const [nodeId, nodeData] of Object.entries(baseSnapshotData.gcState.gcNodes)) {
|
|
327
|
-
gcNodes[nodeId] =
|
|
332
|
+
gcNodes[nodeId] = [...nodeData.outboundRoutes];
|
|
328
333
|
}
|
|
329
334
|
// Run GC on the nodes in the base summary to get the routes used in each node in the container.
|
|
330
335
|
// This is an optimization for space (vs performance) wherein we don't need to store the used routes of
|
|
@@ -347,8 +352,10 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
347
352
|
/**
|
|
348
353
|
* API for ensuring the correct auto-recovery mitigations
|
|
349
354
|
*/
|
|
355
|
+
// TODO: consider hoisting this to an outer scope as an optimization
|
|
356
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping
|
|
350
357
|
private readonly autoRecovery = (() => {
|
|
351
|
-
// This uses a hidden state machine for forcing fullGC as part of
|
|
358
|
+
// This uses a hidden state machine for forcing fullGC as part of auto-recovery,
|
|
352
359
|
// to regenerate the GC data for each node.
|
|
353
360
|
//
|
|
354
361
|
// Once fullGC has been requested, we need to wait until GC has run and the summary has been acked before clearing the state.
|
|
@@ -410,7 +417,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
410
417
|
// Initialize the tombstone state from the snapshot. Also, notify the runtime of tombstone routes.
|
|
411
418
|
if (baseSnapshotData.tombstones !== undefined) {
|
|
412
419
|
// Create a copy since we are writing from a source we don't control
|
|
413
|
-
this.tombstones =
|
|
420
|
+
this.tombstones = [...baseSnapshotData.tombstones];
|
|
414
421
|
this.runtime.updateTombstonedRoutes(this.tombstones);
|
|
415
422
|
}
|
|
416
423
|
|
|
@@ -435,14 +442,14 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
435
442
|
},
|
|
436
443
|
async (event) => {
|
|
437
444
|
// If the GC state hasn't been initialized yet, initialize it and return.
|
|
438
|
-
if (
|
|
439
|
-
await this.initializeGCStateFromBaseSnapshotP;
|
|
440
|
-
} else {
|
|
445
|
+
if (initialized) {
|
|
441
446
|
// If the GC state has been initialized, update the tracking of unreferenced nodes as per the current
|
|
442
447
|
// reference timestamp.
|
|
443
448
|
for (const [, nodeStateTracker] of this.unreferencedNodesState) {
|
|
444
449
|
nodeStateTracker.updateTracking(currentReferenceTimestampMs);
|
|
445
450
|
}
|
|
451
|
+
} else {
|
|
452
|
+
await this.initializeGCStateFromBaseSnapshotP;
|
|
446
453
|
}
|
|
447
454
|
event.end({
|
|
448
455
|
details: { initialized, unrefNodeCount: this.unreferencedNodesState.size },
|
|
@@ -509,6 +516,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
509
516
|
fullGC?: boolean;
|
|
510
517
|
},
|
|
511
518
|
telemetryContext?: ITelemetryContext,
|
|
519
|
+
// eslint-disable-next-line import/no-deprecated
|
|
512
520
|
): Promise<IGCStats | undefined> {
|
|
513
521
|
const fullGC =
|
|
514
522
|
options.fullGC ?? (this.configs.runFullGC === true || this.autoRecovery.useFullGC());
|
|
@@ -606,6 +614,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
606
614
|
fullGC: boolean,
|
|
607
615
|
currentReferenceTimestampMs: number,
|
|
608
616
|
logger: ITelemetryLoggerExt,
|
|
617
|
+
// eslint-disable-next-line import/no-deprecated
|
|
609
618
|
): Promise<IGCStats> {
|
|
610
619
|
// 1. Generate / analyze the runtime's reference graph.
|
|
611
620
|
// Get the reference graph (gcData) and run GC algorithm to get referenced / unreferenced nodes.
|
|
@@ -761,6 +770,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
761
770
|
// local state when processing the op.
|
|
762
771
|
const sweepReadyDSAndBlobs = nodesToDelete.filter((nodeId) => {
|
|
763
772
|
const nodeType = this.runtime.getNodeType(nodeId);
|
|
773
|
+
// eslint-disable-next-line import/no-deprecated
|
|
764
774
|
return nodeType === GCNodeType.DataStore || nodeType === GCNodeType.Blob;
|
|
765
775
|
});
|
|
766
776
|
const contents: GarbageCollectionMessage = {
|
|
@@ -838,16 +848,14 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
838
848
|
*/
|
|
839
849
|
const gcDataSuperSet = concatGarbageCollectionData(previousGCData, currentGCData);
|
|
840
850
|
const newOutboundRoutesSinceLastRun: string[] = [];
|
|
841
|
-
this.newReferencesSinceLastRun
|
|
842
|
-
(
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
},
|
|
850
|
-
);
|
|
851
|
+
for (const [sourceNodeId, outboundRoutes] of this.newReferencesSinceLastRun) {
|
|
852
|
+
if (gcDataSuperSet.gcNodes[sourceNodeId] === undefined) {
|
|
853
|
+
gcDataSuperSet.gcNodes[sourceNodeId] = outboundRoutes;
|
|
854
|
+
} else {
|
|
855
|
+
gcDataSuperSet.gcNodes[sourceNodeId].push(...outboundRoutes);
|
|
856
|
+
}
|
|
857
|
+
newOutboundRoutesSinceLastRun.push(...outboundRoutes);
|
|
858
|
+
}
|
|
851
859
|
|
|
852
860
|
/**
|
|
853
861
|
* Run GC on the above reference graph starting with root and all new outbound routes. This will generate a
|
|
@@ -894,6 +902,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
894
902
|
);
|
|
895
903
|
}
|
|
896
904
|
|
|
905
|
+
// eslint-disable-next-line import/no-deprecated
|
|
897
906
|
public getMetadata(): IGCMetadata {
|
|
898
907
|
return {
|
|
899
908
|
/**
|
|
@@ -950,11 +959,12 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
950
959
|
this.autoRecovery.requestFullGCOnNextRun();
|
|
951
960
|
break;
|
|
952
961
|
}
|
|
953
|
-
default:
|
|
962
|
+
default: {
|
|
954
963
|
throw DataProcessingError.create(
|
|
955
964
|
`Garbage collection message of unknown type ${gcMessageType}`,
|
|
956
965
|
"processMessage",
|
|
957
966
|
);
|
|
967
|
+
}
|
|
958
968
|
}
|
|
959
969
|
}
|
|
960
970
|
}
|
|
@@ -975,7 +985,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
975
985
|
// The ids in the sweep-ready nodes do not contain DDS node ids. This is an optimization to reduce the size
|
|
976
986
|
// of the GC op. Since GC applies to data store only, all its DDSes are deleted along with it. So, get the
|
|
977
987
|
// DDS nodes ID from the unreferenced nodes state.
|
|
978
|
-
const allSweepReadyNodeIds =
|
|
988
|
+
const allSweepReadyNodeIds = [...sweepReadyNodeIds];
|
|
979
989
|
for (const [id] of this.unreferencedNodesState) {
|
|
980
990
|
// Ignore data store nodes since they would already be in the list.
|
|
981
991
|
const pathParts = id.split("/");
|
|
@@ -1024,7 +1034,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1024
1034
|
// trackedId will be either DataStore or Blob ID (not sub-DataStore ID, since some of those are unrecognized by GC)
|
|
1025
1035
|
const trackedId = node.path;
|
|
1026
1036
|
const isTombstoned = this.tombstones.includes(trackedId);
|
|
1027
|
-
const fullPath = request
|
|
1037
|
+
const fullPath = request === undefined ? trackedId : urlToGCNodePath(request.url);
|
|
1028
1038
|
|
|
1029
1039
|
// This will log if appropriate
|
|
1030
1040
|
this.telemetryTracker.nodeUsed(trackedId, {
|
|
@@ -1055,6 +1065,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1055
1065
|
// Unless this is a Loaded event for a Blob or DataStore, we're done after telemetry tracking
|
|
1056
1066
|
const loadedBlobOrDataStore =
|
|
1057
1067
|
reason === "Loaded" &&
|
|
1068
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1058
1069
|
(nodeType === GCNodeType.Blob || nodeType === GCNodeType.DataStore);
|
|
1059
1070
|
if (!loadedBlobOrDataStore) {
|
|
1060
1071
|
return;
|
|
@@ -1182,7 +1193,9 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1182
1193
|
* @param gcResult - The result of the current GC run.
|
|
1183
1194
|
* @returns the stats of the mark phase run.
|
|
1184
1195
|
*/
|
|
1196
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1185
1197
|
private getMarkPhaseStats(gcResult: IGCResult): IMarkPhaseStats {
|
|
1198
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1186
1199
|
const markPhaseStats: IMarkPhaseStats = {
|
|
1187
1200
|
nodeCount: 0,
|
|
1188
1201
|
dataStoreCount: 0,
|
|
@@ -1209,6 +1222,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1209
1222
|
markPhaseStats.unrefNodeCount++;
|
|
1210
1223
|
}
|
|
1211
1224
|
|
|
1225
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1212
1226
|
if (this.runtime.getNodeType(nodeId) === GCNodeType.DataStore) {
|
|
1213
1227
|
markPhaseStats.dataStoreCount++;
|
|
1214
1228
|
if (stateUpdated) {
|
|
@@ -1218,6 +1232,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1218
1232
|
markPhaseStats.unrefDataStoreCount++;
|
|
1219
1233
|
}
|
|
1220
1234
|
}
|
|
1235
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1221
1236
|
if (this.runtime.getNodeType(nodeId) === GCNodeType.Blob) {
|
|
1222
1237
|
markPhaseStats.attachmentBlobCount++;
|
|
1223
1238
|
if (stateUpdated) {
|
|
@@ -1251,10 +1266,13 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1251
1266
|
private getSweepPhaseStats(
|
|
1252
1267
|
deletedNodes: Set<string>,
|
|
1253
1268
|
sweepReadyNodes: Set<string>,
|
|
1269
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1254
1270
|
markPhaseStats: IMarkPhaseStats,
|
|
1271
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1255
1272
|
): ISweepPhaseStats {
|
|
1256
1273
|
// Initialize the life time node counts to the mark phase node counts. If sweep is not enabled,
|
|
1257
1274
|
// these will be the life time node count for this container.
|
|
1275
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1258
1276
|
const sweepPhaseStats: ISweepPhaseStats = {
|
|
1259
1277
|
lifetimeNodeCount: markPhaseStats.nodeCount,
|
|
1260
1278
|
lifetimeDataStoreCount: markPhaseStats.dataStoreCount,
|
|
@@ -1266,25 +1284,32 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1266
1284
|
|
|
1267
1285
|
// The runtime can't reliably identify the type of deleted nodes. So, get the type here. This should
|
|
1268
1286
|
// be good enough because the only types that participate in GC today are data stores, DDSes and blobs.
|
|
1287
|
+
// eslint-disable-next-line import/no-deprecated, unicorn/consistent-function-scoping
|
|
1269
1288
|
const getDeletedNodeType = (nodeId: string): GCNodeType => {
|
|
1270
1289
|
const pathParts = nodeId.split("/");
|
|
1271
1290
|
if (pathParts[1] === blobManagerBasePath) {
|
|
1291
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1272
1292
|
return GCNodeType.Blob;
|
|
1273
1293
|
}
|
|
1274
1294
|
if (pathParts.length === 2) {
|
|
1295
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1275
1296
|
return GCNodeType.DataStore;
|
|
1276
1297
|
}
|
|
1277
1298
|
if (pathParts.length === 3) {
|
|
1299
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1278
1300
|
return GCNodeType.SubDataStore;
|
|
1279
1301
|
}
|
|
1302
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1280
1303
|
return GCNodeType.Other;
|
|
1281
1304
|
};
|
|
1282
1305
|
|
|
1283
1306
|
for (const nodeId of deletedNodes) {
|
|
1284
1307
|
sweepPhaseStats.deletedNodeCount++;
|
|
1285
1308
|
const nodeType = getDeletedNodeType(nodeId);
|
|
1309
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1286
1310
|
if (nodeType === GCNodeType.DataStore) {
|
|
1287
1311
|
sweepPhaseStats.deletedDataStoreCount++;
|
|
1312
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1288
1313
|
} else if (nodeType === GCNodeType.Blob) {
|
|
1289
1314
|
sweepPhaseStats.deletedAttachmentBlobCount++;
|
|
1290
1315
|
}
|
|
@@ -1305,8 +1330,10 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1305
1330
|
for (const nodeId of sweepReadyNodes) {
|
|
1306
1331
|
sweepPhaseStats.deletedNodeCount++;
|
|
1307
1332
|
const nodeType = this.runtime.getNodeType(nodeId);
|
|
1333
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1308
1334
|
if (nodeType === GCNodeType.DataStore) {
|
|
1309
1335
|
sweepPhaseStats.deletedDataStoreCount++;
|
|
1336
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1310
1337
|
} else if (nodeType === GCNodeType.Blob) {
|
|
1311
1338
|
sweepPhaseStats.deletedAttachmentBlobCount++;
|
|
1312
1339
|
}
|
package/src/gc/gcConfigs.ts
CHANGED
|
@@ -9,10 +9,13 @@ import {
|
|
|
9
9
|
validatePrecondition,
|
|
10
10
|
} from "@fluidframework/telemetry-utils/internal";
|
|
11
11
|
|
|
12
|
+
// eslint-disable-next-line import/no-deprecated
|
|
12
13
|
import { IContainerRuntimeMetadata } from "../summary/index.js";
|
|
13
14
|
|
|
14
15
|
import {
|
|
16
|
+
// eslint-disable-next-line import/no-deprecated
|
|
15
17
|
GCFeatureMatrix,
|
|
18
|
+
// eslint-disable-next-line import/no-deprecated
|
|
16
19
|
GCVersion,
|
|
17
20
|
IGCMetadata_Deprecated,
|
|
18
21
|
IGCRuntimeOptions,
|
|
@@ -42,6 +45,7 @@ export function generateGCConfigs(
|
|
|
42
45
|
mc: MonitoringContext,
|
|
43
46
|
createParams: {
|
|
44
47
|
gcOptions: IGCRuntimeOptions;
|
|
48
|
+
// eslint-disable-next-line import/no-deprecated
|
|
45
49
|
metadata: IContainerRuntimeMetadata | undefined;
|
|
46
50
|
existing: boolean;
|
|
47
51
|
isSummarizerClient: boolean;
|
|
@@ -50,7 +54,9 @@ export function generateGCConfigs(
|
|
|
50
54
|
let gcAllowed: boolean = true;
|
|
51
55
|
let sessionExpiryTimeoutMs: number | undefined;
|
|
52
56
|
let tombstoneTimeoutMs: number | undefined;
|
|
57
|
+
// eslint-disable-next-line import/no-deprecated
|
|
53
58
|
let persistedGcFeatureMatrix: GCFeatureMatrix | undefined;
|
|
59
|
+
// eslint-disable-next-line import/no-deprecated
|
|
54
60
|
let gcVersionInBaseSnapshot: GCVersion | undefined;
|
|
55
61
|
|
|
56
62
|
/**
|
|
@@ -98,7 +104,9 @@ export function generateGCConfigs(
|
|
|
98
104
|
// Note that if no generation option is provided, Sweep is allowed for any document.
|
|
99
105
|
const sweepAllowed = shouldAllowGcSweep(
|
|
100
106
|
persistedGcFeatureMatrix ?? {} /* featureMatrix */,
|
|
101
|
-
createParams.gcOptions[gcGenerationOptionName]
|
|
107
|
+
createParams.gcOptions[gcGenerationOptionName] as
|
|
108
|
+
| number
|
|
109
|
+
| undefined /* currentGeneration */,
|
|
102
110
|
);
|
|
103
111
|
|
|
104
112
|
/**
|
package/src/gc/gcDefinitions.ts
CHANGED
|
@@ -21,7 +21,9 @@ 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
|
|
24
25
|
IContainerRuntimeMetadata,
|
|
26
|
+
// eslint-disable-next-line import/no-deprecated
|
|
25
27
|
ICreateContainerMetadata,
|
|
26
28
|
IRefreshSummaryResult,
|
|
27
29
|
} from "../summary/index.js";
|
|
@@ -29,6 +31,7 @@ import {
|
|
|
29
31
|
/**
|
|
30
32
|
* @legacy
|
|
31
33
|
* @alpha
|
|
34
|
+
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
32
35
|
*/
|
|
33
36
|
export type GCVersion = number;
|
|
34
37
|
|
|
@@ -91,6 +94,7 @@ export const defaultSweepGracePeriodMs = 1 * oneDayMs; // 1 day
|
|
|
91
94
|
* @see IGCMetadata.gcFeatureMatrix and @see gcGenerationOptionName
|
|
92
95
|
* @legacy
|
|
93
96
|
* @alpha
|
|
97
|
+
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
94
98
|
*/
|
|
95
99
|
export type GCFeatureMatrix =
|
|
96
100
|
| {
|
|
@@ -131,6 +135,7 @@ export interface IGCMetadata_Deprecated {
|
|
|
131
135
|
*
|
|
132
136
|
* @legacy
|
|
133
137
|
* @alpha
|
|
138
|
+
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
134
139
|
*/
|
|
135
140
|
export interface IGCMetadata {
|
|
136
141
|
/**
|
|
@@ -181,6 +186,7 @@ export interface IGCMetadata {
|
|
|
181
186
|
* The statistics of the system state after a garbage collection mark phase run.
|
|
182
187
|
* @legacy
|
|
183
188
|
* @alpha
|
|
189
|
+
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
184
190
|
*/
|
|
185
191
|
export interface IMarkPhaseStats {
|
|
186
192
|
/**
|
|
@@ -225,6 +231,7 @@ export interface IMarkPhaseStats {
|
|
|
225
231
|
* The statistics of the system state after a garbage collection sweep phase run.
|
|
226
232
|
* @legacy
|
|
227
233
|
* @alpha
|
|
234
|
+
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
228
235
|
*/
|
|
229
236
|
export interface ISweepPhaseStats {
|
|
230
237
|
/**
|
|
@@ -257,6 +264,7 @@ export interface ISweepPhaseStats {
|
|
|
257
264
|
* The statistics of the system state after a garbage collection run.
|
|
258
265
|
* @legacy
|
|
259
266
|
* @alpha
|
|
267
|
+
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
260
268
|
*/
|
|
261
269
|
export interface IGCStats extends IMarkPhaseStats, ISweepPhaseStats {}
|
|
262
270
|
|
|
@@ -264,6 +272,7 @@ export interface IGCStats extends IMarkPhaseStats, ISweepPhaseStats {}
|
|
|
264
272
|
* The types of GC nodes in the GC reference graph.
|
|
265
273
|
* @legacy
|
|
266
274
|
* @alpha
|
|
275
|
+
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
267
276
|
*/
|
|
268
277
|
export const GCNodeType = {
|
|
269
278
|
// Nodes that are for data stores.
|
|
@@ -279,6 +288,7 @@ export const GCNodeType = {
|
|
|
279
288
|
/**
|
|
280
289
|
* @legacy
|
|
281
290
|
* @alpha
|
|
291
|
+
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
282
292
|
*/
|
|
283
293
|
export type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];
|
|
284
294
|
|
|
@@ -502,7 +512,9 @@ export interface IGarbageCollectorCreateParams {
|
|
|
502
512
|
readonly gcOptions: IGCRuntimeOptions;
|
|
503
513
|
readonly baseLogger: ITelemetryLoggerExt;
|
|
504
514
|
readonly existing: boolean;
|
|
515
|
+
// eslint-disable-next-line import/no-deprecated
|
|
505
516
|
readonly metadata: IContainerRuntimeMetadata | undefined;
|
|
517
|
+
// eslint-disable-next-line import/no-deprecated
|
|
506
518
|
readonly createContainerMetadata: ICreateContainerMetadata;
|
|
507
519
|
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
508
520
|
readonly isSummarizerClient: boolean;
|
package/src/gc/gcHelpers.ts
CHANGED
|
@@ -15,8 +15,11 @@ import {
|
|
|
15
15
|
import type { IConfigProvider } from "@fluidframework/telemetry-utils/internal";
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
|
+
// eslint-disable-next-line import/no-deprecated
|
|
18
19
|
GCFeatureMatrix,
|
|
20
|
+
// eslint-disable-next-line import/no-deprecated
|
|
19
21
|
GCVersion,
|
|
22
|
+
// eslint-disable-next-line import/no-deprecated
|
|
20
23
|
IGCMetadata,
|
|
21
24
|
gcVersionUpgradeToV4Key,
|
|
22
25
|
nextGCVersion,
|
|
@@ -28,6 +31,7 @@ import {
|
|
|
28
31
|
IGarbageCollectionState,
|
|
29
32
|
} from "./gcSummaryDefinitions.js";
|
|
30
33
|
|
|
34
|
+
// eslint-disable-next-line import/no-deprecated
|
|
31
35
|
export function getGCVersion(metadata?: IGCMetadata): GCVersion {
|
|
32
36
|
if (!metadata) {
|
|
33
37
|
// Force to 0/disallowed in prior versions
|
|
@@ -63,6 +67,7 @@ export function getGCVersionInEffect(configProvider: IConfigProvider): number {
|
|
|
63
67
|
* @returns true if GC Sweep should be allowed for this document
|
|
64
68
|
*/
|
|
65
69
|
export function shouldAllowGcSweep(
|
|
70
|
+
// eslint-disable-next-line import/no-deprecated
|
|
66
71
|
featureMatrix: GCFeatureMatrix,
|
|
67
72
|
currentGeneration: number | undefined,
|
|
68
73
|
): boolean {
|
|
@@ -105,7 +110,7 @@ export function concatGarbageCollectionStates(
|
|
|
105
110
|
const combinedGCNodes: { [id: string]: IGarbageCollectionNodeData } = {};
|
|
106
111
|
for (const [nodeId, nodeData] of Object.entries(gcState1.gcNodes)) {
|
|
107
112
|
combinedGCNodes[nodeId] = {
|
|
108
|
-
outboundRoutes:
|
|
113
|
+
outboundRoutes: [...nodeData.outboundRoutes],
|
|
109
114
|
unreferencedTimestampMs: nodeData.unreferencedTimestampMs,
|
|
110
115
|
};
|
|
111
116
|
}
|
|
@@ -114,7 +119,7 @@ export function concatGarbageCollectionStates(
|
|
|
114
119
|
let combineNodeData = combinedGCNodes[nodeId];
|
|
115
120
|
if (combineNodeData === undefined) {
|
|
116
121
|
combineNodeData = {
|
|
117
|
-
outboundRoutes:
|
|
122
|
+
outboundRoutes: [...nodeData.outboundRoutes],
|
|
118
123
|
unreferencedTimestampMs: nodeData.unreferencedTimestampMs,
|
|
119
124
|
};
|
|
120
125
|
} else {
|
|
@@ -149,7 +154,7 @@ export function concatGarbageCollectionStates(
|
|
|
149
154
|
export function cloneGCData(gcData: IGarbageCollectionData): IGarbageCollectionData {
|
|
150
155
|
const clonedGCNodes: { [id: string]: string[] } = {};
|
|
151
156
|
for (const [id, outboundRoutes] of Object.entries(gcData.gcNodes)) {
|
|
152
|
-
clonedGCNodes[id] =
|
|
157
|
+
clonedGCNodes[id] = [...outboundRoutes];
|
|
153
158
|
}
|
|
154
159
|
return {
|
|
155
160
|
gcNodes: clonedGCNodes,
|
|
@@ -166,7 +171,7 @@ export function concatGarbageCollectionData(
|
|
|
166
171
|
const combinedGCData: IGarbageCollectionData = cloneGCData(gcData1);
|
|
167
172
|
for (const [id, routes] of Object.entries(gcData2.gcNodes)) {
|
|
168
173
|
if (combinedGCData.gcNodes[id] === undefined) {
|
|
169
|
-
combinedGCData.gcNodes[id] =
|
|
174
|
+
combinedGCData.gcNodes[id] = [...routes];
|
|
170
175
|
} else {
|
|
171
176
|
const combinedRoutes = [...routes, ...combinedGCData.gcNodes[id]];
|
|
172
177
|
combinedGCData.gcNodes[id] = [...new Set(combinedRoutes)];
|
|
@@ -16,6 +16,7 @@ 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
|
|
19
20
|
import { IGCStats, IGarbageCollectorConfigs } from "./gcDefinitions.js";
|
|
20
21
|
import { generateSortedGCState } from "./gcHelpers.js";
|
|
21
22
|
import {
|
|
@@ -98,7 +99,7 @@ export class GCSummaryStateTracker {
|
|
|
98
99
|
// Serialize and write deleted nodes, if any. This is done irrespective of whether sweep is enabled or not so
|
|
99
100
|
// to identify deleted nodes' usage.
|
|
100
101
|
const serializedDeletedNodes =
|
|
101
|
-
deletedNodes.size > 0 ? JSON.stringify(
|
|
102
|
+
deletedNodes.size > 0 ? JSON.stringify([...deletedNodes].sort()) : undefined;
|
|
102
103
|
// Serialize and write tombstones, if any.
|
|
103
104
|
const serializedTombstones =
|
|
104
105
|
tombstones.length > 0 ? JSON.stringify(tombstones.sort()) : undefined;
|
|
@@ -230,6 +231,7 @@ export class GCSummaryStateTracker {
|
|
|
230
231
|
/**
|
|
231
232
|
* Called to update the state from a GC run's stats. Used to update the count of data stores whose state updated.
|
|
232
233
|
*/
|
|
234
|
+
// eslint-disable-next-line import/no-deprecated
|
|
233
235
|
public updateStateFromGCRunStats(stats: IGCStats): void {
|
|
234
236
|
this.updatedDSCountSinceLastSummary += stats.updatedDataStoreCount;
|
|
235
237
|
}
|