@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
package/lib/throttler.d.ts
CHANGED
|
@@ -13,9 +13,13 @@ export interface IThrottler {
|
|
|
13
13
|
* the most recent delay computation.
|
|
14
14
|
*/
|
|
15
15
|
readonly numAttempts: number;
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Width of sliding delay window in milliseconds.
|
|
18
|
+
*/
|
|
17
19
|
readonly delayWindowMs: number;
|
|
18
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Maximum delay allowed in milliseconds.
|
|
22
|
+
*/
|
|
19
23
|
readonly maxDelayMs: number;
|
|
20
24
|
/**
|
|
21
25
|
* Delay function used to calculate what the delay should be.
|
|
@@ -29,9 +33,13 @@ export interface IThrottler {
|
|
|
29
33
|
* Delay is based on previous attempts within specified time window, subtracting delay time.
|
|
30
34
|
*/
|
|
31
35
|
export declare class Throttler implements IThrottler {
|
|
32
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Width of sliding delay window in milliseconds.
|
|
38
|
+
*/
|
|
33
39
|
readonly delayWindowMs: number;
|
|
34
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Maximum delay allowed in milliseconds.
|
|
42
|
+
*/
|
|
35
43
|
readonly maxDelayMs: number;
|
|
36
44
|
/**
|
|
37
45
|
* Delay function used to calculate what the delay should be.
|
|
@@ -52,9 +60,13 @@ export declare class Throttler implements IThrottler {
|
|
|
52
60
|
*/
|
|
53
61
|
get latestAttemptTime(): number | undefined;
|
|
54
62
|
constructor(
|
|
55
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Width of sliding delay window in milliseconds.
|
|
65
|
+
*/
|
|
56
66
|
delayWindowMs: number,
|
|
57
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Maximum delay allowed in milliseconds.
|
|
69
|
+
*/
|
|
58
70
|
maxDelayMs: number,
|
|
59
71
|
/**
|
|
60
72
|
* Delay function used to calculate what the delay should be.
|
|
@@ -81,13 +93,15 @@ export declare const formExponentialFn: ({ multiplier, coefficient, offset, init
|
|
|
81
93
|
offset?: number | undefined;
|
|
82
94
|
initialDelay?: number | undefined;
|
|
83
95
|
}) => IThrottler["delayFn"];
|
|
84
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* f(n) = C x (B^(n+A)) + F = (C x B^A) x B^n + F
|
|
98
|
+
*/
|
|
85
99
|
export declare const formExponentialFnWithAttemptOffset: (attemptOffset: number, { multiplier, coefficient, offset, initialDelay, }?: {
|
|
86
100
|
multiplier?: number | undefined;
|
|
87
101
|
coefficient?: number | undefined;
|
|
88
102
|
offset?: number | undefined;
|
|
89
103
|
initialDelay?: number | undefined;
|
|
90
|
-
}) =>
|
|
104
|
+
}) => IThrottler["delayFn"];
|
|
91
105
|
/**
|
|
92
106
|
* Helper function to generate simple linear throttle functions.
|
|
93
107
|
* f(n) = [coefficient] x n + [flatOffset]
|
|
@@ -99,9 +113,11 @@ export declare const formLinearFn: ({ coefficient, offset }?: {
|
|
|
99
113
|
coefficient?: number | undefined;
|
|
100
114
|
offset?: number | undefined;
|
|
101
115
|
}) => IThrottler["delayFn"];
|
|
102
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* f(n) = C x (n+A) + F = C x n + (C x A + F)
|
|
118
|
+
*/
|
|
103
119
|
export declare const formLinearFnWithAttemptOffset: (attemptOffset: number, { coefficient, offset }?: {
|
|
104
120
|
coefficient?: number | undefined;
|
|
105
121
|
offset?: number | undefined;
|
|
106
|
-
}) =>
|
|
122
|
+
}) => IThrottler["delayFn"];
|
|
107
123
|
//# sourceMappingURL=throttler.d.ts.map
|
package/lib/throttler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throttler.d.ts","sourceRoot":"","sources":["../src/throttler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,QAAQ,IAAI,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B
|
|
1
|
+
{"version":3,"file":"throttler.d.ts","sourceRoot":"","sources":["../src/throttler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,QAAQ,IAAI,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;CAClD;AAED;;;GAGG;AACH,qBAAa,SAAU,YAAW,UAAU;IA0B1C;;OAEG;aACa,aAAa,EAAE,MAAM;IACrC;;OAEG;aACa,UAAU,EAAE,MAAM;IAClC;;;;OAIG;aACa,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM;IAtCzD,OAAO,CAAC,UAAU,CAAgB;IAElC,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED;;;OAGG;IACI,WAAW,IAAI,SAAS,MAAM,EAAE;IAIvC;;;OAGG;IACH,IAAW,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAIjD;;IAGA;;OAEG;IACa,aAAa,EAAE,MAAM;IACrC;;OAEG;IACa,UAAU,EAAE,MAAM;IAClC;;;;OAIG;IACa,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM;IAGlD,QAAQ,IAAI,MAAM;CAiCzB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB;;;;;MAMpB,UAAU,CAAC,SAAS,CAO3B,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,kCAAkC,kBAC/B,MAAM;;;;;MAOnB,UAAU,CAAC,SAAS,CAMpB,CAAC;AAEJ;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;;MACgB,UAAU,CAAC,SAAS,CAEZ,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,6BAA6B,kBAC1B,MAAM;;;MAEnB,UAAU,CAAC,SAAS,CAIpB,CAAC"}
|
package/lib/throttler.js
CHANGED
|
@@ -27,9 +27,13 @@ export class Throttler {
|
|
|
27
27
|
: undefined;
|
|
28
28
|
}
|
|
29
29
|
constructor(
|
|
30
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Width of sliding delay window in milliseconds.
|
|
32
|
+
*/
|
|
31
33
|
delayWindowMs,
|
|
32
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Maximum delay allowed in milliseconds.
|
|
36
|
+
*/
|
|
33
37
|
maxDelayMs,
|
|
34
38
|
/**
|
|
35
39
|
* Delay function used to calculate what the delay should be.
|
|
@@ -83,7 +87,9 @@ export class Throttler {
|
|
|
83
87
|
export const formExponentialFn = ({ multiplier = 2, coefficient = 1, offset = 0, initialDelay = undefined, } = {}) => (numAttempts) => Math.max(0, numAttempts <= 0 && initialDelay !== undefined
|
|
84
88
|
? initialDelay
|
|
85
89
|
: coefficient * Math.pow(multiplier, numAttempts) + offset);
|
|
86
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* f(n) = C x (B^(n+A)) + F = (C x B^A) x B^n + F
|
|
92
|
+
*/
|
|
87
93
|
export const formExponentialFnWithAttemptOffset = (attemptOffset, { multiplier = 2, coefficient = 1, offset = 0, initialDelay = undefined, } = {}) => formExponentialFn({
|
|
88
94
|
multiplier,
|
|
89
95
|
coefficient: coefficient * Math.pow(multiplier, attemptOffset),
|
|
@@ -98,7 +104,9 @@ export const formExponentialFnWithAttemptOffset = (attemptOffset, { multiplier =
|
|
|
98
104
|
* 0 ms, 1 ms, 2 ms, 3 ms, ..., n ms delays; a linear back-off.
|
|
99
105
|
*/
|
|
100
106
|
export const formLinearFn = ({ coefficient = 1, offset = 0 } = {}) => (numAttempts) => Math.max(0, coefficient * numAttempts + offset);
|
|
101
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* f(n) = C x (n+A) + F = C x n + (C x A + F)
|
|
109
|
+
*/
|
|
102
110
|
export const formLinearFnWithAttemptOffset = (attemptOffset, { coefficient = 1, offset = 0 } = {}) => formLinearFn({
|
|
103
111
|
coefficient,
|
|
104
112
|
offset: coefficient * attemptOffset + offset,
|
package/lib/throttler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throttler.js","sourceRoot":"","sources":["../src/throttler.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"throttler.js","sourceRoot":"","sources":["../src/throttler.ts"],"names":[],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport interface IThrottler {\n\t/**\n\t * Computes what the throttle delay should be, and records an attempt\n\t * which will be used for calculating future attempt delays.\n\t */\n\tgetDelay(): number;\n\n\t/**\n\t * Number of attempts that occurred within the sliding window as of\n\t * the most recent delay computation.\n\t */\n\treadonly numAttempts: number;\n\n\t/**\n\t * Width of sliding delay window in milliseconds.\n\t */\n\treadonly delayWindowMs: number;\n\t/**\n\t * Maximum delay allowed in milliseconds.\n\t */\n\treadonly maxDelayMs: number;\n\t/**\n\t * Delay function used to calculate what the delay should be.\n\t * The input is the number of attempts that occurred within the sliding window.\n\t * The result is the calculated delay in milliseconds.\n\t */\n\treadonly delayFn: (numAttempts: number) => number;\n}\n\n/**\n * Used to give increasing delay times for throttling a single functionality.\n * Delay is based on previous attempts within specified time window, subtracting delay time.\n */\nexport class Throttler implements IThrottler {\n\tprivate startTimes: number[] = [];\n\n\tpublic get numAttempts(): number {\n\t\treturn this.startTimes.length;\n\t}\n\n\t/**\n\t * Gets all attempt start times after compensating for the delay times\n\t * by adding the delay times to the actual times.\n\t */\n\tpublic getAttempts(): readonly number[] {\n\t\treturn [...this.startTimes];\n\t}\n\n\t/**\n\t * Latest attempt time after compensating for the delay time itself\n\t * by adding the delay time to the actual time.\n\t */\n\tpublic get latestAttemptTime(): number | undefined {\n\t\treturn this.startTimes.length > 0\n\t\t\t? this.startTimes[this.startTimes.length - 1]\n\t\t\t: undefined;\n\t}\n\n\tconstructor(\n\t\t/**\n\t\t * Width of sliding delay window in milliseconds.\n\t\t */\n\t\tpublic readonly delayWindowMs: number,\n\t\t/**\n\t\t * Maximum delay allowed in milliseconds.\n\t\t */\n\t\tpublic readonly maxDelayMs: number,\n\t\t/**\n\t\t * Delay function used to calculate what the delay should be.\n\t\t * The input is the number of attempts that occurred within the sliding window.\n\t\t * The result is the calculated delay in milliseconds.\n\t\t */\n\t\tpublic readonly delayFn: (numAttempts: number) => number,\n\t) {}\n\n\tpublic getDelay(): number {\n\t\tconst now = Date.now();\n\n\t\tconst latestAttemptTime = this.latestAttemptTime;\n\t\tif (latestAttemptTime !== undefined) {\n\t\t\t// If getDelay was called sooner than the most recent delay,\n\t\t\t// subtract the remaining time, since we previously added it.\n\t\t\tconst earlyMs = latestAttemptTime - now;\n\t\t\tif (earlyMs > 0) {\n\t\t\t\tthis.startTimes = this.startTimes.map((t) => t - earlyMs);\n\t\t\t}\n\t\t}\n\n\t\t// Remove all attempts that have already fallen out of the window.\n\t\tthis.startTimes = this.startTimes.filter((t) => now - t < this.delayWindowMs);\n\n\t\t// Compute delay, but do not exceed the specified max delay.\n\t\tconst delayMs = Math.min(this.delayFn(this.startTimes.length), this.maxDelayMs);\n\n\t\t// Record this attempt start time.\n\t\tthis.startTimes.push(now);\n\n\t\t// Account for the delay time, by effectively removing it from the delay window.\n\t\tthis.startTimes = this.startTimes.map((t) => t + delayMs);\n\n\t\tif (delayMs === this.maxDelayMs) {\n\t\t\t// We hit max delay, so adding more won't affect anything.\n\t\t\t// Shift off oldest time to stop this array from growing forever.\n\t\t\tthis.startTimes.shift();\n\t\t}\n\n\t\treturn delayMs;\n\t}\n}\n\n/**\n * Helper function to generate simple exponential throttle functions.\n * f(n) = [coefficient] x ([multiplier]^n) + [flatOffset]\n * where n = number of attempts, and f(n) = delay time in milliseconds.\n * If not provided, coefficient will default to 1, multiplier to 2,\n * minimum delay to 0, and the offset to 0, yielding:\n * 0 ms, 2 ms, 4 ms, 8 ms, ..., 2^n ms\n * where M = multiplier; an exponential back-off.\n * Use initialDelay to decide what should happen when numAttempts is 0,\n * leave it undefined to not special case.\n */\nexport const formExponentialFn =\n\t({\n\t\tmultiplier = 2,\n\t\tcoefficient = 1,\n\t\toffset = 0,\n\t\tinitialDelay = undefined as number | undefined,\n\t} = {}): IThrottler[\"delayFn\"] =>\n\t(numAttempts) =>\n\t\tMath.max(\n\t\t\t0,\n\t\t\tnumAttempts <= 0 && initialDelay !== undefined\n\t\t\t\t? initialDelay\n\t\t\t\t: coefficient * Math.pow(multiplier, numAttempts) + offset,\n\t\t);\n\n/**\n * f(n) = C x (B^(n+A)) + F = (C x B^A) x B^n + F\n */\nexport const formExponentialFnWithAttemptOffset = (\n\tattemptOffset: number,\n\t{\n\t\tmultiplier = 2,\n\t\tcoefficient = 1,\n\t\toffset = 0,\n\t\tinitialDelay = undefined as number | undefined,\n\t} = {},\n): IThrottler[\"delayFn\"] =>\n\tformExponentialFn({\n\t\tmultiplier,\n\t\tcoefficient: coefficient * Math.pow(multiplier, attemptOffset),\n\t\toffset,\n\t\tinitialDelay,\n\t});\n\n/**\n * Helper function to generate simple linear throttle functions.\n * f(n) = [coefficient] x n + [flatOffset]\n * where n = number of attempts, and f(n) = delay time in milliseconds.\n * If not provided, coefficient will default to 1, and offset to 0, yielding:\n * 0 ms, 1 ms, 2 ms, 3 ms, ..., n ms delays; a linear back-off.\n */\nexport const formLinearFn =\n\t({ coefficient = 1, offset = 0 } = {}): IThrottler[\"delayFn\"] =>\n\t(numAttempts) =>\n\t\tMath.max(0, coefficient * numAttempts + offset);\n\n/**\n * f(n) = C x (n+A) + F = C x n + (C x A + F)\n */\nexport const formLinearFnWithAttemptOffset = (\n\tattemptOffset: number,\n\t{ coefficient = 1, offset = 0 } = {},\n): IThrottler[\"delayFn\"] =>\n\tformLinearFn({\n\t\tcoefficient,\n\t\toffset: coefficient * attemptOffset + offset,\n\t});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/container-runtime",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.21.0",
|
|
4
4
|
"description": "Fluid container runtime",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -63,16 +63,6 @@
|
|
|
63
63
|
"default": "./dist/deltaScheduler.js"
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
-
"./internal/test/scheduleManager": {
|
|
67
|
-
"import": {
|
|
68
|
-
"types": "./lib/scheduleManager.d.ts",
|
|
69
|
-
"default": "./lib/scheduleManager.js"
|
|
70
|
-
},
|
|
71
|
-
"require": {
|
|
72
|
-
"types": "./dist/scheduleManager.d.ts",
|
|
73
|
-
"default": "./dist/scheduleManager.js"
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
66
|
"./internal/test/blobManager": {
|
|
77
67
|
"import": {
|
|
78
68
|
"types": "./lib/blobManager/index.d.ts",
|
|
@@ -129,18 +119,18 @@
|
|
|
129
119
|
"temp-directory": "nyc/.nyc_output"
|
|
130
120
|
},
|
|
131
121
|
"dependencies": {
|
|
132
|
-
"@fluid-internal/client-utils": "~2.
|
|
133
|
-
"@fluidframework/container-definitions": "~2.
|
|
134
|
-
"@fluidframework/container-runtime-definitions": "~2.
|
|
135
|
-
"@fluidframework/core-interfaces": "~2.
|
|
136
|
-
"@fluidframework/core-utils": "~2.
|
|
137
|
-
"@fluidframework/datastore": "~2.
|
|
138
|
-
"@fluidframework/driver-definitions": "~2.
|
|
139
|
-
"@fluidframework/driver-utils": "~2.
|
|
140
|
-
"@fluidframework/id-compressor": "~2.
|
|
141
|
-
"@fluidframework/runtime-definitions": "~2.
|
|
142
|
-
"@fluidframework/runtime-utils": "~2.
|
|
143
|
-
"@fluidframework/telemetry-utils": "~2.
|
|
122
|
+
"@fluid-internal/client-utils": "~2.21.0",
|
|
123
|
+
"@fluidframework/container-definitions": "~2.21.0",
|
|
124
|
+
"@fluidframework/container-runtime-definitions": "~2.21.0",
|
|
125
|
+
"@fluidframework/core-interfaces": "~2.21.0",
|
|
126
|
+
"@fluidframework/core-utils": "~2.21.0",
|
|
127
|
+
"@fluidframework/datastore": "~2.21.0",
|
|
128
|
+
"@fluidframework/driver-definitions": "~2.21.0",
|
|
129
|
+
"@fluidframework/driver-utils": "~2.21.0",
|
|
130
|
+
"@fluidframework/id-compressor": "~2.21.0",
|
|
131
|
+
"@fluidframework/runtime-definitions": "~2.21.0",
|
|
132
|
+
"@fluidframework/runtime-utils": "~2.21.0",
|
|
133
|
+
"@fluidframework/telemetry-utils": "~2.21.0",
|
|
144
134
|
"@tylerbu/sorted-btree-es6": "^1.8.0",
|
|
145
135
|
"double-ended-queue": "^2.1.0-0",
|
|
146
136
|
"lz4js": "^0.2.0",
|
|
@@ -149,18 +139,19 @@
|
|
|
149
139
|
"devDependencies": {
|
|
150
140
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
151
141
|
"@biomejs/biome": "~1.9.3",
|
|
152
|
-
"@fluid-internal/mocha-test-setup": "~2.
|
|
153
|
-
"@fluid-private/stochastic-test-utils": "~2.
|
|
154
|
-
"@fluid-private/test-pairwise-generator": "~2.
|
|
142
|
+
"@fluid-internal/mocha-test-setup": "~2.21.0",
|
|
143
|
+
"@fluid-private/stochastic-test-utils": "~2.21.0",
|
|
144
|
+
"@fluid-private/test-pairwise-generator": "~2.21.0",
|
|
155
145
|
"@fluid-tools/benchmark": "^0.50.0",
|
|
156
146
|
"@fluid-tools/build-cli": "^0.51.0",
|
|
157
147
|
"@fluidframework/build-common": "^2.0.3",
|
|
158
148
|
"@fluidframework/build-tools": "^0.51.0",
|
|
159
|
-
"@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@2.
|
|
160
|
-
"@fluidframework/eslint-config-fluid": "^5.
|
|
161
|
-
"@fluidframework/test-runtime-utils": "~2.
|
|
149
|
+
"@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@2.20.0",
|
|
150
|
+
"@fluidframework/eslint-config-fluid": "^5.7.3",
|
|
151
|
+
"@fluidframework/test-runtime-utils": "~2.21.0",
|
|
162
152
|
"@microsoft/api-extractor": "7.47.8",
|
|
163
153
|
"@types/double-ended-queue": "^2.1.0",
|
|
154
|
+
"@types/lz4js": "^0.2.0",
|
|
164
155
|
"@types/mocha": "^10.0.10",
|
|
165
156
|
"@types/node": "^18.19.0",
|
|
166
157
|
"@types/sinon": "^17.0.3",
|
|
@@ -198,7 +189,7 @@
|
|
|
198
189
|
"build:test": "npm run build:test:esm && npm run build:test:cjs",
|
|
199
190
|
"build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
|
|
200
191
|
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
|
|
201
|
-
"check:are-the-types-wrong": "attw --pack . --exclude-entrypoints ./internal/test/containerRuntime ./internal/test/deltaScheduler ./internal/test/
|
|
192
|
+
"check:are-the-types-wrong": "attw --pack . --exclude-entrypoints ./internal/test/containerRuntime ./internal/test/deltaScheduler ./internal/test/blobManager ./internal/test/summary ./internal/test/gc",
|
|
202
193
|
"check:biome": "biome check .",
|
|
203
194
|
"check:exports": "concurrently \"npm:check:exports:*\"",
|
|
204
195
|
"check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
|
|
@@ -212,7 +203,7 @@
|
|
|
212
203
|
"ci:build:api-reports:current": "api-extractor run --config api-extractor/api-extractor.current.json",
|
|
213
204
|
"ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
|
|
214
205
|
"ci:build:docs": "api-extractor run",
|
|
215
|
-
"clean": "rimraf --glob dist lib
|
|
206
|
+
"clean": "rimraf --glob dist lib {alpha,beta,internal,legacy}.d.ts \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
216
207
|
"eslint": "eslint --format stylish src",
|
|
217
208
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
218
209
|
"format": "npm run format:biome",
|
package/src/batchTracker.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { EventEmitter } from "@fluid-internal/client-utils";
|
|
7
|
-
import {
|
|
7
|
+
import { performanceNow } from "@fluid-internal/client-utils";
|
|
8
8
|
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
9
9
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
10
10
|
import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
@@ -26,7 +26,7 @@ export class BatchTracker {
|
|
|
26
26
|
logger: ITelemetryBaseLogger,
|
|
27
27
|
batchLengthThreshold: number,
|
|
28
28
|
batchCountSamplingRate: number,
|
|
29
|
-
dateTimeProvider: () => number = () =>
|
|
29
|
+
dateTimeProvider: () => number = () => performanceNow(),
|
|
30
30
|
) {
|
|
31
31
|
this.logger = createChildLogger({ logger, namespace: "Batching" });
|
|
32
32
|
|
|
@@ -36,41 +36,38 @@ export class BatchTracker {
|
|
|
36
36
|
this.trackedBatchCount++;
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
this.batchEventEmitter.on(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
0x2ba /* "batchBegin must fire before batchEnd" */,
|
|
46
|
-
);
|
|
39
|
+
this.batchEventEmitter.on("batchEnd", (error: unknown, message: BatchTrackerMessage) => {
|
|
40
|
+
assert(
|
|
41
|
+
this.startBatchSequenceNumber !== undefined &&
|
|
42
|
+
this.batchProcessingStartTimeStamp !== undefined,
|
|
43
|
+
0x2ba /* "batchBegin must fire before batchEnd" */,
|
|
44
|
+
);
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
46
|
+
const length = message.sequenceNumber - this.startBatchSequenceNumber + 1;
|
|
47
|
+
if (length >= batchLengthThreshold) {
|
|
48
|
+
this.logger.sendPerformanceEvent({
|
|
49
|
+
eventName: "LengthTooBig",
|
|
50
|
+
length,
|
|
51
|
+
threshold: batchLengthThreshold,
|
|
52
|
+
batchEndSequenceNumber: message.sequenceNumber,
|
|
53
|
+
duration: dateTimeProvider() - this.batchProcessingStartTimeStamp,
|
|
54
|
+
batchError: error !== undefined,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
58
|
+
if (this.trackedBatchCount % batchCountSamplingRate === 0) {
|
|
59
|
+
this.logger.sendPerformanceEvent({
|
|
60
|
+
eventName: "Length",
|
|
61
|
+
length,
|
|
62
|
+
samplingRate: batchCountSamplingRate,
|
|
63
|
+
batchEndSequenceNumber: message.sequenceNumber,
|
|
64
|
+
duration: dateTimeProvider() - this.batchProcessingStartTimeStamp,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
69
67
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
);
|
|
68
|
+
this.startBatchSequenceNumber = undefined;
|
|
69
|
+
this.batchProcessingStartTimeStamp = undefined;
|
|
70
|
+
});
|
|
74
71
|
}
|
|
75
72
|
}
|
|
76
73
|
|
|
@@ -84,7 +81,8 @@ export class BatchTracker {
|
|
|
84
81
|
*/
|
|
85
82
|
export const BindBatchTracker = (
|
|
86
83
|
batchEventEmitter: EventEmitter,
|
|
87
|
-
logger:
|
|
84
|
+
logger: ITelemetryBaseLogger,
|
|
88
85
|
batchLengthThreshold: number = 1000,
|
|
89
86
|
batchCountSamplingRate: number = 1000,
|
|
90
|
-
)
|
|
87
|
+
): BatchTracker =>
|
|
88
|
+
new BatchTracker(batchEventEmitter, logger, batchLengthThreshold, batchCountSamplingRate);
|
|
@@ -51,6 +51,7 @@ import {
|
|
|
51
51
|
getStorageIds,
|
|
52
52
|
summarizeBlobManagerState,
|
|
53
53
|
toRedirectTable,
|
|
54
|
+
// eslint-disable-next-line import/no-deprecated
|
|
54
55
|
type IBlobManagerLoadInfo,
|
|
55
56
|
} from "./blobManagerSnapSum.js";
|
|
56
57
|
|
|
@@ -80,14 +81,14 @@ export class BlobHandle extends FluidHandleBase<ArrayBufferLike> {
|
|
|
80
81
|
this.absolutePath = generateHandleContextPath(path, this.routeContext);
|
|
81
82
|
}
|
|
82
83
|
|
|
83
|
-
public attachGraph() {
|
|
84
|
+
public attachGraph(): void {
|
|
84
85
|
if (!this.attached) {
|
|
85
86
|
this.attached = true;
|
|
86
87
|
this.onAttachGraph?.();
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
public bind(handle: IFluidHandleInternal) {
|
|
91
|
+
public bind(handle: IFluidHandleInternal): void {
|
|
91
92
|
throw new Error("Cannot bind to blob handle");
|
|
92
93
|
}
|
|
93
94
|
}
|
|
@@ -96,7 +97,7 @@ export class BlobHandle extends FluidHandleBase<ArrayBufferLike> {
|
|
|
96
97
|
// the contract explicit and reduces the amount of mocking required for tests.
|
|
97
98
|
export type IBlobManagerRuntime = Pick<
|
|
98
99
|
IContainerRuntime,
|
|
99
|
-
"attachState" | "connected" | "baseLogger" | "clientDetails"
|
|
100
|
+
"attachState" | "connected" | "baseLogger" | "clientDetails" | "disposed"
|
|
100
101
|
> &
|
|
101
102
|
TypedEventEmitter<IContainerRuntimeEvents>;
|
|
102
103
|
|
|
@@ -187,6 +188,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
187
188
|
|
|
188
189
|
constructor(props: {
|
|
189
190
|
readonly routeContext: IFluidHandleContext;
|
|
191
|
+
// eslint-disable-next-line import/no-deprecated
|
|
190
192
|
snapshot: IBlobManagerLoadInfo;
|
|
191
193
|
readonly getStorage: () => IDocumentStorageService;
|
|
192
194
|
/**
|
|
@@ -240,7 +242,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
240
242
|
this.redirectTable = toRedirectTable(snapshot, this.mc.logger, this.runtime.attachState);
|
|
241
243
|
|
|
242
244
|
// Begin uploading stashed blobs from previous container instance
|
|
243
|
-
Object.entries(stashedBlobs ?? {})
|
|
245
|
+
for (const [localId, entry] of Object.entries(stashedBlobs ?? {})) {
|
|
244
246
|
const { acked, storageId, minTTLInSeconds, uploadTime } = entry;
|
|
245
247
|
const blob = stringToBuffer(entry.blob, "base64");
|
|
246
248
|
const pendingEntry: PendingBlob = {
|
|
@@ -260,7 +262,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
260
262
|
const timeLapseSinceLocalUpload = (Date.now() - uploadTime) / 1000;
|
|
261
263
|
// stashed entries with more than half-life in storage will not be reuploaded
|
|
262
264
|
if (minTTLInSeconds - timeLapseSinceLocalUpload > minTTLInSeconds / 2) {
|
|
263
|
-
|
|
265
|
+
continue;
|
|
264
266
|
}
|
|
265
267
|
}
|
|
266
268
|
this.pendingStashedBlobs.set(localId, this.uploadBlob(localId, blob));
|
|
@@ -269,7 +271,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
269
271
|
...stashedPendingBlobOverrides,
|
|
270
272
|
uploadP: this.pendingStashedBlobs.get(localId),
|
|
271
273
|
});
|
|
272
|
-
}
|
|
274
|
+
}
|
|
273
275
|
|
|
274
276
|
this.stashedBlobsUploadP = new LazyPromise(async () =>
|
|
275
277
|
PerformanceEvent.timedExecAsync(
|
|
@@ -329,7 +331,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
329
331
|
);
|
|
330
332
|
}
|
|
331
333
|
|
|
332
|
-
private createAbortError(pending?: PendingBlob) {
|
|
334
|
+
private createAbortError(pending?: PendingBlob): LoggingError {
|
|
333
335
|
return new LoggingError("uploadBlob aborted", {
|
|
334
336
|
acked: pending?.acked,
|
|
335
337
|
uploadTime: pending?.uploadTime,
|
|
@@ -337,7 +339,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
337
339
|
}
|
|
338
340
|
|
|
339
341
|
public hasPendingStashedUploads(): boolean {
|
|
340
|
-
return
|
|
342
|
+
return [...this.pendingBlobs.values()].some((e) => e.stashedUpload === true);
|
|
341
343
|
}
|
|
342
344
|
|
|
343
345
|
public async getBlob(blobId: string): Promise<ArrayBufferLike> {
|
|
@@ -370,8 +372,17 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
370
372
|
return PerformanceEvent.timedExecAsync(
|
|
371
373
|
this.mc.logger,
|
|
372
374
|
{ eventName: "AttachmentReadBlob", id: storageId },
|
|
373
|
-
async () => {
|
|
374
|
-
return this.getStorage()
|
|
375
|
+
async (event) => {
|
|
376
|
+
return this.getStorage()
|
|
377
|
+
.readBlob(storageId)
|
|
378
|
+
.catch((error) => {
|
|
379
|
+
if (this.runtime.disposed) {
|
|
380
|
+
// If the runtime is disposed, this is not an error we care to track, it's expected behavior.
|
|
381
|
+
event.cancel({ category: "generic" });
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
throw error;
|
|
385
|
+
});
|
|
375
386
|
},
|
|
376
387
|
{ end: true, cancel: "error" },
|
|
377
388
|
);
|
|
@@ -445,7 +456,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
445
456
|
};
|
|
446
457
|
this.pendingBlobs.set(localId, pendingEntry);
|
|
447
458
|
|
|
448
|
-
const abortListener = () => {
|
|
459
|
+
const abortListener = (): void => {
|
|
449
460
|
if (!pendingEntry.acked) {
|
|
450
461
|
pendingEntry.handleP.reject(this.createAbortError(pendingEntry));
|
|
451
462
|
}
|
|
@@ -490,6 +501,8 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
490
501
|
(error) => {
|
|
491
502
|
this.mc.logger.sendTelemetryEvent({
|
|
492
503
|
eventName: "UploadBlobReject",
|
|
504
|
+
// TODO: better typing
|
|
505
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
493
506
|
error,
|
|
494
507
|
localId,
|
|
495
508
|
});
|
|
@@ -506,11 +519,11 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
506
519
|
* Set up a mapping in the redirect table from fromId to toId. Also, notify the runtime that a reference is added
|
|
507
520
|
* which is required for GC.
|
|
508
521
|
*/
|
|
509
|
-
private setRedirection(fromId: string, toId: string | undefined) {
|
|
522
|
+
private setRedirection(fromId: string, toId: string | undefined): void {
|
|
510
523
|
this.redirectTable.set(fromId, toId);
|
|
511
524
|
}
|
|
512
525
|
|
|
513
|
-
private deletePendingBlobMaybe(id: string) {
|
|
526
|
+
private deletePendingBlobMaybe(id: string): void {
|
|
514
527
|
if (this.pendingBlobs.has(id)) {
|
|
515
528
|
const entry = this.pendingBlobs.get(id);
|
|
516
529
|
if (entry?.attached && entry?.acked) {
|
|
@@ -519,13 +532,16 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
519
532
|
}
|
|
520
533
|
}
|
|
521
534
|
|
|
522
|
-
private deletePendingBlob(id: string) {
|
|
535
|
+
private deletePendingBlob(id: string): void {
|
|
523
536
|
if (this.pendingBlobs.delete(id) && !this.hasPendingBlobs) {
|
|
524
537
|
this.emit("noPendingBlobs");
|
|
525
538
|
}
|
|
526
539
|
}
|
|
527
540
|
|
|
528
|
-
private onUploadResolve(
|
|
541
|
+
private onUploadResolve(
|
|
542
|
+
localId: string,
|
|
543
|
+
response: ICreateBlobResponseWithTTL,
|
|
544
|
+
): ICreateBlobResponseWithTTL | undefined {
|
|
529
545
|
const entry = this.pendingBlobs.get(localId);
|
|
530
546
|
if (entry === undefined && this.pendingStashedBlobs.has(localId)) {
|
|
531
547
|
// The blob was already processed and deleted. This can happen if the blob was reuploaded by
|
|
@@ -574,10 +590,10 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
574
590
|
// If there is already an op for this storage ID, append the local ID to the list. Once any op for
|
|
575
591
|
// this storage ID is ack'd, all pending blobs for it can be resolved since the op will keep the
|
|
576
592
|
// blob alive in storage.
|
|
577
|
-
this.opsInFlight.set(
|
|
578
|
-
response.id,
|
|
579
|
-
|
|
580
|
-
);
|
|
593
|
+
this.opsInFlight.set(response.id, [
|
|
594
|
+
...(this.opsInFlight.get(response.id) ?? []),
|
|
595
|
+
localId,
|
|
596
|
+
]);
|
|
581
597
|
}
|
|
582
598
|
return response;
|
|
583
599
|
}
|
|
@@ -587,7 +603,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
587
603
|
* submitted to runtime while disconnected.
|
|
588
604
|
* @param metadata - op metadata containing storage and/or local IDs
|
|
589
605
|
*/
|
|
590
|
-
public reSubmit(metadata: Record<string, unknown> | undefined) {
|
|
606
|
+
public reSubmit(metadata: Record<string, unknown> | undefined): void {
|
|
591
607
|
assert(!!metadata, 0x38b /* Resubmitted ops must have metadata */);
|
|
592
608
|
const { localId, blobId }: { localId?: string; blobId?: string } = metadata;
|
|
593
609
|
assert(localId !== undefined, 0x50d /* local ID not available on reSubmit */);
|
|
@@ -604,7 +620,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
604
620
|
return this.sendBlobAttachOp(localId, blobId);
|
|
605
621
|
}
|
|
606
622
|
|
|
607
|
-
public processBlobAttachMessage(message: ISequencedMessageEnvelope, local: boolean) {
|
|
623
|
+
public processBlobAttachMessage(message: ISequencedMessageEnvelope, local: boolean): void {
|
|
608
624
|
const localId = (message.metadata as IBlobMetadata | undefined)?.localId;
|
|
609
625
|
const blobId = (message.metadata as IBlobMetadata | undefined)?.blobId;
|
|
610
626
|
|
|
@@ -634,7 +650,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
634
650
|
// For each op corresponding to this storage ID that we are waiting for, resolve the pending blob.
|
|
635
651
|
// This is safe because the server will keep the blob alive and the op containing the local ID to
|
|
636
652
|
// storage ID is already in flight and any op containing this local ID will be sequenced after that.
|
|
637
|
-
|
|
653
|
+
for (const pendingLocalId of waitingBlobs) {
|
|
638
654
|
const entry = this.pendingBlobs.get(pendingLocalId);
|
|
639
655
|
assert(
|
|
640
656
|
entry !== undefined,
|
|
@@ -644,7 +660,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
644
660
|
entry.acked = true;
|
|
645
661
|
entry.handleP.resolve(this.getBlobHandle(pendingLocalId));
|
|
646
662
|
this.deletePendingBlobMaybe(pendingLocalId);
|
|
647
|
-
}
|
|
663
|
+
}
|
|
648
664
|
this.opsInFlight.delete(blobId);
|
|
649
665
|
}
|
|
650
666
|
const localEntry = this.pendingBlobs.get(localId);
|
|
@@ -689,21 +705,25 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
689
705
|
*/
|
|
690
706
|
public deleteSweepReadyNodes(sweepReadyBlobRoutes: readonly string[]): readonly string[] {
|
|
691
707
|
this.deleteBlobsFromRedirectTable(sweepReadyBlobRoutes);
|
|
692
|
-
return
|
|
708
|
+
return [...sweepReadyBlobRoutes];
|
|
693
709
|
}
|
|
694
710
|
|
|
695
711
|
/**
|
|
696
712
|
* Delete blobs with the given routes from the redirect table.
|
|
713
|
+
*
|
|
714
|
+
* @remarks
|
|
697
715
|
* The routes are GC nodes paths of format -`/<blobManagerBasePath>/<blobId>`. The blob ids are all local ids.
|
|
698
716
|
* Deleting the blobs involves 2 steps:
|
|
717
|
+
*
|
|
699
718
|
* 1. The redirect table entry for the local ids are deleted.
|
|
719
|
+
*
|
|
700
720
|
* 2. If the storage ids corresponding to the deleted local ids are not in-use anymore, the redirect table entries
|
|
701
721
|
* for the storage ids are deleted as well.
|
|
702
722
|
*
|
|
703
723
|
* Note that this does not delete the blobs from storage service immediately. Deleting the blobs from redirect table
|
|
704
724
|
* will remove them the next summary. The service would them delete them some time in the future.
|
|
705
725
|
*/
|
|
706
|
-
private deleteBlobsFromRedirectTable(blobRoutes: readonly string[]) {
|
|
726
|
+
private deleteBlobsFromRedirectTable(blobRoutes: readonly string[]): void {
|
|
707
727
|
if (blobRoutes.length === 0) {
|
|
708
728
|
return;
|
|
709
729
|
}
|
|
@@ -753,7 +773,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
753
773
|
* Verifies that the blob with given id is not deleted, i.e., it has not been garbage collected. If the blob is GC'd,
|
|
754
774
|
* log an error and throw if necessary.
|
|
755
775
|
*/
|
|
756
|
-
private verifyBlobNotDeleted(blobId: string) {
|
|
776
|
+
private verifyBlobNotDeleted(blobId: string): void {
|
|
757
777
|
if (!this.isBlobDeleted(getGCNodePathFromBlobId(blobId))) {
|
|
758
778
|
return;
|
|
759
779
|
}
|
|
@@ -774,7 +794,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
774
794
|
throw error;
|
|
775
795
|
}
|
|
776
796
|
|
|
777
|
-
public setRedirectTable(table: Map<string, string>) {
|
|
797
|
+
public setRedirectTable(table: Map<string, string>): void {
|
|
778
798
|
assert(
|
|
779
799
|
this.runtime.attachState === AttachState.Detached,
|
|
780
800
|
0x252 /* "redirect table can only be set in detached container" */,
|
|
@@ -841,16 +861,16 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
841
861
|
},
|
|
842
862
|
{ once: true },
|
|
843
863
|
);
|
|
844
|
-
const onBlobAttached = (attachedEntry) => {
|
|
864
|
+
const onBlobAttached = (attachedEntry): void => {
|
|
845
865
|
if (attachedEntry === entry) {
|
|
846
866
|
this.off("blobAttached", onBlobAttached);
|
|
847
867
|
resolve();
|
|
848
868
|
}
|
|
849
869
|
};
|
|
850
|
-
if (
|
|
851
|
-
this.on("blobAttached", onBlobAttached);
|
|
852
|
-
} else {
|
|
870
|
+
if (entry.attached) {
|
|
853
871
|
resolve();
|
|
872
|
+
} else {
|
|
873
|
+
this.on("blobAttached", onBlobAttached);
|
|
854
874
|
}
|
|
855
875
|
}),
|
|
856
876
|
);
|
|
@@ -891,12 +911,13 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
891
911
|
* This path must match the path of the blob handle returned by the createBlob API because blobs are marked
|
|
892
912
|
* referenced by storing these handles in a referenced DDS.
|
|
893
913
|
*/
|
|
894
|
-
const getGCNodePathFromBlobId = (blobId: string) =>
|
|
914
|
+
const getGCNodePathFromBlobId = (blobId: string): string =>
|
|
915
|
+
`/${blobManagerBasePath}/${blobId}`;
|
|
895
916
|
|
|
896
917
|
/**
|
|
897
918
|
* For a given GC node path, return the blobId. The node path is of the format `/<basePath>/<blobId>`.
|
|
898
919
|
*/
|
|
899
|
-
const getBlobIdFromGCNodePath = (nodePath: string) => {
|
|
920
|
+
const getBlobIdFromGCNodePath = (nodePath: string): string => {
|
|
900
921
|
const pathParts = nodePath.split("/");
|
|
901
922
|
assert(areBlobPathParts(pathParts), 0x5bd /* Invalid blob node path */);
|
|
902
923
|
return pathParts[2];
|