@fluidframework/container-runtime 2.12.0 → 2.20.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 -0
- package/CHANGELOG.md +50 -0
- package/api-report/container-runtime.legacy.alpha.api.md +9 -203
- package/container-runtime.test-files.tar +0 -0
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager/blobManager.d.ts +5 -1
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +16 -2
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.js.map +1 -1
- package/dist/channelCollection.d.ts +23 -12
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +22 -12
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +6 -2
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerHandleContext.d.ts +1 -1
- package/dist/containerHandleContext.d.ts.map +1 -1
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +74 -65
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +53 -37
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts +7 -3
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +2 -1
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +41 -25
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +31 -18
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +6 -2
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +6 -2
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +1 -1
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/deltaManagerProxies.d.ts +1 -17
- package/dist/deltaManagerProxies.d.ts.map +1 -1
- package/dist/deltaManagerProxies.js.map +1 -1
- package/dist/deltaScheduler.d.ts +9 -6
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +95 -89
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +21 -7
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +12 -5
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts +11 -0
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +2 -1
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +210 -70
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +39 -13
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +6 -2
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +6 -2
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcSummaryDefinitions.d.ts +18 -6
- package/dist/gc/gcSummaryDefinitions.d.ts.map +1 -1
- package/dist/gc/gcSummaryDefinitions.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +33 -11
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +6 -2
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.d.ts +42 -13
- package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +27 -9
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/gc/index.d.ts +1 -0
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +3 -1
- package/dist/gc/index.js.map +1 -1
- package/dist/inboundBatchAggregator.d.ts +34 -0
- package/dist/inboundBatchAggregator.d.ts.map +1 -0
- package/dist/inboundBatchAggregator.js +185 -0
- package/dist/inboundBatchAggregator.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +0 -4
- package/dist/messageTypes.d.ts +14 -5
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/metadata.d.ts +12 -4
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +6 -2
- package/dist/metadata.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +9 -3
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +3 -1
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/duplicateBatchDetector.d.ts +9 -3
- package/dist/opLifecycle/duplicateBatchDetector.d.ts.map +1 -1
- package/dist/opLifecycle/duplicateBatchDetector.js +9 -3
- package/dist/opLifecycle/duplicateBatchDetector.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +3 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +12 -8
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts +0 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +5 -4
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +2 -1
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +1 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +6 -1
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +9 -3
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/package.json +2 -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 +22 -6
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +43 -5
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/summary/documentSchema.d.ts.map +1 -1
- package/dist/summary/documentSchema.js +2 -0
- package/dist/summary/documentSchema.js.map +1 -1
- package/dist/summary/index.d.ts +1 -1
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +93 -31
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +15 -5
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +17 -6
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +12 -4
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +9 -5
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +9 -3
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.d.ts +6 -2
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summary/summarizerHeuristics.js +12 -4
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +24 -8
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +15 -5
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +48 -16
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +3 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +12 -4
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +12 -4
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +246 -135
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +1 -4
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +24 -8
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +9 -3
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +3 -1
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +8 -4
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +12 -4
- package/dist/summary/summaryManager.js.map +1 -1
- package/dist/throttler.d.ts +26 -10
- package/dist/throttler.d.ts.map +1 -1
- package/dist/throttler.js +12 -4
- package/dist/throttler.js.map +1 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager/blobManager.d.ts +5 -1
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +16 -2
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.js.map +1 -1
- package/lib/channelCollection.d.ts +23 -12
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +22 -12
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +6 -2
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerHandleContext.d.ts +1 -1
- package/lib/containerHandleContext.d.ts.map +1 -1
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +74 -65
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +53 -37
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts +7 -3
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +2 -1
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +41 -25
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +31 -18
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts +6 -2
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +6 -2
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts +1 -1
- package/lib/dataStoreRegistry.d.ts.map +1 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/deltaManagerProxies.d.ts +1 -17
- package/lib/deltaManagerProxies.d.ts.map +1 -1
- package/lib/deltaManagerProxies.js.map +1 -1
- package/lib/deltaScheduler.d.ts +9 -6
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +95 -89
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +21 -7
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +12 -5
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts +11 -0
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +1 -1
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +210 -70
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +39 -13
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts +6 -2
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +6 -2
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcSummaryDefinitions.d.ts +18 -6
- package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -1
- package/lib/gc/gcSummaryDefinitions.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +33 -11
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +6 -2
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.d.ts +42 -13
- package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +27 -9
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/lib/gc/index.d.ts +1 -0
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +1 -0
- package/lib/gc/index.js.map +1 -1
- package/lib/inboundBatchAggregator.d.ts +34 -0
- package/lib/inboundBatchAggregator.d.ts.map +1 -0
- package/lib/inboundBatchAggregator.js +181 -0
- package/lib/inboundBatchAggregator.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +0 -4
- package/lib/messageTypes.d.ts +14 -5
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js.map +1 -1
- package/lib/metadata.d.ts +12 -4
- package/lib/metadata.d.ts.map +1 -1
- package/lib/metadata.js +6 -2
- package/lib/metadata.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +9 -3
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +3 -1
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/duplicateBatchDetector.d.ts +9 -3
- package/lib/opLifecycle/duplicateBatchDetector.d.ts.map +1 -1
- package/lib/opLifecycle/duplicateBatchDetector.js +9 -3
- package/lib/opLifecycle/duplicateBatchDetector.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +1 -1
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts +3 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +13 -9
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts +0 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +6 -5
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +2 -1
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +1 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +6 -1
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +9 -3
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -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 +22 -6
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +41 -4
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/summary/documentSchema.d.ts.map +1 -1
- package/lib/summary/documentSchema.js +2 -0
- package/lib/summary/documentSchema.js.map +1 -1
- package/lib/summary/index.d.ts +1 -1
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +93 -31
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +15 -5
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +17 -6
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +12 -4
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +9 -5
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +9 -3
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.d.ts +6 -2
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summary/summarizerHeuristics.js +12 -4
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +24 -8
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +15 -5
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +48 -16
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +3 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +12 -4
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +12 -4
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +246 -135
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +1 -4
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +24 -8
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +9 -3
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +3 -1
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +8 -4
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +12 -4
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/throttler.d.ts +26 -10
- package/lib/throttler.d.ts.map +1 -1
- package/lib/throttler.js +12 -4
- package/lib/throttler.js.map +1 -1
- package/package.json +44 -31
- package/src/batchTracker.ts +31 -33
- package/src/blobManager/blobManager.ts +38 -19
- package/src/blobManager/blobManagerSnapSum.ts +1 -1
- package/src/channelCollection.ts +44 -37
- package/src/connectionTelemetry.ts +31 -13
- package/src/containerHandleContext.ts +2 -2
- package/src/containerRuntime.ts +198 -140
- package/src/dataStore.ts +11 -6
- package/src/dataStoreContext.ts +80 -59
- package/src/dataStoreContexts.ts +16 -12
- package/src/dataStoreRegistry.ts +1 -1
- package/src/deltaManagerProxies.ts +5 -5
- package/src/deltaScheduler.ts +19 -13
- package/src/gc/garbageCollection.ts +41 -18
- package/src/gc/gcConfigs.ts +4 -4
- package/src/gc/gcDefinitions.ts +212 -70
- package/src/gc/gcHelpers.ts +11 -5
- package/src/gc/gcSummaryDefinitions.ts +18 -6
- package/src/gc/gcSummaryStateTracker.ts +4 -2
- package/src/gc/gcTelemetry.ts +47 -19
- package/src/gc/gcUnreferencedStateTracker.ts +40 -16
- package/src/gc/index.ts +1 -0
- package/src/{scheduleManager.ts → inboundBatchAggregator.ts} +54 -121
- package/src/index.ts +0 -3
- package/src/messageTypes.ts +14 -5
- package/src/metadata.ts +12 -4
- package/src/opLifecycle/batchManager.ts +12 -6
- package/src/opLifecycle/duplicateBatchDetector.ts +10 -4
- package/src/opLifecycle/opCompressor.ts +8 -4
- package/src/opLifecycle/opDecompressor.ts +20 -11
- package/src/opLifecycle/opGroupingManager.ts +12 -8
- package/src/opLifecycle/opSplitter.ts +11 -8
- package/src/opLifecycle/outbox.ts +22 -13
- package/src/opLifecycle/remoteMessageProcessor.ts +10 -4
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +71 -15
- package/src/summary/documentSchema.ts +30 -18
- package/src/summary/index.ts +0 -3
- package/src/summary/orderedClientElection.ts +100 -38
- package/src/summary/runWhileConnectedCoordinator.ts +6 -3
- package/src/summary/runningSummarizer.ts +38 -19
- package/src/summary/summarizer.ts +29 -16
- package/src/summary/summarizerClientElection.ts +2 -2
- package/src/summary/summarizerHeuristics.ts +22 -11
- package/src/summary/summarizerNode/summarizerNode.ts +22 -12
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +48 -16
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +21 -11
- package/src/summary/summarizerTypes.ts +246 -139
- package/src/summary/summaryCollection.ts +24 -25
- package/src/summary/summaryFormat.ts +24 -8
- package/src/summary/summaryGenerator.ts +14 -8
- package/src/summary/summaryManager.ts +28 -18
- package/src/throttler.ts +23 -11
- package/dist/scheduleManager.d.ts +0 -28
- package/dist/scheduleManager.d.ts.map +0 -1
- package/dist/scheduleManager.js +0 -235
- package/dist/scheduleManager.js.map +0 -1
- package/lib/scheduleManager.d.ts +0 -28
- package/lib/scheduleManager.d.ts.map +0 -1
- package/lib/scheduleManager.js +0 -231
- package/lib/scheduleManager.js.map +0 -1
package/src/gc/gcDefinitions.ts
CHANGED
|
@@ -32,9 +32,13 @@ import {
|
|
|
32
32
|
*/
|
|
33
33
|
export type GCVersion = number;
|
|
34
34
|
|
|
35
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* The stable/default version of GC Data
|
|
37
|
+
*/
|
|
36
38
|
export const stableGCVersion: GCVersion = 3;
|
|
37
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* The next version of GC Data, to bump to in case we need to regenerate all GC Data across all files.
|
|
41
|
+
*/
|
|
38
42
|
export const nextGCVersion: GCVersion = 4;
|
|
39
43
|
|
|
40
44
|
/**
|
|
@@ -50,14 +54,22 @@ export const nextGCVersion: GCVersion = 4;
|
|
|
50
54
|
*/
|
|
51
55
|
export const gcGenerationOptionName = "gcGeneration";
|
|
52
56
|
|
|
53
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Config key to turn GC test mode on / off.
|
|
59
|
+
*/
|
|
54
60
|
export const gcTestModeKey = "Fluid.GarbageCollection.GCTestMode";
|
|
55
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Config key to expire a session after a set period of time. Defaults to true.
|
|
63
|
+
*/
|
|
56
64
|
export const runSessionExpiryKey = "Fluid.GarbageCollection.RunSessionExpiry";
|
|
57
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Config key to disable throwing an error when tombstone object is loaded (requested).
|
|
67
|
+
*/
|
|
58
68
|
export const disableThrowOnTombstoneLoadKey =
|
|
59
69
|
"Fluid.GarbageCollection.DisableThrowOnTombstoneLoad";
|
|
60
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Config key to enable GC version upgrade.
|
|
72
|
+
*/
|
|
61
73
|
export const gcVersionUpgradeToV4Key = "Fluid.GarbageCollection.GCVersionUpgradeToV4";
|
|
62
74
|
|
|
63
75
|
// One day in milliseconds.
|
|
@@ -88,7 +100,9 @@ export type GCFeatureMatrix =
|
|
|
88
100
|
* Provided via Container Runtime Options.
|
|
89
101
|
*/
|
|
90
102
|
gcGeneration?: number;
|
|
91
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* Deprecated property from legacy type. Will not be set concurrently with gcGeneration
|
|
105
|
+
*/
|
|
92
106
|
tombstoneGeneration?: undefined;
|
|
93
107
|
}
|
|
94
108
|
| {
|
|
@@ -148,7 +162,9 @@ export interface IGCMetadata {
|
|
|
148
162
|
* @deprecated use GCFeatureMatrix.gcGeneration instead. @see GCFeatureMatrix.gcGeneration
|
|
149
163
|
*/
|
|
150
164
|
readonly sweepEnabled?: boolean;
|
|
151
|
-
/**
|
|
165
|
+
/**
|
|
166
|
+
* If this is present, the session for this container will expire after this time and the container will close
|
|
167
|
+
*/
|
|
152
168
|
readonly sessionExpiryTimeoutMs?: number;
|
|
153
169
|
/**
|
|
154
170
|
* How long to wait after an object is unreferenced before it becomes a Tombstone.
|
|
@@ -167,23 +183,41 @@ export interface IGCMetadata {
|
|
|
167
183
|
* @alpha
|
|
168
184
|
*/
|
|
169
185
|
export interface IMarkPhaseStats {
|
|
170
|
-
/**
|
|
186
|
+
/**
|
|
187
|
+
* The number of nodes in the container.
|
|
188
|
+
*/
|
|
171
189
|
nodeCount: number;
|
|
172
|
-
/**
|
|
190
|
+
/**
|
|
191
|
+
* The number of data stores in the container.
|
|
192
|
+
*/
|
|
173
193
|
dataStoreCount: number;
|
|
174
|
-
/**
|
|
194
|
+
/**
|
|
195
|
+
* The number of attachment blobs in the container.
|
|
196
|
+
*/
|
|
175
197
|
attachmentBlobCount: number;
|
|
176
|
-
/**
|
|
198
|
+
/**
|
|
199
|
+
* The number of unreferenced nodes in the container.
|
|
200
|
+
*/
|
|
177
201
|
unrefNodeCount: number;
|
|
178
|
-
/**
|
|
202
|
+
/**
|
|
203
|
+
* The number of unreferenced data stores in the container.
|
|
204
|
+
*/
|
|
179
205
|
unrefDataStoreCount: number;
|
|
180
|
-
/**
|
|
206
|
+
/**
|
|
207
|
+
* The number of unreferenced attachment blobs in the container.
|
|
208
|
+
*/
|
|
181
209
|
unrefAttachmentBlobCount: number;
|
|
182
|
-
/**
|
|
210
|
+
/**
|
|
211
|
+
* The number of nodes whose reference state updated since last GC run.
|
|
212
|
+
*/
|
|
183
213
|
updatedNodeCount: number;
|
|
184
|
-
/**
|
|
214
|
+
/**
|
|
215
|
+
* The number of data stores whose reference state updated since last GC run.
|
|
216
|
+
*/
|
|
185
217
|
updatedDataStoreCount: number;
|
|
186
|
-
/**
|
|
218
|
+
/**
|
|
219
|
+
* The number of attachment blobs whose reference state updated since last GC run.
|
|
220
|
+
*/
|
|
187
221
|
updatedAttachmentBlobCount: number;
|
|
188
222
|
}
|
|
189
223
|
|
|
@@ -193,17 +227,29 @@ export interface IMarkPhaseStats {
|
|
|
193
227
|
* @alpha
|
|
194
228
|
*/
|
|
195
229
|
export interface ISweepPhaseStats {
|
|
196
|
-
/**
|
|
230
|
+
/**
|
|
231
|
+
* The number of nodes in the lifetime of the container.
|
|
232
|
+
*/
|
|
197
233
|
lifetimeNodeCount: number;
|
|
198
|
-
/**
|
|
234
|
+
/**
|
|
235
|
+
* The number of data stores in the lifetime of the container.
|
|
236
|
+
*/
|
|
199
237
|
lifetimeDataStoreCount: number;
|
|
200
|
-
/**
|
|
238
|
+
/**
|
|
239
|
+
* The number of attachment blobs in the lifetime of the container.
|
|
240
|
+
*/
|
|
201
241
|
lifetimeAttachmentBlobCount: number;
|
|
202
|
-
/**
|
|
242
|
+
/**
|
|
243
|
+
* The number of deleted nodes in the container.
|
|
244
|
+
*/
|
|
203
245
|
deletedNodeCount: number;
|
|
204
|
-
/**
|
|
246
|
+
/**
|
|
247
|
+
* The number of deleted data stores in the container.
|
|
248
|
+
*/
|
|
205
249
|
deletedDataStoreCount: number;
|
|
206
|
-
/**
|
|
250
|
+
/**
|
|
251
|
+
* The number of deleted attachment blobs in the container.
|
|
252
|
+
*/
|
|
207
253
|
deletedAttachmentBlobCount: number;
|
|
208
254
|
}
|
|
209
255
|
|
|
@@ -241,9 +287,13 @@ export type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];
|
|
|
241
287
|
* @internal
|
|
242
288
|
*/
|
|
243
289
|
export const GarbageCollectionMessageType = {
|
|
244
|
-
/**
|
|
290
|
+
/**
|
|
291
|
+
* Message sent directing GC to delete the given nodes
|
|
292
|
+
*/
|
|
245
293
|
Sweep: "Sweep",
|
|
246
|
-
/**
|
|
294
|
+
/**
|
|
295
|
+
* Message sent notifying GC that a Tombstoned object was Loaded
|
|
296
|
+
*/
|
|
247
297
|
TombstoneLoaded: "TombstoneLoaded",
|
|
248
298
|
} as const;
|
|
249
299
|
|
|
@@ -258,9 +308,13 @@ export type GarbageCollectionMessageType =
|
|
|
258
308
|
* @internal
|
|
259
309
|
*/
|
|
260
310
|
export interface ISweepMessage {
|
|
261
|
-
/**
|
|
311
|
+
/**
|
|
312
|
+
* @see GarbageCollectionMessageType.Sweep
|
|
313
|
+
*/
|
|
262
314
|
type: typeof GarbageCollectionMessageType.Sweep;
|
|
263
|
-
/**
|
|
315
|
+
/**
|
|
316
|
+
* The ids of nodes that are deleted.
|
|
317
|
+
*/
|
|
264
318
|
deletedNodeIds: string[];
|
|
265
319
|
}
|
|
266
320
|
|
|
@@ -269,9 +323,13 @@ export interface ISweepMessage {
|
|
|
269
323
|
* @internal
|
|
270
324
|
*/
|
|
271
325
|
export interface ITombstoneLoadedMessage {
|
|
272
|
-
/**
|
|
326
|
+
/**
|
|
327
|
+
* @see GarbageCollectionMessageType.TombstoneLoaded
|
|
328
|
+
*/
|
|
273
329
|
type: typeof GarbageCollectionMessageType.TombstoneLoaded;
|
|
274
|
-
/**
|
|
330
|
+
/**
|
|
331
|
+
* The id of Tombstoned node that was loaded.
|
|
332
|
+
*/
|
|
275
333
|
nodePath: string;
|
|
276
334
|
}
|
|
277
335
|
|
|
@@ -285,9 +343,13 @@ export type GarbageCollectionMessage = ISweepMessage | ITombstoneLoadedMessage;
|
|
|
285
343
|
* Defines the APIs for the runtime object to be passed to the garbage collector.
|
|
286
344
|
*/
|
|
287
345
|
export interface IGarbageCollectionRuntime {
|
|
288
|
-
/**
|
|
346
|
+
/**
|
|
347
|
+
* Returns the garbage collection data of the runtime.
|
|
348
|
+
*/
|
|
289
349
|
getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
|
|
290
|
-
/**
|
|
350
|
+
/**
|
|
351
|
+
* After GC has run, called to notify the runtime of routes that are used in it.
|
|
352
|
+
*/
|
|
291
353
|
updateUsedRoutes(usedRoutes: readonly string[]): void;
|
|
292
354
|
/**
|
|
293
355
|
* After GC has run and identified nodes that are sweep ready, called to delete the sweep ready nodes. The runtime
|
|
@@ -295,17 +357,27 @@ export interface IGarbageCollectionRuntime {
|
|
|
295
357
|
* @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.
|
|
296
358
|
*/
|
|
297
359
|
deleteSweepReadyNodes(sweepReadyRoutes: readonly string[]): readonly string[];
|
|
298
|
-
/**
|
|
360
|
+
/**
|
|
361
|
+
* Called to notify the runtime of routes that are tombstones.
|
|
362
|
+
*/
|
|
299
363
|
updateTombstonedRoutes(tombstoneRoutes: readonly string[]): void;
|
|
300
|
-
/**
|
|
364
|
+
/**
|
|
365
|
+
* Returns a referenced timestamp to be used to track unreferenced nodes.
|
|
366
|
+
*/
|
|
301
367
|
getCurrentReferenceTimestampMs(): number | undefined;
|
|
302
|
-
/**
|
|
368
|
+
/**
|
|
369
|
+
* Returns the type of the GC node.
|
|
370
|
+
*/
|
|
303
371
|
getNodeType(nodePath: string): GCNodeType;
|
|
304
|
-
/**
|
|
372
|
+
/**
|
|
373
|
+
* Called when the runtime should close because of an error.
|
|
374
|
+
*/
|
|
305
375
|
closeFn: (error?: ICriticalContainerError) => void;
|
|
306
376
|
}
|
|
307
377
|
|
|
308
|
-
/**
|
|
378
|
+
/**
|
|
379
|
+
* Defines the contract for the garbage collector.
|
|
380
|
+
*/
|
|
309
381
|
export interface IGarbageCollector {
|
|
310
382
|
/**
|
|
311
383
|
* Tells the time at which session expiry timer started in a previous container.
|
|
@@ -313,13 +385,21 @@ export interface IGarbageCollector {
|
|
|
313
385
|
* original container's local client time when it was loaded (and started the session expiry timer).
|
|
314
386
|
*/
|
|
315
387
|
readonly sessionExpiryTimerStarted: number | undefined;
|
|
316
|
-
/**
|
|
388
|
+
/**
|
|
389
|
+
* Tells whether GC should run or not.
|
|
390
|
+
*/
|
|
317
391
|
readonly shouldRunGC: boolean;
|
|
318
|
-
/**
|
|
392
|
+
/**
|
|
393
|
+
* The count of data stores whose GC state updated since the last summary.
|
|
394
|
+
*/
|
|
319
395
|
readonly updatedDSCountSinceLastSummary: number;
|
|
320
|
-
/**
|
|
396
|
+
/**
|
|
397
|
+
* Initialize the state from the base snapshot after its creation.
|
|
398
|
+
*/
|
|
321
399
|
initializeBaseState(): Promise<void>;
|
|
322
|
-
/**
|
|
400
|
+
/**
|
|
401
|
+
* Run garbage collection and update the reference / used state of the system.
|
|
402
|
+
*/
|
|
323
403
|
collectGarbage(
|
|
324
404
|
options: {
|
|
325
405
|
logger?: ITelemetryLoggerExt;
|
|
@@ -328,37 +408,51 @@ export interface IGarbageCollector {
|
|
|
328
408
|
},
|
|
329
409
|
telemetryContext?: ITelemetryContext,
|
|
330
410
|
): Promise<IGCStats | undefined>;
|
|
331
|
-
/**
|
|
411
|
+
/**
|
|
412
|
+
* Summarizes the GC data and returns it as a summary tree.
|
|
413
|
+
*/
|
|
332
414
|
summarize(
|
|
333
415
|
fullTree: boolean,
|
|
334
416
|
trackState: boolean,
|
|
335
417
|
telemetryContext?: ITelemetryContext,
|
|
336
418
|
): ISummarizeResult | undefined;
|
|
337
|
-
/**
|
|
419
|
+
/**
|
|
420
|
+
* Returns the garbage collector specific metadata to be written into the summary.
|
|
421
|
+
*/
|
|
338
422
|
getMetadata(): IGCMetadata;
|
|
339
|
-
/**
|
|
423
|
+
/**
|
|
424
|
+
* Returns the GC details generated from the base snapshot.
|
|
425
|
+
*/
|
|
340
426
|
getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
|
|
341
|
-
/**
|
|
427
|
+
/**
|
|
428
|
+
* Called when the latest summary of the system has been refreshed.
|
|
429
|
+
*/
|
|
342
430
|
refreshLatestSummary(result: IRefreshSummaryResult): Promise<void>;
|
|
343
431
|
/**
|
|
344
432
|
* Called when a node with the given path is updated. If the node is inactive or tombstoned, this will log an error
|
|
345
433
|
* or throw an error if failing on incorrect usage is configured.
|
|
346
434
|
*/
|
|
347
435
|
nodeUpdated(props: IGCNodeUpdatedProps): void;
|
|
348
|
-
/**
|
|
436
|
+
/**
|
|
437
|
+
* Called when a reference is added to a node. Used to identify nodes that were referenced between summaries.
|
|
438
|
+
*/
|
|
349
439
|
addedOutboundReference(
|
|
350
440
|
fromNodePath: string,
|
|
351
441
|
toNodePath: string,
|
|
352
442
|
timestampMs: number,
|
|
353
443
|
autorecovery?: true,
|
|
354
444
|
): void;
|
|
355
|
-
/**
|
|
445
|
+
/**
|
|
446
|
+
* Called to process garbage collection messages
|
|
447
|
+
*/
|
|
356
448
|
processMessages(
|
|
357
449
|
messageContents: GarbageCollectionMessage[],
|
|
358
450
|
messageTimestampMs: number,
|
|
359
451
|
local: boolean,
|
|
360
452
|
): void;
|
|
361
|
-
/**
|
|
453
|
+
/**
|
|
454
|
+
* Returns true if this node has been deleted by GC during sweep phase.
|
|
455
|
+
*/
|
|
362
456
|
isNodeDeleted(nodePath: string): boolean;
|
|
363
457
|
setConnectionState(connected: boolean, clientId?: string): void;
|
|
364
458
|
dispose(): void;
|
|
@@ -369,26 +463,40 @@ export interface IGarbageCollector {
|
|
|
369
463
|
* @internal
|
|
370
464
|
*/
|
|
371
465
|
export interface IGCNodeUpdatedProps {
|
|
372
|
-
/**
|
|
466
|
+
/**
|
|
467
|
+
* Type and path of the updated node
|
|
468
|
+
*/
|
|
373
469
|
node: { type: (typeof GCNodeType)["DataStore" | "Blob"]; path: string };
|
|
374
|
-
/**
|
|
470
|
+
/**
|
|
471
|
+
* Whether the node (or a subpath) was loaded or changed.
|
|
472
|
+
*/
|
|
375
473
|
reason: "Loaded" | "Changed" | "Realized";
|
|
376
474
|
/**
|
|
377
475
|
* The op-based timestamp when the node changed. If the update is from receiving an op, this should
|
|
378
476
|
* be the timestamp of the op. If not, this should be the timestamp of the last op processed.
|
|
379
477
|
*/
|
|
380
478
|
timestampMs: number | undefined;
|
|
381
|
-
/**
|
|
479
|
+
/**
|
|
480
|
+
* The package path of the node. This may not be available if the node hasn't been loaded yet
|
|
481
|
+
*/
|
|
382
482
|
packagePath?: readonly string[];
|
|
383
|
-
/**
|
|
483
|
+
/**
|
|
484
|
+
* The original request for loads to preserve it in telemetry
|
|
485
|
+
*/
|
|
384
486
|
request?: IRequest;
|
|
385
|
-
/**
|
|
487
|
+
/**
|
|
488
|
+
* If the node was loaded via request path, the header data. May be modified from the original request
|
|
489
|
+
*/
|
|
386
490
|
headerData?: RuntimeHeaderData;
|
|
387
|
-
/**
|
|
491
|
+
/**
|
|
492
|
+
* Any other properties to be logged.
|
|
493
|
+
*/
|
|
388
494
|
additionalProps?: ITelemetryPropertiesExt;
|
|
389
495
|
}
|
|
390
496
|
|
|
391
|
-
/**
|
|
497
|
+
/**
|
|
498
|
+
* Parameters necessary for creating a GarbageCollector.
|
|
499
|
+
*/
|
|
392
500
|
export interface IGarbageCollectorCreateParams {
|
|
393
501
|
readonly runtime: IGarbageCollectionRuntime;
|
|
394
502
|
readonly gcOptions: IGCRuntimeOptions;
|
|
@@ -444,6 +552,8 @@ export interface IGCRuntimeOptions {
|
|
|
444
552
|
/**
|
|
445
553
|
* Allows additional GC options to be passed.
|
|
446
554
|
*/
|
|
555
|
+
// TODO: Use unknown (breaking change)
|
|
556
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
447
557
|
[key: string]: any;
|
|
448
558
|
}
|
|
449
559
|
|
|
@@ -461,44 +571,72 @@ export interface IGarbageCollectorConfigs {
|
|
|
461
571
|
* flag defined below.
|
|
462
572
|
*/
|
|
463
573
|
readonly sweepAllowed: boolean;
|
|
464
|
-
/**
|
|
574
|
+
/**
|
|
575
|
+
* Tracks if sweep phase is enabled to run in this session or not
|
|
576
|
+
*/
|
|
465
577
|
readonly sweepEnabled: boolean;
|
|
466
578
|
/**
|
|
467
579
|
* If true, bypass optimizations and generate GC data for all nodes irrespective of whether a node changed or not.
|
|
468
580
|
*/
|
|
469
581
|
readonly runFullGC: boolean | undefined;
|
|
470
|
-
/**
|
|
582
|
+
/**
|
|
583
|
+
* The time in ms to expire a session for a client for gc.
|
|
584
|
+
*/
|
|
471
585
|
readonly sessionExpiryTimeoutMs: number | undefined;
|
|
472
|
-
/**
|
|
586
|
+
/**
|
|
587
|
+
* The time after which an unreferenced node can be Tombstoned - i.e. GC knows it can't be referenced again (revived).
|
|
588
|
+
*/
|
|
473
589
|
readonly tombstoneTimeoutMs: number | undefined;
|
|
474
590
|
/**
|
|
475
591
|
* The delay between tombstone and sweep. Not persisted, so concurrent sessions may use different values.
|
|
476
592
|
* Sweep is implemented in an eventually-consistent way so this is acceptable.
|
|
477
593
|
*/
|
|
478
594
|
readonly sweepGracePeriodMs: number;
|
|
479
|
-
/**
|
|
595
|
+
/**
|
|
596
|
+
* The time after which an unreferenced node is inactive.
|
|
597
|
+
*/
|
|
480
598
|
readonly inactiveTimeoutMs: number;
|
|
481
|
-
/**
|
|
599
|
+
/**
|
|
600
|
+
* Tracks whether GC should run in test mode. In this mode, unreferenced objects are deleted immediately.
|
|
601
|
+
*/
|
|
482
602
|
readonly testMode: boolean;
|
|
483
|
-
/**
|
|
603
|
+
/**
|
|
604
|
+
* @see GCFeatureMatrix.
|
|
605
|
+
*/
|
|
484
606
|
readonly persistedGcFeatureMatrix: GCFeatureMatrix | undefined;
|
|
485
|
-
/**
|
|
607
|
+
/**
|
|
608
|
+
* The version of GC in the base snapshot.
|
|
609
|
+
*/
|
|
486
610
|
readonly gcVersionInBaseSnapshot: GCVersion | undefined;
|
|
487
|
-
/**
|
|
611
|
+
/**
|
|
612
|
+
* The current version of GC data in the running code
|
|
613
|
+
*/
|
|
488
614
|
readonly gcVersionInEffect: GCVersion;
|
|
489
|
-
/**
|
|
615
|
+
/**
|
|
616
|
+
* If true, throw an error when a tombstone data store is retrieved
|
|
617
|
+
*/
|
|
490
618
|
readonly throwOnTombstoneLoad: boolean;
|
|
491
619
|
}
|
|
492
620
|
|
|
493
|
-
/**
|
|
621
|
+
/**
|
|
622
|
+
* The state of node that is unreferenced.
|
|
623
|
+
*/
|
|
494
624
|
export const UnreferencedState = {
|
|
495
|
-
/**
|
|
625
|
+
/**
|
|
626
|
+
* The node is active, i.e., it can become referenced again.
|
|
627
|
+
*/
|
|
496
628
|
Active: "Active",
|
|
497
|
-
/**
|
|
629
|
+
/**
|
|
630
|
+
* The node is inactive, i.e., it should not become referenced.
|
|
631
|
+
*/
|
|
498
632
|
Inactive: "Inactive",
|
|
499
|
-
/**
|
|
633
|
+
/**
|
|
634
|
+
* The node is ready to be tombstoned
|
|
635
|
+
*/
|
|
500
636
|
TombstoneReady: "TombstoneReady",
|
|
501
|
-
/**
|
|
637
|
+
/**
|
|
638
|
+
* The node is ready to be deleted by the sweep phase.
|
|
639
|
+
*/
|
|
502
640
|
SweepReady: "SweepReady",
|
|
503
641
|
} as const;
|
|
504
642
|
export type UnreferencedState = (typeof UnreferencedState)[keyof typeof UnreferencedState];
|
|
@@ -507,8 +645,12 @@ export type UnreferencedState = (typeof UnreferencedState)[keyof typeof Unrefere
|
|
|
507
645
|
* Represents the result of a GC run.
|
|
508
646
|
*/
|
|
509
647
|
export interface IGCResult {
|
|
510
|
-
/**
|
|
648
|
+
/**
|
|
649
|
+
* The ids of nodes that are referenced in the referenced graph
|
|
650
|
+
*/
|
|
511
651
|
referencedNodeIds: string[];
|
|
512
|
-
/**
|
|
652
|
+
/**
|
|
653
|
+
* The ids of nodes that are not-referenced or deleted in the referenced graph
|
|
654
|
+
*/
|
|
513
655
|
deletedNodeIds: string[];
|
|
514
656
|
}
|
package/src/gc/gcHelpers.ts
CHANGED
|
@@ -36,7 +36,9 @@ export function getGCVersion(metadata?: IGCMetadata): GCVersion {
|
|
|
36
36
|
return metadata.gcFeature ?? 0;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Indicates what GC version is in effect for new GC data being written in this session
|
|
41
|
+
*/
|
|
40
42
|
export function getGCVersionInEffect(configProvider: IConfigProvider): number {
|
|
41
43
|
// If version upgrade is not enabled, fall back to the stable GC version.
|
|
42
44
|
return configProvider.getBoolean(gcVersionUpgradeToV4Key) === true
|
|
@@ -160,7 +162,7 @@ export function cloneGCData(gcData: IGarbageCollectionData): IGarbageCollectionD
|
|
|
160
162
|
export function concatGarbageCollectionData(
|
|
161
163
|
gcData1: IGarbageCollectionData,
|
|
162
164
|
gcData2: IGarbageCollectionData,
|
|
163
|
-
) {
|
|
165
|
+
): IGarbageCollectionData {
|
|
164
166
|
const combinedGCData: IGarbageCollectionData = cloneGCData(gcData1);
|
|
165
167
|
for (const [id, routes] of Object.entries(gcData2.gcNodes)) {
|
|
166
168
|
if (combinedGCData.gcNodes[id] === undefined) {
|
|
@@ -219,7 +221,9 @@ export async function getGCDataFromSnapshot(
|
|
|
219
221
|
* @param gcDetails - The GC details of a node.
|
|
220
222
|
* @returns A map of GC details of each children of the the given node.
|
|
221
223
|
*/
|
|
222
|
-
export function unpackChildNodesGCDetails(
|
|
224
|
+
export function unpackChildNodesGCDetails(
|
|
225
|
+
gcDetails: IGarbageCollectionDetailsBase,
|
|
226
|
+
): Map<string, IGarbageCollectionDetailsBase> {
|
|
223
227
|
const childGCDetailsMap: Map<string, IGarbageCollectionDetailsBase> = new Map();
|
|
224
228
|
|
|
225
229
|
// If GC data is not available, bail out.
|
|
@@ -290,11 +294,13 @@ export function unpackChildNodesGCDetails(gcDetails: IGarbageCollectionDetailsBa
|
|
|
290
294
|
* @param str - A string that may contain leading and / or trailing slashes.
|
|
291
295
|
* @returns A new string without leading and trailing slashes.
|
|
292
296
|
*/
|
|
293
|
-
function trimLeadingAndTrailingSlashes(str: string) {
|
|
297
|
+
function trimLeadingAndTrailingSlashes(str: string): string {
|
|
294
298
|
return str.replace(/^\/+|\/+$/g, "");
|
|
295
299
|
}
|
|
296
300
|
|
|
297
|
-
/**
|
|
301
|
+
/**
|
|
302
|
+
* Reformats a request URL to match expected format for a GC node path
|
|
303
|
+
*/
|
|
298
304
|
export function urlToGCNodePath(url: string): string {
|
|
299
305
|
return `/${trimLeadingAndTrailingSlashes(url.split("?")[0])}`;
|
|
300
306
|
}
|
|
@@ -32,11 +32,17 @@ export interface IGarbageCollectionState {
|
|
|
32
32
|
* The GC data that is read from a snapshot. It contains the Garbage CollectionState state and tombstone state.
|
|
33
33
|
*/
|
|
34
34
|
export interface IGarbageCollectionSnapshotData {
|
|
35
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* The garbage collection state. It is a list of nodes in the container and their GC data.
|
|
37
|
+
*/
|
|
36
38
|
gcState: IGarbageCollectionState | undefined;
|
|
37
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* A list of nodes that have been tombstoned by GC.
|
|
41
|
+
*/
|
|
38
42
|
tombstones: string[] | undefined;
|
|
39
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* A list of nodes that have been deleted by GC.
|
|
45
|
+
*/
|
|
40
46
|
deletedNodes: string[] | undefined;
|
|
41
47
|
}
|
|
42
48
|
|
|
@@ -45,10 +51,16 @@ export interface IGarbageCollectionSnapshotData {
|
|
|
45
51
|
* Legacy GC details from when the GC details were written at the data store's summary tree.
|
|
46
52
|
*/
|
|
47
53
|
export interface IGarbageCollectionSummaryDetailsLegacy {
|
|
48
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* A list of routes to Fluid objects that are used in this node.
|
|
56
|
+
*/
|
|
49
57
|
usedRoutes?: string[];
|
|
50
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* The GC data of this node.
|
|
60
|
+
*/
|
|
51
61
|
gcData?: IGarbageCollectionData;
|
|
52
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* If this node is unreferenced, the time when it was marked as such.
|
|
64
|
+
*/
|
|
53
65
|
unrefTimestamp?: number;
|
|
54
66
|
}
|
|
@@ -61,7 +61,9 @@ export class GCSummaryStateTracker {
|
|
|
61
61
|
/**
|
|
62
62
|
* Called during GC initialization. Initialize the latest summary data from the base snapshot data.
|
|
63
63
|
*/
|
|
64
|
-
public initializeBaseState(
|
|
64
|
+
public initializeBaseState(
|
|
65
|
+
baseSnapshotData: IGarbageCollectionSnapshotData | undefined,
|
|
66
|
+
): void {
|
|
65
67
|
if (baseSnapshotData === undefined) {
|
|
66
68
|
return;
|
|
67
69
|
}
|
|
@@ -228,7 +230,7 @@ export class GCSummaryStateTracker {
|
|
|
228
230
|
/**
|
|
229
231
|
* Called to update the state from a GC run's stats. Used to update the count of data stores whose state updated.
|
|
230
232
|
*/
|
|
231
|
-
public updateStateFromGCRunStats(stats: IGCStats) {
|
|
233
|
+
public updateStateFromGCRunStats(stats: IGCStats): void {
|
|
232
234
|
this.updatedDSCountSinceLastSummary += stats.updatedDataStoreCount;
|
|
233
235
|
}
|
|
234
236
|
}
|