@fluidframework/container-runtime 2.13.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 +71 -5
- package/CHANGELOG.md +84 -0
- package/api-report/container-runtime.legacy.alpha.api.md +38 -232
- 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 +5 -1
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +30 -13
- 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 +23 -12
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +85 -53
- 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 +10 -6
- 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 +87 -94
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +312 -226
- 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 +8 -4
- 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 +47 -29
- 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 +7 -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 +48 -19
- 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 +5 -2
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +218 -70
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +40 -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 +14 -7
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcReferenceGraphAlgorithm.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 +2 -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 +35 -17
- 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/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/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 +11 -5
- 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 +6 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +16 -8
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts +1 -2
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +9 -6
- 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 +16 -11
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +4 -4
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +17 -16
- 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 +3 -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 -11
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +24 -15
- 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 +8 -4
- 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 +94 -31
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +28 -16
- 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 +17 -6
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +48 -19
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +10 -5
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +26 -11
- 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.d.ts +6 -2
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summary/summarizerHeuristics.js +13 -5
- 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 +24 -8
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +45 -36
- 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 +13 -5
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +15 -7
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +253 -135
- 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 +10 -8
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +28 -9
- 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 +9 -3
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +22 -9
- 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 +20 -9
- 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 +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 +5 -1
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +30 -13
- 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 +23 -12
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +88 -54
- 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 +11 -7
- 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 +87 -94
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +319 -228
- 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 +8 -4
- 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 +47 -29
- 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 +7 -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 +96 -90
- 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 +51 -20
- 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 +4 -2
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +218 -70
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +40 -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 +14 -7
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcReferenceGraphAlgorithm.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 +2 -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 +38 -18
- 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/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/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 +11 -5
- 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 +14 -20
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts +6 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +17 -9
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts +1 -2
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +10 -7
- 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 +16 -11
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +4 -4
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +17 -16
- 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 +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 +22 -11
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +25 -16
- 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 +8 -4
- 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 +94 -31
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +28 -16
- 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 +17 -6
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +48 -19
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +10 -5
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +26 -11
- 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.d.ts +6 -2
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summary/summarizerHeuristics.js +13 -5
- 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 +24 -8
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +45 -36
- 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 +13 -5
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +15 -7
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +253 -135
- 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 +10 -8
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +28 -9
- 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 +9 -3
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +22 -9
- 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 +20 -9
- 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 +22 -31
- package/src/batchTracker.ts +34 -36
- package/src/blobManager/blobManager.ts +54 -33
- package/src/blobManager/blobManagerSnapSum.ts +10 -10
- package/src/channelCollection.ts +108 -82
- package/src/connectionTelemetry.ts +43 -19
- package/src/containerHandleContext.ts +2 -2
- package/src/containerRuntime.ts +492 -364
- package/src/dataStore.ts +17 -9
- package/src/dataStoreContext.ts +94 -73
- package/src/dataStoreContexts.ts +17 -12
- package/src/dataStoreRegistry.ts +1 -1
- package/src/deltaManagerProxies.ts +5 -5
- package/src/deltaScheduler.ts +24 -18
- package/src/gc/garbageCollection.ts +89 -40
- package/src/gc/gcConfigs.ts +13 -5
- package/src/gc/gcDefinitions.ts +224 -70
- package/src/gc/gcHelpers.ts +22 -11
- package/src/gc/gcReferenceGraphAlgorithm.ts +1 -1
- package/src/gc/gcSummaryDefinitions.ts +18 -6
- package/src/gc/gcSummaryStateTracker.ts +7 -3
- package/src/gc/gcTelemetry.ts +73 -30
- package/src/gc/gcUnreferencedStateTracker.ts +40 -16
- package/src/gc/index.ts +1 -0
- package/src/{scheduleManager.ts → inboundBatchAggregator.ts} +55 -122
- package/src/index.ts +0 -3
- package/src/layerCompatState.ts +75 -0
- package/src/messageTypes.ts +16 -5
- package/src/metadata.ts +12 -4
- package/src/opLifecycle/README.md +43 -34
- package/src/opLifecycle/batchManager.ts +12 -6
- package/src/opLifecycle/duplicateBatchDetector.ts +12 -6
- package/src/opLifecycle/opCompressor.ts +22 -25
- package/src/opLifecycle/opDecompressor.ts +23 -11
- package/src/opLifecycle/opGroupingManager.ts +16 -11
- package/src/opLifecycle/opSplitter.ts +24 -18
- package/src/opLifecycle/outbox.ts +35 -33
- package/src/opLifecycle/remoteMessageProcessor.ts +13 -5
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +49 -26
- package/src/summary/documentSchema.ts +41 -22
- package/src/summary/index.ts +0 -3
- package/src/summary/orderedClientElection.ts +114 -49
- package/src/summary/runWhileConnectedCoordinator.ts +12 -3
- package/src/summary/runningSummarizer.ts +79 -36
- package/src/summary/summarizer.ts +51 -25
- package/src/summary/summarizerClientElection.ts +4 -2
- package/src/summary/summarizerHeuristics.ts +23 -12
- package/src/summary/summarizerNode/index.ts +1 -0
- package/src/summary/summarizerNode/summarizerNode.ts +54 -43
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +48 -16
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +25 -15
- package/src/summary/summarizerTypes.ts +253 -139
- package/src/summary/summaryCollection.ts +41 -31
- package/src/summary/summaryFormat.ts +34 -13
- package/src/summary/summaryGenerator.ts +39 -18
- package/src/summary/summaryManager.ts +36 -24
- package/src/throttler.ts +23 -11
- package/container-runtime.test-files.tar +0 -0
- package/dist/scheduleManager.d.ts +0 -28
- package/dist/scheduleManager.d.ts.map +0 -1
- package/dist/scheduleManager.js +0 -233
- 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 -229
- package/lib/scheduleManager.js.map +0 -1
|
@@ -17,6 +17,7 @@ import type { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/intern
|
|
|
17
17
|
* Information from a snapshot needed to load BlobManager
|
|
18
18
|
* @legacy
|
|
19
19
|
* @alpha
|
|
20
|
+
* @deprecated This type will be moved to internal in 2.30. External usage is not necessary or supported.
|
|
20
21
|
*/
|
|
21
22
|
export interface IBlobManagerLoadInfo {
|
|
22
23
|
ids?: string[];
|
|
@@ -47,7 +48,7 @@ const loadV1 = async (
|
|
|
47
48
|
return {};
|
|
48
49
|
}
|
|
49
50
|
let redirectTableEntries: [string, string][] = [];
|
|
50
|
-
const tableId
|
|
51
|
+
const tableId = blobsTree.blobs[redirectTableBlobName];
|
|
51
52
|
if (tableId) {
|
|
52
53
|
redirectTableEntries = await readAndParse(context.storage, tableId);
|
|
53
54
|
}
|
|
@@ -73,7 +74,9 @@ export const toRedirectTable = (
|
|
|
73
74
|
if (snapshot.ids) {
|
|
74
75
|
// If we are detached, we don't have storage IDs yet, so set to undefined
|
|
75
76
|
// Otherwise, set identity (id -> id) entries.
|
|
76
|
-
|
|
77
|
+
for (const entry of snapshot.ids) {
|
|
78
|
+
redirectTable.set(entry, detached ? undefined : entry);
|
|
79
|
+
}
|
|
77
80
|
}
|
|
78
81
|
return redirectTable;
|
|
79
82
|
};
|
|
@@ -90,12 +93,11 @@ const summarizeV1 = (
|
|
|
90
93
|
const storageIds = getStorageIds(redirectTable, attachState);
|
|
91
94
|
|
|
92
95
|
// if storageIds is empty, it means we are detached and have only local IDs, or that there are no blobs attached
|
|
93
|
-
const blobIds =
|
|
94
|
-
storageIds.size > 0 ? Array.from(storageIds) : Array.from(redirectTable.keys());
|
|
96
|
+
const blobIds = storageIds.size > 0 ? [...storageIds] : [...redirectTable.keys()];
|
|
95
97
|
const builder = new SummaryTreeBuilder();
|
|
96
|
-
|
|
98
|
+
for (const blobId of blobIds) {
|
|
97
99
|
builder.addAttachment(blobId);
|
|
98
|
-
}
|
|
100
|
+
}
|
|
99
101
|
|
|
100
102
|
// Any non-identity entries in the table need to be saved in the summary
|
|
101
103
|
if (redirectTable.size > blobIds.length) {
|
|
@@ -103,9 +105,7 @@ const summarizeV1 = (
|
|
|
103
105
|
redirectTableBlobName,
|
|
104
106
|
// filter out identity entries
|
|
105
107
|
JSON.stringify(
|
|
106
|
-
|
|
107
|
-
([localId, storageId]) => localId !== storageId,
|
|
108
|
-
),
|
|
108
|
+
[...redirectTable.entries()].filter(([localId, storageId]) => localId !== storageId),
|
|
109
109
|
),
|
|
110
110
|
);
|
|
111
111
|
}
|
|
@@ -116,7 +116,7 @@ const summarizeV1 = (
|
|
|
116
116
|
export const getStorageIds = (
|
|
117
117
|
redirectTable: Map<string, string | undefined>,
|
|
118
118
|
attachState: AttachState,
|
|
119
|
-
) => {
|
|
119
|
+
): Set<string> => {
|
|
120
120
|
const ids = new Set<string | undefined>(redirectTable.values());
|
|
121
121
|
|
|
122
122
|
// If we are detached, we will not have storage IDs, only undefined
|
package/src/channelCollection.ts
CHANGED
|
@@ -76,6 +76,7 @@ import {
|
|
|
76
76
|
import { v4 as uuid } from "uuid";
|
|
77
77
|
|
|
78
78
|
import {
|
|
79
|
+
// eslint-disable-next-line import/no-deprecated
|
|
79
80
|
DeletedResponseHeaderKey,
|
|
80
81
|
RuntimeHeaderData,
|
|
81
82
|
defaultRuntimeHeaderData,
|
|
@@ -96,10 +97,12 @@ import {
|
|
|
96
97
|
} from "./dataStoreContext.js";
|
|
97
98
|
import { DataStoreContexts } from "./dataStoreContexts.js";
|
|
98
99
|
import { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
100
|
+
// eslint-disable-next-line import/no-deprecated
|
|
99
101
|
import { GCNodeType, IGCNodeUpdatedProps, urlToGCNodePath } from "./gc/index.js";
|
|
100
102
|
import { ContainerMessageType, LocalContainerRuntimeMessage } from "./messageTypes.js";
|
|
101
103
|
import { StorageServiceWithAttachBlobs } from "./storageServiceWithAttachBlobs.js";
|
|
102
104
|
import {
|
|
105
|
+
// eslint-disable-next-line import/no-deprecated
|
|
103
106
|
IContainerRuntimeMetadata,
|
|
104
107
|
nonDataStorePaths,
|
|
105
108
|
rootHasIsolatedChannels,
|
|
@@ -110,13 +113,18 @@ import {
|
|
|
110
113
|
* @internal
|
|
111
114
|
*/
|
|
112
115
|
export enum RuntimeHeaders {
|
|
113
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* True to wait for a data store to be created and loaded before returning it.
|
|
118
|
+
*/
|
|
114
119
|
wait = "wait",
|
|
115
|
-
/**
|
|
120
|
+
/**
|
|
121
|
+
* True if the request is coming from an IFluidHandle.
|
|
122
|
+
*/
|
|
116
123
|
viaHandle = "viaHandle",
|
|
117
124
|
}
|
|
118
125
|
|
|
119
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* True if a tombstoned object should be returned without erroring
|
|
120
128
|
* @legacy
|
|
121
129
|
* @alpha
|
|
122
130
|
*/
|
|
@@ -125,7 +133,7 @@ export const AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in th
|
|
|
125
133
|
type PendingAliasResolve = (success: boolean) => void;
|
|
126
134
|
|
|
127
135
|
interface FluidDataStoreMessage {
|
|
128
|
-
content:
|
|
136
|
+
content: unknown;
|
|
129
137
|
type: string;
|
|
130
138
|
}
|
|
131
139
|
|
|
@@ -212,7 +220,7 @@ function wrapContextForInnerChannel(
|
|
|
212
220
|
): IFluidParentContext {
|
|
213
221
|
const context = wrapContext(parentContext);
|
|
214
222
|
|
|
215
|
-
context.submitMessage = (type: string, content:
|
|
223
|
+
context.submitMessage = (type: string, content: unknown, localOpMetadata: unknown) => {
|
|
216
224
|
const fluidDataStoreContent: FluidDataStoreMessage = {
|
|
217
225
|
content,
|
|
218
226
|
type,
|
|
@@ -242,7 +250,7 @@ function wrapContextForInnerChannel(
|
|
|
242
250
|
/**
|
|
243
251
|
* Returns the type of the given local data store from its package path.
|
|
244
252
|
*/
|
|
245
|
-
export function getLocalDataStoreType(localDataStore: LocalFluidDataStoreContext) {
|
|
253
|
+
export function getLocalDataStoreType(localDataStore: LocalFluidDataStoreContext): string {
|
|
246
254
|
return localDataStore.packagePath[localDataStore.packagePath.length - 1];
|
|
247
255
|
}
|
|
248
256
|
|
|
@@ -259,6 +267,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
259
267
|
|
|
260
268
|
protected readonly mc: MonitoringContext;
|
|
261
269
|
|
|
270
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda
|
|
262
271
|
private readonly disposeOnce = new Lazy<void>(() => this.contexts.dispose());
|
|
263
272
|
|
|
264
273
|
public readonly entryPoint: IFluidHandleInternal<FluidObject>;
|
|
@@ -315,41 +324,41 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
315
324
|
unreferencedDataStoreCount++;
|
|
316
325
|
}
|
|
317
326
|
// If we have a detached container, then create local data store contexts.
|
|
318
|
-
if (this.parentContext.attachState
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
snapshotForRemoteFluidDatastoreContext = {
|
|
322
|
-
...baseSnapshot,
|
|
323
|
-
snapshotTree: value,
|
|
324
|
-
};
|
|
327
|
+
if (this.parentContext.attachState === AttachState.Detached) {
|
|
328
|
+
if (typeof value !== "object") {
|
|
329
|
+
throw new LoggingError("Snapshot should be there to load from!!");
|
|
325
330
|
}
|
|
326
|
-
|
|
331
|
+
const snapshotTree = value;
|
|
332
|
+
dataStoreContext = new LocalFluidDataStoreContext({
|
|
327
333
|
id: key,
|
|
328
|
-
|
|
334
|
+
pkg: undefined,
|
|
329
335
|
parentContext: this.wrapContextForInnerChannel(key),
|
|
330
336
|
storage: this.parentContext.storage,
|
|
331
337
|
scope: this.parentContext.scope,
|
|
332
338
|
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {
|
|
333
339
|
type: CreateSummarizerNodeSource.FromSummary,
|
|
334
340
|
}),
|
|
335
|
-
|
|
341
|
+
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(key),
|
|
342
|
+
snapshotTree,
|
|
336
343
|
});
|
|
337
344
|
} else {
|
|
338
|
-
|
|
339
|
-
|
|
345
|
+
let snapshotForRemoteFluidDatastoreContext: ISnapshot | ISnapshotTree = value;
|
|
346
|
+
if (isInstanceOfISnapshot(baseSnapshot)) {
|
|
347
|
+
snapshotForRemoteFluidDatastoreContext = {
|
|
348
|
+
...baseSnapshot,
|
|
349
|
+
snapshotTree: value,
|
|
350
|
+
};
|
|
340
351
|
}
|
|
341
|
-
|
|
342
|
-
dataStoreContext = new LocalFluidDataStoreContext({
|
|
352
|
+
dataStoreContext = new RemoteFluidDataStoreContext({
|
|
343
353
|
id: key,
|
|
344
|
-
|
|
354
|
+
snapshot: snapshotForRemoteFluidDatastoreContext,
|
|
345
355
|
parentContext: this.wrapContextForInnerChannel(key),
|
|
346
356
|
storage: this.parentContext.storage,
|
|
347
357
|
scope: this.parentContext.scope,
|
|
348
358
|
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {
|
|
349
359
|
type: CreateSummarizerNodeSource.FromSummary,
|
|
350
360
|
}),
|
|
351
|
-
|
|
352
|
-
snapshotTree,
|
|
361
|
+
loadingGroupId: value.groupId,
|
|
353
362
|
});
|
|
354
363
|
}
|
|
355
364
|
this.contexts.addBoundOrRemoted(dataStoreContext);
|
|
@@ -373,7 +382,9 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
373
382
|
return pendingAliasPromise ?? "Success";
|
|
374
383
|
}
|
|
375
384
|
|
|
376
|
-
/**
|
|
385
|
+
/**
|
|
386
|
+
* For sampling. Only log once per container
|
|
387
|
+
*/
|
|
377
388
|
private shouldSendAttachLog = true;
|
|
378
389
|
|
|
379
390
|
protected wrapContextForInnerChannel(id: string): IFluidParentContext {
|
|
@@ -385,11 +396,11 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
385
396
|
* Not clear when it would be called and what it should do.
|
|
386
397
|
* Currently this API is called by context only for root data stores.
|
|
387
398
|
*/
|
|
388
|
-
public makeVisibleAndAttachGraph() {
|
|
399
|
+
public makeVisibleAndAttachGraph(): void {
|
|
389
400
|
this.parentContext.makeLocallyVisible();
|
|
390
401
|
}
|
|
391
402
|
|
|
392
|
-
private processAttachMessages(messageCollection: IRuntimeMessageCollection) {
|
|
403
|
+
private processAttachMessages(messageCollection: IRuntimeMessageCollection): void {
|
|
393
404
|
const { envelope, messagesContent, local } = messageCollection;
|
|
394
405
|
for (const { contents } of messagesContent) {
|
|
395
406
|
const attachMessage = contents as InboundAttachMessage;
|
|
@@ -545,7 +556,9 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
545
556
|
return this.aliasMap.get(id) !== undefined || this.contexts.get(id) !== undefined;
|
|
546
557
|
}
|
|
547
558
|
|
|
548
|
-
/**
|
|
559
|
+
/**
|
|
560
|
+
* Package up the context's attach summary etc into an IAttachMessage
|
|
561
|
+
*/
|
|
549
562
|
private generateAttachMessage(localContext: LocalFluidDataStoreContext): IAttachMessage {
|
|
550
563
|
// Get the attach summary.
|
|
551
564
|
const attachSummary = localContext.getAttachSummary();
|
|
@@ -586,7 +599,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
586
599
|
this.contexts.bind(id);
|
|
587
600
|
}
|
|
588
601
|
|
|
589
|
-
protected submitAttachChannelOp(localContext: LocalFluidDataStoreContext) {
|
|
602
|
+
protected submitAttachChannelOp(localContext: LocalFluidDataStoreContext): void {
|
|
590
603
|
const message = this.generateAttachMessage(localContext);
|
|
591
604
|
this.pendingAttach.set(localContext.id, message);
|
|
592
605
|
this.parentContext.submitMessage(ContainerMessageType.Attach, message, undefined);
|
|
@@ -642,21 +655,18 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
642
655
|
this.createDataStoreId(),
|
|
643
656
|
pkg,
|
|
644
657
|
LocalDetachedFluidDataStoreContext,
|
|
645
|
-
undefined, // props
|
|
646
658
|
loadingGroupId,
|
|
647
659
|
);
|
|
648
660
|
}
|
|
649
661
|
|
|
650
662
|
public createDataStoreContext(
|
|
651
663
|
pkg: Readonly<string[]>,
|
|
652
|
-
props?: any,
|
|
653
664
|
loadingGroupId?: string,
|
|
654
665
|
): IFluidDataStoreContextInternal {
|
|
655
666
|
return this.createContext(
|
|
656
667
|
this.createDataStoreId(),
|
|
657
668
|
pkg,
|
|
658
669
|
LocalFluidDataStoreContext,
|
|
659
|
-
props,
|
|
660
670
|
loadingGroupId,
|
|
661
671
|
);
|
|
662
672
|
}
|
|
@@ -665,9 +675,8 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
665
675
|
id: string,
|
|
666
676
|
pkg: Readonly<string[]>,
|
|
667
677
|
contextCtor: new (props: ILocalDetachedFluidDataStoreContextProps) => T,
|
|
668
|
-
createProps?: any,
|
|
669
678
|
loadingGroupId?: string,
|
|
670
|
-
) {
|
|
679
|
+
): T {
|
|
671
680
|
assert(loadingGroupId !== "", 0x974 /* loadingGroupId should not be the empty string */);
|
|
672
681
|
const context = new contextCtor({
|
|
673
682
|
id,
|
|
@@ -680,7 +689,6 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
680
689
|
}),
|
|
681
690
|
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),
|
|
682
691
|
snapshotTree: undefined,
|
|
683
|
-
createProps,
|
|
684
692
|
loadingGroupId,
|
|
685
693
|
channelToDataStoreFn: (channel: IFluidDataStoreChannel) =>
|
|
686
694
|
channelToDataStore(
|
|
@@ -695,25 +703,28 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
695
703
|
return context;
|
|
696
704
|
}
|
|
697
705
|
|
|
698
|
-
public get disposed() {
|
|
706
|
+
public get disposed(): boolean {
|
|
699
707
|
return this.disposeOnce.evaluated;
|
|
700
708
|
}
|
|
701
|
-
public readonly dispose = () => this.disposeOnce.value;
|
|
709
|
+
public readonly dispose = (): void => this.disposeOnce.value;
|
|
702
710
|
|
|
703
|
-
public reSubmit(type: string, content:
|
|
711
|
+
public reSubmit(type: string, content: unknown, localOpMetadata: unknown): void {
|
|
704
712
|
switch (type) {
|
|
705
713
|
case ContainerMessageType.Attach:
|
|
706
|
-
case ContainerMessageType.Alias:
|
|
714
|
+
case ContainerMessageType.Alias: {
|
|
707
715
|
this.parentContext.submitMessage(type, content, localOpMetadata);
|
|
708
716
|
return;
|
|
709
|
-
|
|
717
|
+
}
|
|
718
|
+
case ContainerMessageType.FluidDataStoreOp: {
|
|
710
719
|
return this.reSubmitChannelOp(type, content, localOpMetadata);
|
|
711
|
-
|
|
720
|
+
}
|
|
721
|
+
default: {
|
|
712
722
|
assert(false, 0x907 /* unknown op type */);
|
|
723
|
+
}
|
|
713
724
|
}
|
|
714
725
|
}
|
|
715
726
|
|
|
716
|
-
protected reSubmitChannelOp(type: string, content:
|
|
727
|
+
protected reSubmitChannelOp(type: string, content: unknown, localOpMetadata: unknown): void {
|
|
717
728
|
const envelope = content as IEnvelope;
|
|
718
729
|
const context = this.contexts.get(envelope.address);
|
|
719
730
|
// If the data store has been deleted, log an error and throw an error. If there are local changes for a
|
|
@@ -731,7 +742,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
731
742
|
context.reSubmit(innerContents.type, innerContents.content, localOpMetadata);
|
|
732
743
|
}
|
|
733
744
|
|
|
734
|
-
public rollback(type: string, content:
|
|
745
|
+
public rollback(type: string, content: unknown, localOpMetadata: unknown): void {
|
|
735
746
|
assert(type === ContainerMessageType.FluidDataStoreOp, 0x8e8 /* type */);
|
|
736
747
|
const envelope = content as IEnvelope;
|
|
737
748
|
const context = this.contexts.get(envelope.address);
|
|
@@ -753,18 +764,22 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
753
764
|
public async applyStashedOp(content: unknown): Promise<unknown> {
|
|
754
765
|
const opContents = content as LocalContainerRuntimeMessage;
|
|
755
766
|
switch (opContents.type) {
|
|
756
|
-
case ContainerMessageType.Attach:
|
|
767
|
+
case ContainerMessageType.Attach: {
|
|
757
768
|
return this.applyStashedAttachOp(opContents.contents);
|
|
758
|
-
|
|
769
|
+
}
|
|
770
|
+
case ContainerMessageType.Alias: {
|
|
759
771
|
return;
|
|
760
|
-
|
|
772
|
+
}
|
|
773
|
+
case ContainerMessageType.FluidDataStoreOp: {
|
|
761
774
|
return this.applyStashedChannelChannelOp(opContents.contents);
|
|
762
|
-
|
|
775
|
+
}
|
|
776
|
+
default: {
|
|
763
777
|
assert(false, 0x908 /* unknon type of op */);
|
|
778
|
+
}
|
|
764
779
|
}
|
|
765
780
|
}
|
|
766
781
|
|
|
767
|
-
protected async applyStashedChannelChannelOp(envelope: IEnvelope) {
|
|
782
|
+
protected async applyStashedChannelChannelOp(envelope: IEnvelope): Promise<unknown> {
|
|
768
783
|
const context = this.contexts.get(envelope.address);
|
|
769
784
|
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
770
785
|
// corruption in case the data store that stashed the op is deleted.
|
|
@@ -775,7 +790,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
775
790
|
return context.applyStashedOp(envelope.contents);
|
|
776
791
|
}
|
|
777
792
|
|
|
778
|
-
private async applyStashedAttachOp(message: IAttachMessage) {
|
|
793
|
+
private async applyStashedAttachOp(message: IAttachMessage): Promise<void> {
|
|
779
794
|
const { id, snapshot } = message;
|
|
780
795
|
|
|
781
796
|
// build the snapshot from the summary in the attach message
|
|
@@ -817,7 +832,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
817
832
|
// if the client is not detached put in the pending attach list
|
|
818
833
|
// so that on ack of the stashed op, the context is found.
|
|
819
834
|
// detached client don't send ops, so should not expect and ack.
|
|
820
|
-
this.pendingAttach.set(
|
|
835
|
+
this.pendingAttach.set(id, message);
|
|
821
836
|
}
|
|
822
837
|
}
|
|
823
838
|
|
|
@@ -827,17 +842,21 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
827
842
|
*/
|
|
828
843
|
public processMessages(messageCollection: IRuntimeMessageCollection): void {
|
|
829
844
|
switch (messageCollection.envelope.type) {
|
|
830
|
-
case ContainerMessageType.FluidDataStoreOp:
|
|
845
|
+
case ContainerMessageType.FluidDataStoreOp: {
|
|
831
846
|
this.processChannelMessages(messageCollection);
|
|
832
847
|
break;
|
|
833
|
-
|
|
848
|
+
}
|
|
849
|
+
case ContainerMessageType.Attach: {
|
|
834
850
|
this.processAttachMessages(messageCollection);
|
|
835
851
|
break;
|
|
836
|
-
|
|
852
|
+
}
|
|
853
|
+
case ContainerMessageType.Alias: {
|
|
837
854
|
this.processAliasMessages(messageCollection);
|
|
838
855
|
break;
|
|
839
|
-
|
|
856
|
+
}
|
|
857
|
+
default: {
|
|
840
858
|
assert(false, 0x8e9 /* unreached */);
|
|
859
|
+
}
|
|
841
860
|
}
|
|
842
861
|
}
|
|
843
862
|
|
|
@@ -850,7 +869,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
850
869
|
message: ISequencedDocumentMessage,
|
|
851
870
|
local: boolean,
|
|
852
871
|
localOpMetadata: unknown,
|
|
853
|
-
) {
|
|
872
|
+
): void {
|
|
854
873
|
this.processMessages({
|
|
855
874
|
envelope: message,
|
|
856
875
|
messagesContent: [
|
|
@@ -870,12 +889,12 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
870
889
|
* @param messageCollection - The collection of messages to process.
|
|
871
890
|
*/
|
|
872
891
|
private processChannelMessages(messageCollection: IRuntimeMessageCollection): void {
|
|
873
|
-
const { messagesContent, local } = messageCollection;
|
|
892
|
+
const { envelope, messagesContent, local } = messageCollection;
|
|
874
893
|
let currentMessageState: { address: string; type: string } | undefined;
|
|
875
894
|
let currentMessagesContent: IRuntimeMessagesContent[] = [];
|
|
876
895
|
|
|
877
896
|
// Helper that sends the current bunch of messages to the data store. It validates that the data stores exists.
|
|
878
|
-
const sendBunchedMessages = () => {
|
|
897
|
+
const sendBunchedMessages = (): void => {
|
|
879
898
|
// Current message state will be undefined for the first message in the list.
|
|
880
899
|
if (currentMessageState === undefined) {
|
|
881
900
|
return;
|
|
@@ -884,7 +903,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
884
903
|
assert(!!currentContext, 0xa66 /* Context not found */);
|
|
885
904
|
|
|
886
905
|
currentContext.processMessages({
|
|
887
|
-
envelope: { ...
|
|
906
|
+
envelope: { ...envelope, type: currentMessageState.type },
|
|
888
907
|
messagesContent: currentMessagesContent,
|
|
889
908
|
local,
|
|
890
909
|
});
|
|
@@ -912,11 +931,11 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
912
931
|
throw DataProcessingError.create(
|
|
913
932
|
"No context for op",
|
|
914
933
|
"processFluidDataStoreOp",
|
|
915
|
-
|
|
934
|
+
envelope as ISequencedDocumentMessage,
|
|
916
935
|
{
|
|
917
936
|
local,
|
|
918
937
|
messageDetails: JSON.stringify({
|
|
919
|
-
type:
|
|
938
|
+
type: envelope.type,
|
|
920
939
|
contentType: typeof contents,
|
|
921
940
|
}),
|
|
922
941
|
...tagCodeArtifacts({ address }),
|
|
@@ -944,16 +963,12 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
944
963
|
this.gcNodeUpdated({
|
|
945
964
|
node: { type: "DataStore", path: `/${address}` },
|
|
946
965
|
reason: "Changed",
|
|
947
|
-
timestampMs:
|
|
966
|
+
timestampMs: envelope.timestamp,
|
|
948
967
|
packagePath: context.isLoaded ? context.packagePath : undefined,
|
|
949
968
|
});
|
|
950
969
|
|
|
951
970
|
detectOutboundReferences(address, contextContents, (fromPath: string, toPath: string) =>
|
|
952
|
-
this.parentContext.addedGCOutboundRoute(
|
|
953
|
-
fromPath,
|
|
954
|
-
toPath,
|
|
955
|
-
messageCollection.envelope.timestamp,
|
|
956
|
-
),
|
|
971
|
+
this.parentContext.addedGCOutboundRoute(fromPath, toPath, envelope.timestamp),
|
|
957
972
|
);
|
|
958
973
|
}
|
|
959
974
|
|
|
@@ -981,6 +996,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
981
996
|
// The requested data store has been deleted by gc. Create a 404 response exception.
|
|
982
997
|
throw responseToException(
|
|
983
998
|
createResponseError(404, "DataStore was deleted", originalRequest, {
|
|
999
|
+
// eslint-disable-next-line import/no-deprecated
|
|
984
1000
|
[DeletedResponseHeaderKey]: true,
|
|
985
1001
|
}),
|
|
986
1002
|
originalRequest,
|
|
@@ -1040,14 +1056,14 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1040
1056
|
callSite: string,
|
|
1041
1057
|
requestHeaderData?: RuntimeHeaderData,
|
|
1042
1058
|
originalRequest?: IRequest,
|
|
1043
|
-
) {
|
|
1059
|
+
): boolean {
|
|
1044
1060
|
const dataStoreNodePath = `/${id}`;
|
|
1045
1061
|
if (!this.isDataStoreDeleted(dataStoreNodePath)) {
|
|
1046
1062
|
return false;
|
|
1047
1063
|
}
|
|
1048
1064
|
|
|
1049
1065
|
const idToLog =
|
|
1050
|
-
originalRequest
|
|
1066
|
+
originalRequest === undefined ? dataStoreNodePath : urlToGCNodePath(originalRequest.url);
|
|
1051
1067
|
|
|
1052
1068
|
// Log the package details asynchronously since getInitialSnapshotDetails is async
|
|
1053
1069
|
const recentlyDeletedContext = this.contexts.getRecentlyDeletedContext(id);
|
|
@@ -1059,7 +1075,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1059
1075
|
})
|
|
1060
1076
|
.then(
|
|
1061
1077
|
(pkg) => ({ pkg, error: undefined }),
|
|
1062
|
-
(error) => ({ pkg: undefined, error }),
|
|
1078
|
+
(error: Error) => ({ pkg: undefined, error }),
|
|
1063
1079
|
)
|
|
1064
1080
|
.then(({ pkg, error }) => {
|
|
1065
1081
|
this.mc.logger.sendTelemetryEvent(
|
|
@@ -1092,9 +1108,10 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1092
1108
|
return true;
|
|
1093
1109
|
}
|
|
1094
1110
|
|
|
1095
|
-
public processSignal(messageArg: IInboundSignalMessage, local: boolean) {
|
|
1111
|
+
public processSignal(messageArg: IInboundSignalMessage, local: boolean): void {
|
|
1096
1112
|
const envelope = messageArg.content as IEnvelope;
|
|
1097
1113
|
const fluidDataStoreId = envelope.address;
|
|
1114
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1098
1115
|
const message = { ...messageArg, content: envelope.contents };
|
|
1099
1116
|
const context = this.contexts.get(fluidDataStoreId);
|
|
1100
1117
|
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
@@ -1118,7 +1135,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1118
1135
|
context.processSignal(message, local);
|
|
1119
1136
|
}
|
|
1120
1137
|
|
|
1121
|
-
public setConnectionState(connected: boolean, clientId?: string) {
|
|
1138
|
+
public setConnectionState(connected: boolean, clientId?: string): void {
|
|
1122
1139
|
for (const [fluidDataStoreId, context] of this.contexts) {
|
|
1123
1140
|
try {
|
|
1124
1141
|
context.setConnectionState(connected, clientId);
|
|
@@ -1195,7 +1212,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1195
1212
|
},
|
|
1196
1213
|
);
|
|
1197
1214
|
// Get the outbound routes (aliased data stores) and add a GC node for this channel.
|
|
1198
|
-
builder.addNode("/",
|
|
1215
|
+
builder.addNode("/", [...this.aliasedDataStores]);
|
|
1199
1216
|
return builder.getGCData();
|
|
1200
1217
|
}
|
|
1201
1218
|
|
|
@@ -1328,7 +1345,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1328
1345
|
* After GC has run, called to notify this Container's data stores of routes that are used in it.
|
|
1329
1346
|
* @param usedRoutes - The routes that are used in all data stores in this Container.
|
|
1330
1347
|
*/
|
|
1331
|
-
public updateUsedRoutes(usedRoutes: readonly string[]) {
|
|
1348
|
+
public updateUsedRoutes(usedRoutes: readonly string[]): void {
|
|
1332
1349
|
// Get a map of data store ids to routes used in it.
|
|
1333
1350
|
const usedDataStoreRoutes = unpackChildNodesUsedRoutes(usedRoutes);
|
|
1334
1351
|
|
|
@@ -1346,7 +1363,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1346
1363
|
}
|
|
1347
1364
|
}
|
|
1348
1365
|
|
|
1349
|
-
public deleteChild(dataStoreId: string) {
|
|
1366
|
+
public deleteChild(dataStoreId: string): void {
|
|
1350
1367
|
const dataStoreContext = this.contexts.get(dataStoreId);
|
|
1351
1368
|
assert(dataStoreContext !== undefined, 0x2d7 /* No data store with specified id */);
|
|
1352
1369
|
|
|
@@ -1407,7 +1424,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1407
1424
|
|
|
1408
1425
|
this.deleteChild(dataStoreId);
|
|
1409
1426
|
}
|
|
1410
|
-
return
|
|
1427
|
+
return [...sweepReadyDataStoreRoutes];
|
|
1411
1428
|
}
|
|
1412
1429
|
|
|
1413
1430
|
/**
|
|
@@ -1418,7 +1435,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1418
1435
|
*
|
|
1419
1436
|
* @param tombstonedRoutes - The routes that are tombstones in all data stores in this Container.
|
|
1420
1437
|
*/
|
|
1421
|
-
public updateTombstonedRoutes(tombstonedRoutes: readonly string[]) {
|
|
1438
|
+
public updateTombstonedRoutes(tombstonedRoutes: readonly string[]): void {
|
|
1422
1439
|
const tombstonedDataStoresSet: Set<string> = new Set();
|
|
1423
1440
|
for (const route of tombstonedRoutes) {
|
|
1424
1441
|
const pathParts = route.split("/");
|
|
@@ -1462,13 +1479,15 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1462
1479
|
// If the node belongs to a data store, return its package path. For DDSes, we return the package path of the
|
|
1463
1480
|
// data store that contains it.
|
|
1464
1481
|
const context = this.contexts.get(nodePath.split("/")[1]);
|
|
1465
|
-
|
|
1482
|
+
const initialSnapshotDetails = await context?.getInitialSnapshotDetails();
|
|
1483
|
+
return initialSnapshotDetails?.pkg;
|
|
1466
1484
|
}
|
|
1467
1485
|
|
|
1468
1486
|
/**
|
|
1469
1487
|
* Called by GC to determine if a node is for a data store or for an object within a data store (for e.g. DDS).
|
|
1470
1488
|
* @returns the GC node type if the node belongs to a data store or object within data store, undefined otherwise.
|
|
1471
1489
|
*/
|
|
1490
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1472
1491
|
public getGCNodeType(nodePath: string): GCNodeType | undefined {
|
|
1473
1492
|
const pathParts = nodePath.split("/");
|
|
1474
1493
|
if (!this.contexts.has(pathParts[1])) {
|
|
@@ -1478,8 +1497,10 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1478
1497
|
// Data stores paths are of the format "/dataStoreId".
|
|
1479
1498
|
// Sub data store paths are of the format "/dataStoreId/subPath/...".
|
|
1480
1499
|
if (pathParts.length === 2) {
|
|
1500
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1481
1501
|
return GCNodeType.DataStore;
|
|
1482
1502
|
}
|
|
1503
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1483
1504
|
return GCNodeType.SubDataStore;
|
|
1484
1505
|
}
|
|
1485
1506
|
|
|
@@ -1544,6 +1565,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1544
1565
|
|
|
1545
1566
|
export function getSummaryForDatastores(
|
|
1546
1567
|
snapshot: ISnapshotTree | undefined,
|
|
1568
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1547
1569
|
metadata?: IContainerRuntimeMetadata,
|
|
1548
1570
|
): ISnapshotTree | undefined {
|
|
1549
1571
|
if (!snapshot) {
|
|
@@ -1551,7 +1573,7 @@ export function getSummaryForDatastores(
|
|
|
1551
1573
|
}
|
|
1552
1574
|
|
|
1553
1575
|
if (rootHasIsolatedChannels(metadata)) {
|
|
1554
|
-
const datastoresSnapshot
|
|
1576
|
+
const datastoresSnapshot = snapshot.trees[channelsTreeName];
|
|
1555
1577
|
assert(!!datastoresSnapshot, 0x168 /* Expected tree in snapshot not found */);
|
|
1556
1578
|
return datastoresSnapshot;
|
|
1557
1579
|
} else {
|
|
@@ -1583,7 +1605,7 @@ export function detectOutboundReferences(
|
|
|
1583
1605
|
const outboundPaths: string[] = [];
|
|
1584
1606
|
let ddsAddress: string | undefined;
|
|
1585
1607
|
|
|
1586
|
-
function recursivelyFindHandles(obj: unknown) {
|
|
1608
|
+
function recursivelyFindHandles(obj: unknown): void {
|
|
1587
1609
|
if (typeof obj === "object" && obj !== null) {
|
|
1588
1610
|
for (const [key, value] of Object.entries(obj)) {
|
|
1589
1611
|
// If 'value' is a serialized IFluidHandle, it represents a new outbound route.
|
|
@@ -1595,7 +1617,7 @@ export function detectOutboundReferences(
|
|
|
1595
1617
|
// the address of the DDS is stored in a property called "address". This is not ideal.
|
|
1596
1618
|
// An alternative would be for the op envelope to include the absolute path (built up as it is submitted)
|
|
1597
1619
|
if (key === "address" && ddsAddress === undefined) {
|
|
1598
|
-
ddsAddress = value;
|
|
1620
|
+
ddsAddress = value as string | undefined;
|
|
1599
1621
|
}
|
|
1600
1622
|
|
|
1601
1623
|
recursivelyFindHandles(value);
|
|
@@ -1608,10 +1630,14 @@ export function detectOutboundReferences(
|
|
|
1608
1630
|
// GC node paths are all absolute paths, hence the "" prefix.
|
|
1609
1631
|
// e.g. this will yield "/dataStoreId/ddsId"
|
|
1610
1632
|
const fromPath = ["", address, ddsAddress].join("/");
|
|
1611
|
-
|
|
1633
|
+
for (const toPath of outboundPaths) {
|
|
1634
|
+
addedOutboundReference(fromPath, toPath);
|
|
1635
|
+
}
|
|
1612
1636
|
}
|
|
1613
1637
|
|
|
1614
|
-
/**
|
|
1638
|
+
/**
|
|
1639
|
+
* @internal
|
|
1640
|
+
*/
|
|
1615
1641
|
export class ChannelCollectionFactory<T extends ChannelCollection = ChannelCollection>
|
|
1616
1642
|
implements IFluidDataStoreFactory
|
|
1617
1643
|
{
|
|
@@ -1630,7 +1656,7 @@ export class ChannelCollectionFactory<T extends ChannelCollection = ChannelColle
|
|
|
1630
1656
|
this.IFluidDataStoreRegistry = new FluidDataStoreRegistry(registryEntries);
|
|
1631
1657
|
}
|
|
1632
1658
|
|
|
1633
|
-
public get IFluidDataStoreFactory() {
|
|
1659
|
+
public get IFluidDataStoreFactory(): ChannelCollectionFactory<T> {
|
|
1634
1660
|
return this;
|
|
1635
1661
|
}
|
|
1636
1662
|
|