@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
|
@@ -3,24 +3,18 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import { performance } from "@fluid-internal/client-utils";
|
|
6
|
+
import { performanceNow } from "@fluid-internal/client-utils";
|
|
8
7
|
import { IDeltaManagerFull } from "@fluidframework/container-definitions/internal";
|
|
9
8
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
10
|
-
import {
|
|
11
|
-
IDocumentMessage,
|
|
12
|
-
ISequencedDocumentMessage,
|
|
13
|
-
} from "@fluidframework/driver-definitions/internal";
|
|
9
|
+
import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
14
10
|
import { isRuntimeMessage } from "@fluidframework/driver-utils/internal";
|
|
15
11
|
import {
|
|
16
12
|
ITelemetryLoggerExt,
|
|
17
13
|
DataCorruptionError,
|
|
18
14
|
DataProcessingError,
|
|
19
|
-
createChildLogger,
|
|
20
15
|
extractSafePropertiesFromMessage,
|
|
21
16
|
} from "@fluidframework/telemetry-utils/internal";
|
|
22
17
|
|
|
23
|
-
import { DeltaScheduler } from "./deltaScheduler.js";
|
|
24
18
|
import { IBatchMetadata } from "./metadata.js";
|
|
25
19
|
import { pkgVersion } from "./packageVersion.js";
|
|
26
20
|
|
|
@@ -31,46 +25,10 @@ type IRuntimeMessageMetadata =
|
|
|
31
25
|
};
|
|
32
26
|
|
|
33
27
|
/**
|
|
34
|
-
* This class
|
|
35
|
-
*
|
|
36
|
-
* 1. It tracks batches as we process ops and raises "batchBegin" and "batchEnd" events.
|
|
37
|
-
* As part of it, it validates batch correctness (i.e. no system ops in the middle of batch)
|
|
38
|
-
*
|
|
39
|
-
* 2. It creates instance of ScheduleManagerCore that ensures we never start processing ops from batch
|
|
40
|
-
* unless all ops of the batch are in.
|
|
28
|
+
* This class ensures that we aggregate a complete batch of incoming ops before processing them. It basically ensures
|
|
29
|
+
* that we never start processing ops in a batch IF we do not have all ops in the batch.
|
|
41
30
|
*/
|
|
42
|
-
export class
|
|
43
|
-
private readonly deltaScheduler: DeltaScheduler;
|
|
44
|
-
|
|
45
|
-
constructor(
|
|
46
|
-
private readonly deltaManager: IDeltaManagerFull,
|
|
47
|
-
private readonly emitter: EventEmitter,
|
|
48
|
-
readonly getClientId: () => string | undefined,
|
|
49
|
-
private readonly logger: ITelemetryLoggerExt,
|
|
50
|
-
) {
|
|
51
|
-
this.deltaScheduler = new DeltaScheduler(
|
|
52
|
-
this.deltaManager,
|
|
53
|
-
createChildLogger({ logger: this.logger, namespace: "DeltaScheduler" }),
|
|
54
|
-
);
|
|
55
|
-
void new ScheduleManagerCore(deltaManager, getClientId, logger);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public batchBegin(message: ISequencedDocumentMessage) {
|
|
59
|
-
this.emitter.emit("batchBegin", message);
|
|
60
|
-
this.deltaScheduler.batchBegin(message);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
public batchEnd(error: any | undefined, message: ISequencedDocumentMessage) {
|
|
64
|
-
this.emitter.emit("batchEnd", error, message);
|
|
65
|
-
this.deltaScheduler.batchEnd(message);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* This class controls pausing and resuming of inbound queue to ensure that we never
|
|
71
|
-
* start processing ops in a batch IF we do not have all ops in the batch.
|
|
72
|
-
*/
|
|
73
|
-
class ScheduleManagerCore {
|
|
31
|
+
export class InboundBatchAggregator {
|
|
74
32
|
private pauseSequenceNumber: number | undefined;
|
|
75
33
|
private currentBatchClientId: string | undefined;
|
|
76
34
|
private localPaused = false;
|
|
@@ -82,38 +40,8 @@ class ScheduleManagerCore {
|
|
|
82
40
|
private readonly getClientId: () => string | undefined,
|
|
83
41
|
private readonly logger: ITelemetryLoggerExt,
|
|
84
42
|
) {
|
|
85
|
-
// Listen for delta manager sends and add batch metadata to messages
|
|
86
|
-
this.deltaManager.on("prepareSend", (messages: IDocumentMessage[]) => {
|
|
87
|
-
if (messages.length === 0) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// First message will have the batch flag set to true if doing a batched send
|
|
92
|
-
const firstMessageMetadata = messages[0].metadata as IRuntimeMessageMetadata;
|
|
93
|
-
if (!firstMessageMetadata?.batch) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// If the batch contains only a single op, clear the batch flag.
|
|
98
|
-
if (messages.length === 1) {
|
|
99
|
-
delete firstMessageMetadata.batch;
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Set the batch flag to false on the last message to indicate the end of the send batch
|
|
104
|
-
const lastMessage = messages[messages.length - 1];
|
|
105
|
-
// TODO: It's not clear if this shallow clone is required, as opposed to just setting "batch" to false.
|
|
106
|
-
|
|
107
|
-
lastMessage.metadata = { ...(lastMessage.metadata as any), batch: false };
|
|
108
|
-
});
|
|
109
|
-
|
|
110
43
|
// Listen for updates and peek at the inbound
|
|
111
|
-
this.deltaManager.inbound.on("push",
|
|
112
|
-
this.trackPending(message);
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
// Start with baseline - empty inbound queue.
|
|
116
|
-
assert(!this.localPaused, 0x293 /* "initial state" */);
|
|
44
|
+
this.deltaManager.inbound.on("push", this.trackPending);
|
|
117
45
|
|
|
118
46
|
const allPending = this.deltaManager.inbound.toArray();
|
|
119
47
|
for (const pending of allPending) {
|
|
@@ -121,16 +49,21 @@ class ScheduleManagerCore {
|
|
|
121
49
|
}
|
|
122
50
|
|
|
123
51
|
// We are intentionally directly listening to the "op" to inspect system ops as well.
|
|
124
|
-
// If we do not observe system ops, we are likely to hit
|
|
52
|
+
// If we do not observe system ops, we are likely to hit an error when system ops
|
|
125
53
|
// precedes start of incomplete batch.
|
|
126
|
-
this.deltaManager.on("op",
|
|
54
|
+
this.deltaManager.on("op", this.afterOpProcessing);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public dispose(): void {
|
|
58
|
+
this.deltaManager.off("op", this.afterOpProcessing);
|
|
59
|
+
this.deltaManager.inbound.off("push", this.trackPending);
|
|
127
60
|
}
|
|
128
61
|
|
|
129
62
|
/**
|
|
130
|
-
*
|
|
131
|
-
*
|
|
63
|
+
* Callback for DeltaManager's "op" event, for us to make decision if op processing should
|
|
64
|
+
* be paused or not after that.
|
|
132
65
|
*/
|
|
133
|
-
|
|
66
|
+
private readonly afterOpProcessing = (message: ISequencedDocumentMessage): void => {
|
|
134
67
|
assert(
|
|
135
68
|
!this.localPaused,
|
|
136
69
|
0x294 /* "can't have op processing paused if we are processing an op" */,
|
|
@@ -157,7 +90,7 @@ class ScheduleManagerCore {
|
|
|
157
90
|
throw DataProcessingError.create(
|
|
158
91
|
// Former assert 0x296
|
|
159
92
|
"Incomplete batch",
|
|
160
|
-
"
|
|
93
|
+
"InboundBatchAggregator",
|
|
161
94
|
message,
|
|
162
95
|
{
|
|
163
96
|
type: message.type,
|
|
@@ -174,49 +107,14 @@ class ScheduleManagerCore {
|
|
|
174
107
|
this.pauseQueue();
|
|
175
108
|
}
|
|
176
109
|
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
private pauseQueue() {
|
|
180
|
-
assert(!this.localPaused, 0x297 /* "always called from resumed state" */);
|
|
181
|
-
this.localPaused = true;
|
|
182
|
-
this.timePaused = performance.now();
|
|
183
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
184
|
-
this.deltaManager.inbound.pause();
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
private resumeQueue(startBatch: number, messageEndBatch: ISequencedDocumentMessage) {
|
|
188
|
-
const endBatch = messageEndBatch.sequenceNumber;
|
|
189
|
-
const duration = this.localPaused ? performance.now() - this.timePaused : undefined;
|
|
190
|
-
|
|
191
|
-
this.batchCount++;
|
|
192
|
-
if (this.batchCount % 1000 === 1) {
|
|
193
|
-
this.logger.sendTelemetryEvent({
|
|
194
|
-
eventName: "BatchStats",
|
|
195
|
-
sequenceNumber: endBatch,
|
|
196
|
-
length: endBatch - startBatch + 1,
|
|
197
|
-
msnDistance: endBatch - messageEndBatch.minimumSequenceNumber,
|
|
198
|
-
duration,
|
|
199
|
-
batchCount: this.batchCount,
|
|
200
|
-
interrupted: this.localPaused,
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// Return early if no change in value
|
|
205
|
-
if (!this.localPaused) {
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
this.localPaused = false;
|
|
210
|
-
|
|
211
|
-
this.deltaManager.inbound.resume();
|
|
212
|
-
}
|
|
110
|
+
};
|
|
213
111
|
|
|
214
112
|
/**
|
|
215
113
|
* Called for each incoming op (i.e. inbound "push" notification)
|
|
216
114
|
*/
|
|
217
|
-
private trackPending(message: ISequencedDocumentMessage) {
|
|
115
|
+
private readonly trackPending = (message: ISequencedDocumentMessage): void => {
|
|
218
116
|
assert(
|
|
219
|
-
this.deltaManager.inbound.length
|
|
117
|
+
this.deltaManager.inbound.length > 0,
|
|
220
118
|
0x298 /* "we have something in the queue that generates this event" */,
|
|
221
119
|
);
|
|
222
120
|
|
|
@@ -324,5 +222,40 @@ class ScheduleManagerCore {
|
|
|
324
222
|
// Continuation of current batch. Do nothing
|
|
325
223
|
assert(this.currentBatchClientId !== undefined, 0x2a1 /* "logic error" */);
|
|
326
224
|
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
private pauseQueue(): void {
|
|
228
|
+
assert(!this.localPaused, 0x297 /* "always called from resumed state" */);
|
|
229
|
+
this.localPaused = true;
|
|
230
|
+
this.timePaused = performanceNow();
|
|
231
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
232
|
+
this.deltaManager.inbound.pause();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
private resumeQueue(startBatch: number, messageEndBatch: ISequencedDocumentMessage): void {
|
|
236
|
+
const endBatch = messageEndBatch.sequenceNumber;
|
|
237
|
+
const duration = this.localPaused ? performanceNow() - this.timePaused : undefined;
|
|
238
|
+
|
|
239
|
+
this.batchCount++;
|
|
240
|
+
if (this.batchCount % 1000 === 1) {
|
|
241
|
+
this.logger.sendTelemetryEvent({
|
|
242
|
+
eventName: "BatchStats",
|
|
243
|
+
sequenceNumber: endBatch,
|
|
244
|
+
length: endBatch - startBatch + 1,
|
|
245
|
+
msnDistance: endBatch - messageEndBatch.minimumSequenceNumber,
|
|
246
|
+
duration,
|
|
247
|
+
batchCount: this.batchCount,
|
|
248
|
+
interrupted: this.localPaused,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Return early if no change in value
|
|
253
|
+
if (!this.localPaused) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
this.localPaused = false;
|
|
258
|
+
|
|
259
|
+
this.deltaManager.inbound.resume();
|
|
327
260
|
}
|
|
328
261
|
}
|
package/src/index.ts
CHANGED
|
@@ -55,7 +55,6 @@ export {
|
|
|
55
55
|
ISummaryCancellationToken,
|
|
56
56
|
neverCancelledSummaryToken,
|
|
57
57
|
Summarizer,
|
|
58
|
-
SummarizerStopReason,
|
|
59
58
|
SummaryCollection,
|
|
60
59
|
EnqueueSummarizeResult,
|
|
61
60
|
IAckSummaryResult,
|
|
@@ -75,7 +74,6 @@ export {
|
|
|
75
74
|
ISubmitSummaryOptions,
|
|
76
75
|
ISerializedElection,
|
|
77
76
|
ISummarizeOptions,
|
|
78
|
-
ISummarizerEvents,
|
|
79
77
|
ISummarizerInternalsProvider,
|
|
80
78
|
ISummarizerRuntime,
|
|
81
79
|
ISummarizingWarning,
|
|
@@ -95,7 +93,6 @@ export {
|
|
|
95
93
|
SubmitSummaryFailureData,
|
|
96
94
|
SummaryStage,
|
|
97
95
|
IRetriableFailureError,
|
|
98
|
-
ISummarizeEventProps,
|
|
99
96
|
IdCompressorMode,
|
|
100
97
|
IDocumentSchema,
|
|
101
98
|
DocumentSchemaValueType,
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
checkLayerCompatibility,
|
|
8
|
+
type ILayerCompatDetails,
|
|
9
|
+
type ILayerCompatSupportRequirements,
|
|
10
|
+
} from "@fluid-internal/client-utils";
|
|
11
|
+
import type { ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
12
|
+
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
13
|
+
|
|
14
|
+
import { pkgVersion } from "./packageVersion.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Runtime's compatibility details that is exposed to the Loader layer.
|
|
18
|
+
*/
|
|
19
|
+
export const RuntimeCompatDetails: ILayerCompatDetails = {
|
|
20
|
+
/**
|
|
21
|
+
* The package version of the Runtime layer.
|
|
22
|
+
*/
|
|
23
|
+
pkgVersion,
|
|
24
|
+
/**
|
|
25
|
+
* The current generation of the Runtime layer.
|
|
26
|
+
*/
|
|
27
|
+
generation: 1,
|
|
28
|
+
/**
|
|
29
|
+
* The features supported by the Runtime layer across the Runtime / Loader boundary.
|
|
30
|
+
*/
|
|
31
|
+
supportedFeatures: new Set<string>(),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The requirements that the Loader layer must meet to be compatible with this Runtime.
|
|
36
|
+
*/
|
|
37
|
+
export const LoaderSupportRequirements: ILayerCompatSupportRequirements = {
|
|
38
|
+
/**
|
|
39
|
+
* Minimum generation that Loader must be at to be compatible with Runtime.
|
|
40
|
+
*/
|
|
41
|
+
minSupportedGeneration: 0,
|
|
42
|
+
/**
|
|
43
|
+
* The features that the Loader must support to be compatible with Runtime. Note that 0 is used here for
|
|
44
|
+
* Loader layers before the introduction of the layer compatibility enforcement.
|
|
45
|
+
*/
|
|
46
|
+
requiredFeatures: [],
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Validates that the Loader layer is compatible with this Runtime.
|
|
51
|
+
*/
|
|
52
|
+
export function validateLoaderCompatibility(
|
|
53
|
+
maybeLoaderCompatDetails: ILayerCompatDetails | undefined,
|
|
54
|
+
disposeFn: (error?: ICriticalContainerError) => void,
|
|
55
|
+
): void {
|
|
56
|
+
const layerCheckResult = checkLayerCompatibility(
|
|
57
|
+
LoaderSupportRequirements,
|
|
58
|
+
maybeLoaderCompatDetails,
|
|
59
|
+
);
|
|
60
|
+
if (!layerCheckResult.isCompatible) {
|
|
61
|
+
const error = new UsageError("Runtime is not compatible with Loader", {
|
|
62
|
+
errorDetails: JSON.stringify({
|
|
63
|
+
runtimeVersion: RuntimeCompatDetails.pkgVersion,
|
|
64
|
+
loaderVersion: maybeLoaderCompatDetails?.pkgVersion,
|
|
65
|
+
runtimeGeneration: RuntimeCompatDetails.generation,
|
|
66
|
+
loaderGeneration: maybeLoaderCompatDetails?.generation,
|
|
67
|
+
minSupportedGeneration: LoaderSupportRequirements.minSupportedGeneration,
|
|
68
|
+
isGenerationCompatible: layerCheckResult.isGenerationCompatible,
|
|
69
|
+
unsupportedFeatures: layerCheckResult.unsupportedFeatures,
|
|
70
|
+
}),
|
|
71
|
+
});
|
|
72
|
+
disposeFn(error);
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
}
|
package/src/messageTypes.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
import { IDataStoreAliasMessage } from "./dataStore.js";
|
|
15
15
|
import { GarbageCollectionMessage } from "./gc/index.js";
|
|
16
16
|
import { IChunkedOp } from "./opLifecycle/index.js";
|
|
17
|
+
// eslint-disable-next-line import/no-deprecated
|
|
17
18
|
import { IDocumentSchemaChangeMessage } from "./summary/index.js";
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -66,9 +67,13 @@ export enum ContainerMessageType {
|
|
|
66
67
|
* This way stringified values can be compared.
|
|
67
68
|
*/
|
|
68
69
|
interface TypedContainerRuntimeMessage<TType extends ContainerMessageType, TContents> {
|
|
69
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Type of the op, within the ContainerRuntime's domain
|
|
72
|
+
*/
|
|
70
73
|
type: TType;
|
|
71
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Domain-specific contents, interpreted according to the type
|
|
76
|
+
*/
|
|
72
77
|
contents: TContents;
|
|
73
78
|
}
|
|
74
79
|
|
|
@@ -110,6 +115,7 @@ export type ContainerRuntimeGCMessage = TypedContainerRuntimeMessage<
|
|
|
110
115
|
>;
|
|
111
116
|
export type ContainerRuntimeDocumentSchemaMessage = TypedContainerRuntimeMessage<
|
|
112
117
|
ContainerMessageType.DocumentSchemaChange,
|
|
118
|
+
// eslint-disable-next-line import/no-deprecated
|
|
113
119
|
IDocumentSchemaChangeMessage
|
|
114
120
|
>;
|
|
115
121
|
|
|
@@ -118,13 +124,16 @@ export type ContainerRuntimeDocumentSchemaMessage = TypedContainerRuntimeMessage
|
|
|
118
124
|
* @internal
|
|
119
125
|
*/
|
|
120
126
|
export interface UnknownContainerRuntimeMessage {
|
|
121
|
-
/**
|
|
127
|
+
/**
|
|
128
|
+
* Invalid type of the op, within the ContainerRuntime's domain. This value should never exist at runtime.
|
|
122
129
|
* This is useful for type narrowing but should never be used as an actual message type at runtime.
|
|
123
130
|
* Actual value will not be "__unknown...", but the type `Exclude<string, ContainerMessageType>` is not supported.
|
|
124
131
|
*/
|
|
125
132
|
type: "__unknown_container_message_type__never_use_as_value__";
|
|
126
133
|
|
|
127
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* Domain-specific contents, but not decipherable by an unknown op.
|
|
136
|
+
*/
|
|
128
137
|
contents: unknown;
|
|
129
138
|
}
|
|
130
139
|
|
|
@@ -160,7 +169,9 @@ export type LocalContainerRuntimeMessage =
|
|
|
160
169
|
| UnknownContainerRuntimeMessage
|
|
161
170
|
| ContainerRuntimeDocumentSchemaMessage;
|
|
162
171
|
|
|
163
|
-
/**
|
|
172
|
+
/**
|
|
173
|
+
* A {@link TypedContainerRuntimeMessage} that is being sent to the server from the container runtime.
|
|
174
|
+
*/
|
|
164
175
|
export type OutboundContainerRuntimeMessage =
|
|
165
176
|
| ContainerRuntimeDataStoreOpMessage
|
|
166
177
|
| OutboundContainerRuntimeAttachMessage
|
package/src/metadata.ts
CHANGED
|
@@ -5,12 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
import type { BatchId } from "./opLifecycle/index.js";
|
|
7
7
|
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Syntactic sugar for casting
|
|
10
|
+
*/
|
|
9
11
|
export function asBatchMetadata(metadata: unknown): Partial<IBatchMetadata> | undefined {
|
|
10
12
|
return metadata as Partial<IBatchMetadata> | undefined;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Syntactic sugar for casting
|
|
17
|
+
*/
|
|
14
18
|
export function asEmptyBatchLocalOpMetadata(
|
|
15
19
|
localOpMetadata: unknown,
|
|
16
20
|
): IEmptyBatchMetadata | undefined {
|
|
@@ -28,9 +32,13 @@ export interface IEmptyBatchMetadata {
|
|
|
28
32
|
* Properties put on the op metadata object for batch tracking
|
|
29
33
|
*/
|
|
30
34
|
export interface IBatchMetadata {
|
|
31
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Set on first/last messages of a multi-message batch, to true/false respectively
|
|
37
|
+
*/
|
|
32
38
|
batch?: boolean;
|
|
33
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Maybe set on first message of a batch, to the batchId generated when resubmitting (set/fixed on first resubmit)
|
|
41
|
+
*/
|
|
34
42
|
batchId?: BatchId;
|
|
35
43
|
}
|
|
36
44
|
|
|
@@ -2,21 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
## Table of contents
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
- [Configs and feature gates for solving the 1MB limit.](#configs-and-feature-gates-for-solving-the-1mb-limit)
|
|
6
|
+
- [Table of contents](#table-of-contents)
|
|
7
|
+
- [Introduction](#introduction)
|
|
8
|
+
- [How batching works](#how-batching-works)
|
|
9
|
+
- [Grouped batching](#grouped-batching)
|
|
10
|
+
- [Changes in op semantics](#changes-in-op-semantics)
|
|
11
|
+
- [Compression](#compression)
|
|
12
|
+
- [Only single-message batches are compressed](#only-single-message-batches-are-compressed)
|
|
13
|
+
- [Chunking for compression](#chunking-for-compression)
|
|
14
|
+
- [Configuration](#configuration)
|
|
15
|
+
- [Note about performance and latency](#note-about-performance-and-latency)
|
|
16
|
+
- [How it works](#how-it-works)
|
|
17
|
+
- [Legacy behavior - How it used to work (Compression+Chunking without Grouped Batching)](#legacy-behavior---how-it-used-to-work-compressionchunking-without-grouped-batching)
|
|
18
|
+
- [IMPORTANT - As of 2.20.0, we no longer compress ungrouped batches, but we do need to read such ops - read on to learn what these legacy ops look like](#important---as-of-2200-we-no-longer-compress-ungrouped-batches-but-we-do-need-to-read-such-ops---read-on-to-learn-what-these-legacy-ops-look-like)
|
|
19
|
+
- [How the overall op flow works](#how-the-overall-op-flow-works)
|
|
20
|
+
- [Outbound](#outbound)
|
|
21
|
+
- [Inbound](#inbound)
|
|
20
22
|
|
|
21
23
|
## Introduction
|
|
22
24
|
|
|
@@ -56,20 +58,6 @@ What this means is that `FlushMode.Immediate` will send each op in its own paylo
|
|
|
56
58
|
|
|
57
59
|
As `FlushMode.TurnBased` accumulates ops, it is the most vulnerable to run into the 1MB socket limit.
|
|
58
60
|
|
|
59
|
-
## Compression
|
|
60
|
-
|
|
61
|
-
**Compression targets payloads which exceed the max batch size and it is enabled by default.**. The `IContainerRuntimeOptions.compressionOptions` property, of type `ICompressionRuntimeOptions` is the configuration governing how compression works.
|
|
62
|
-
|
|
63
|
-
`ICompressionRuntimeOptions` has two properties:
|
|
64
|
-
|
|
65
|
-
- `minimumBatchSizeInBytes` – the minimum size of the batch for which compression should kick in. If the payload is too small, compression may not yield too many benefits. To target the original 1MB issue, a good value here would be to match the default maxBatchSizeInBytes (972800), however, experimentally, a good lower value could be at around 614400 bytes. Setting this value to `Number.POSITIVE_INFINITY` will disable compression.
|
|
66
|
-
- `compressionAlgorithm` – currently, only `lz4` is supported.
|
|
67
|
-
|
|
68
|
-
Compression is relevant for both `FlushMode.TurnBased` and `FlushMode.Immediate` as it only targets the contents of the ops and not the number of ops in a batch. Compression is opaque to the server and implementations of the Fluid protocol do not need to alter their behavior to support this client feature.
|
|
69
|
-
|
|
70
|
-
Compressing a batch yields a batch with the same number of messages. It compresses all the content, shifting the compressed payload into the first op,
|
|
71
|
-
leaving the rest of the batch's messages as empty placeholders to reserve sequence numbers for the compressed messages.
|
|
72
|
-
|
|
73
61
|
## Grouped batching
|
|
74
62
|
|
|
75
63
|
With Grouped Batching enabled (it's on by default), all batch messages are combined under a single "grouped" message _before compression_. Upon receiving this new "grouped" message, the batch messages will be extracted, and they each will be given the same sequence number - that of the parent "grouped" message.
|
|
@@ -78,9 +66,7 @@ The purpose for enabling grouped batching before compression is to eliminate the
|
|
|
78
66
|
|
|
79
67
|
Grouped batching is only relevant for `FlushMode.TurnBased`, since `OpGroupingManagerConfig.opCountThreshold` defaults to 2. Grouped batching is opaque to the server and implementations of the Fluid protocol do not need to alter their behavior to support this client feature.
|
|
80
68
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
See [below](#how-grouped-batching-works) for an example.
|
|
69
|
+
See [below](#how-it-works) for an example.
|
|
84
70
|
|
|
85
71
|
### Changes in op semantics
|
|
86
72
|
|
|
@@ -92,6 +78,27 @@ Grouped Batching changed a couple of expectations around message structure and r
|
|
|
92
78
|
- All ops in a batch must also have the same reference sequence number to ensure eventualy consistency of the model. The runtime will "rebase" ops in a batch with different ref sequence number to satisfy that requirement.
|
|
93
79
|
- What causes ops in a single JS turn (and thus in a batch) to have different reference sequence number? "Op reentrancy", where changes are made to a DDS inside a DDS 'onChanged' event handler.
|
|
94
80
|
|
|
81
|
+
## Compression
|
|
82
|
+
|
|
83
|
+
**Compression targets payloads which exceed the max batch size and it is enabled by default.**. The `IContainerRuntimeOptions.compressionOptions` property, of type `ICompressionRuntimeOptions` is the configuration governing how compression works.
|
|
84
|
+
|
|
85
|
+
`ICompressionRuntimeOptions` has two properties:
|
|
86
|
+
|
|
87
|
+
- `minimumBatchSizeInBytes` – the minimum size of the batch for which compression should kick in. If the payload is too small, compression may not yield too many benefits. To target the original 1MB issue, a good value here would be to match the default maxBatchSizeInBytes (972800), however, experimentally, a good lower value could be at around 614400 bytes. Setting this value to `Number.POSITIVE_INFINITY` will disable compression.
|
|
88
|
+
- `compressionAlgorithm` – currently, only `lz4` is supported.
|
|
89
|
+
|
|
90
|
+
Compression is relevant for both `FlushMode.TurnBased` and `FlushMode.Immediate` as it only targets the contents of the ops and not the number of ops in a batch. Compression is opaque to the server and implementations of the Fluid protocol do not need to alter their behavior to support this client feature.
|
|
91
|
+
|
|
92
|
+
### Only single-message batches are compressed
|
|
93
|
+
|
|
94
|
+
The batch to compress has to have only one message and it yields a batch with a single message. It compresses all the content, replacing the op's original contents with the compressed payload and the appropriate metadata to indicate it's compressed.
|
|
95
|
+
|
|
96
|
+
Compression is only enabled if Grouped Batching is enabled.
|
|
97
|
+
|
|
98
|
+
Legacy compressed batches could contain multiple messages, compressing all the content and shifting the compressed payload into the first op, leaving the rest of the batch's messages as empty placeholders to reserve sequence numbers for the compressed messages.
|
|
99
|
+
|
|
100
|
+
While it remains possible to read compressed batches with empty ops, the system will no longer create said type of batches.
|
|
101
|
+
|
|
95
102
|
## Chunking for compression
|
|
96
103
|
|
|
97
104
|
**Op chunking for compression targets payloads which exceed the max batch size after compression.** So, only payloads which are already compressed. By default, the feature is enabled.
|
|
@@ -200,7 +207,9 @@ Ungrouped batch:
|
|
|
200
207
|
+-----------------+-----------------+-----------------+-----------------+-----------------+
|
|
201
208
|
```
|
|
202
209
|
|
|
203
|
-
## How it
|
|
210
|
+
## Legacy behavior - How it used to work (Compression+Chunking without Grouped Batching)
|
|
211
|
+
|
|
212
|
+
### IMPORTANT - As of 2.20.0, we no longer compress ungrouped batches, but we do need to read such ops - read on to learn what these legacy ops look like
|
|
204
213
|
|
|
205
214
|
If we have a batch with a size larger than the configured minimum required for compression (in the example let’s say it’s 850 bytes), as following:
|
|
206
215
|
|
|
@@ -311,7 +320,7 @@ stateDiagram-v2
|
|
|
311
320
|
groupBatch --> if_compression
|
|
312
321
|
flushInternal --> if_compression
|
|
313
322
|
if_compression --> post
|
|
314
|
-
if_compression --> compress: if compression
|
|
323
|
+
if_compression --> compress: if compression and grouped batching are enabled
|
|
315
324
|
compress --> post
|
|
316
325
|
compress --> opSplitter.split: if the compressed payload is larger than the chunk size
|
|
317
326
|
opSplitter.split --> post
|
|
@@ -21,7 +21,9 @@ export interface IBatchManagerOptions {
|
|
|
21
21
|
*/
|
|
22
22
|
readonly canRebase: boolean;
|
|
23
23
|
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* If true, don't compare batchID of incoming batches to this. e.g. ID Allocation Batch IDs should be ignored
|
|
26
|
+
*/
|
|
25
27
|
readonly ignoreBatchId?: boolean;
|
|
26
28
|
}
|
|
27
29
|
|
|
@@ -30,10 +32,14 @@ export interface BatchSequenceNumbers {
|
|
|
30
32
|
clientSequenceNumber?: number;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Type alias for the batchId stored in batch metadata
|
|
37
|
+
*/
|
|
34
38
|
export type BatchId = string;
|
|
35
39
|
|
|
36
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Compose original client ID and client sequence number into BatchId to stamp on the message during reconnect
|
|
42
|
+
*/
|
|
37
43
|
export function generateBatchId(originalClientId: string, batchStartCsn: number): BatchId {
|
|
38
44
|
return `${originalClientId}_[${batchStartCsn}]`;
|
|
39
45
|
}
|
|
@@ -76,10 +82,10 @@ export class BatchManager {
|
|
|
76
82
|
private batchContentSize = 0;
|
|
77
83
|
private hasReentrantOps = false;
|
|
78
84
|
|
|
79
|
-
public get length() {
|
|
85
|
+
public get length(): number {
|
|
80
86
|
return this.pendingBatch.length;
|
|
81
87
|
}
|
|
82
|
-
public get contentSizeInBytes() {
|
|
88
|
+
public get contentSizeInBytes(): number {
|
|
83
89
|
return this.batchContentSize;
|
|
84
90
|
}
|
|
85
91
|
|
|
@@ -133,7 +139,7 @@ export class BatchManager {
|
|
|
133
139
|
return true;
|
|
134
140
|
}
|
|
135
141
|
|
|
136
|
-
public get empty() {
|
|
142
|
+
public get empty(): boolean {
|
|
137
143
|
return this.pendingBatch.length === 0;
|
|
138
144
|
}
|
|
139
145
|
|
|
@@ -13,13 +13,19 @@ import { type BatchStartInfo } from "./remoteMessageProcessor.js";
|
|
|
13
13
|
* This class tracks recent batchIds we've seen, and checks incoming batches for duplicates.
|
|
14
14
|
*/
|
|
15
15
|
export class DuplicateBatchDetector {
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* All batchIds we've seen recently enough (based on MSN) that we need to watch for duplicates
|
|
18
|
+
*/
|
|
17
19
|
private readonly batchIdsAll = new Set<string>();
|
|
18
20
|
|
|
19
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* We map from sequenceNumber to batchId to find which ones we can stop tracking as MSN advances
|
|
23
|
+
*/
|
|
20
24
|
private readonly batchIdsBySeqNum = new Map<number, string>();
|
|
21
25
|
|
|
22
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Initialize from snapshot data if provided - otherwise initialize empty
|
|
28
|
+
*/
|
|
23
29
|
constructor(batchIdsFromSnapshot: [number, string][] | undefined) {
|
|
24
30
|
if (batchIdsFromSnapshot) {
|
|
25
31
|
this.batchIdsBySeqNum = new Map(batchIdsFromSnapshot);
|
|
@@ -78,13 +84,13 @@ export class DuplicateBatchDetector {
|
|
|
78
84
|
* Batches that started before the MSN are not at risk for a sequenced duplicate to arrive,
|
|
79
85
|
* since the batch start has been processed by all clients, and local batches are deduped and the forked client would close.
|
|
80
86
|
*/
|
|
81
|
-
private clearOldBatchIds(msn: number) {
|
|
82
|
-
this.batchIdsBySeqNum
|
|
87
|
+
private clearOldBatchIds(msn: number): void {
|
|
88
|
+
for (const [sequenceNumber, batchId] of this.batchIdsBySeqNum) {
|
|
83
89
|
if (sequenceNumber < msn) {
|
|
84
90
|
this.batchIdsBySeqNum.delete(sequenceNumber);
|
|
85
91
|
this.batchIdsAll.delete(batchId);
|
|
86
92
|
}
|
|
87
|
-
}
|
|
93
|
+
}
|
|
88
94
|
}
|
|
89
95
|
|
|
90
96
|
/**
|