@fluidframework/container-runtime 2.0.0-dev-rc.2.0.0.246488 → 2.0.0-dev-rc.3.0.0.253463
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/api-report/container-runtime.api.md +109 -55
- package/dist/batchTracker.d.ts +1 -1
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +4 -4
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +33 -25
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +82 -100
- package/dist/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +7 -6
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +110 -77
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.d.ts +3 -3
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +17 -17
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/container-runtime-alpha.d.ts +263 -41
- package/dist/container-runtime-beta.d.ts +44 -30
- package/dist/container-runtime-public.d.ts +44 -30
- package/dist/container-runtime-untrimmed.d.ts +265 -56
- package/dist/containerHandleContext.d.ts.map +1 -1
- package/dist/containerHandleContext.js +2 -2
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +40 -30
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +376 -255
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +7 -7
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +9 -9
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +74 -74
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +11 -11
- 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 +2 -2
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/deltaManagerSummarizerProxy.d.ts +1 -1
- package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -1
- package/dist/deltaManagerSummarizerProxy.js.map +1 -1
- package/dist/deltaScheduler.d.ts +1 -1
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +6 -6
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/error.d.ts +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +4 -4
- package/dist/error.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +3 -2
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +21 -21
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts +2 -2
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +4 -5
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +4 -3
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +5 -1
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +21 -12
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts +2 -2
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +11 -11
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +2 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +11 -9
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +6 -6
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/gc/index.d.ts +1 -1
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +2 -1
- package/dist/gc/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/messageTypes.d.ts +11 -5
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js +4 -0
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +2 -20
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/index.d.ts +3 -3
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js +3 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +5 -6
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +15 -4
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +62 -63
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts +2 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +14 -16
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +12 -4
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +63 -53
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +2 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +19 -24
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +8 -0
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +36 -35
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts +1 -1
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +18 -18
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +24 -24
- package/dist/scheduleManager.js.map +1 -1
- package/dist/storageServiceWithAttachBlobs.d.ts +2 -2
- package/dist/storageServiceWithAttachBlobs.d.ts.map +1 -1
- package/dist/storageServiceWithAttachBlobs.js +2 -2
- package/dist/storageServiceWithAttachBlobs.js.map +1 -1
- package/dist/summary/documentSchema.d.ts +209 -0
- package/dist/summary/documentSchema.d.ts.map +1 -0
- package/dist/summary/documentSchema.js +382 -0
- package/dist/summary/documentSchema.js.map +1 -0
- package/dist/summary/index.d.ts +2 -1
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js +4 -1
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +2 -2
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +8 -7
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +3 -3
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +3 -3
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +16 -16
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +3 -2
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +13 -13
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts +2 -2
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.d.ts +1 -1
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summary/summarizerHeuristics.js +2 -2
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +3 -2
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +28 -28
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +3 -3
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +14 -14
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +5 -3
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +2 -2
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +7 -7
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +6 -17
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js +8 -8
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +4 -3
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +17 -17
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +1 -1
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +15 -14
- package/dist/summary/summaryManager.js.map +1 -1
- package/lib/batchTracker.d.ts +1 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +2 -2
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +33 -25
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +48 -66
- package/lib/blobManager.js.map +1 -1
- package/lib/channelCollection.d.ts +7 -6
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +47 -14
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.d.ts +3 -3
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +3 -3
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/container-runtime-alpha.d.ts +263 -41
- package/lib/container-runtime-beta.d.ts +44 -30
- package/lib/container-runtime-public.d.ts +44 -30
- package/lib/container-runtime-untrimmed.d.ts +265 -56
- package/lib/containerHandleContext.d.ts.map +1 -1
- package/lib/containerHandleContext.js +1 -1
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +40 -30
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +224 -101
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +2 -2
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +9 -9
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +8 -8
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +2 -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 +1 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/deltaManagerSummarizerProxy.d.ts +1 -1
- package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -1
- package/lib/deltaManagerSummarizerProxy.js.map +1 -1
- package/lib/deltaScheduler.d.ts +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/error.d.ts +1 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js +2 -2
- package/lib/error.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +3 -2
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +6 -6
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts +2 -2
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +4 -5
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +4 -3
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts +5 -1
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +10 -2
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts +2 -2
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +2 -2
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +2 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +4 -2
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +2 -2
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/lib/gc/index.d.ts +1 -1
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +1 -1
- package/lib/gc/index.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/messageTypes.d.ts +11 -5
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js +4 -0
- package/lib/messageTypes.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +2 -20
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/index.d.ts +3 -3
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js +2 -2
- package/lib/opLifecycle/index.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +2 -3
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts +15 -4
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +61 -62
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts +2 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +9 -12
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +12 -4
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +47 -38
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +2 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +8 -13
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +8 -0
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +36 -35
- 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 +1 -1
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +2 -2
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +3 -3
- package/lib/scheduleManager.js.map +1 -1
- package/lib/storageServiceWithAttachBlobs.d.ts +2 -2
- package/lib/storageServiceWithAttachBlobs.d.ts.map +1 -1
- package/lib/storageServiceWithAttachBlobs.js +1 -1
- package/lib/storageServiceWithAttachBlobs.js.map +1 -1
- package/lib/summary/documentSchema.d.ts +209 -0
- package/lib/summary/documentSchema.d.ts.map +1 -0
- package/lib/summary/documentSchema.js +378 -0
- package/lib/summary/documentSchema.js.map +1 -0
- package/lib/summary/index.d.ts +2 -1
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js +1 -0
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +2 -2
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +3 -2
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +3 -3
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +3 -3
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +3 -2
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +3 -3
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts +2 -2
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.d.ts +1 -1
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summary/summarizerHeuristics.js +1 -1
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +3 -2
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +5 -5
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +3 -3
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +5 -3
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +2 -2
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +1 -1
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +6 -17
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js +3 -3
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +4 -3
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +4 -4
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +1 -1
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +9 -8
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/tsdoc-metadata.json +11 -0
- package/package.json +34 -32
- package/src/batchTracker.ts +4 -3
- package/src/blobManager.ts +100 -69
- package/src/channelCollection.ts +86 -43
- package/src/connectionTelemetry.ts +12 -12
- package/src/containerHandleContext.ts +3 -2
- package/src/containerRuntime.ts +419 -232
- package/src/dataStore.ts +5 -3
- package/src/dataStoreContext.ts +32 -29
- package/src/dataStoreContexts.ts +4 -2
- package/src/dataStoreRegistry.ts +2 -2
- package/src/deltaManagerSummarizerProxy.ts +1 -1
- package/src/deltaScheduler.ts +2 -1
- package/src/error.ts +2 -2
- package/src/gc/garbageCollection.ts +19 -18
- package/src/gc/gcConfigs.ts +15 -18
- package/src/gc/gcDefinitions.ts +6 -6
- package/src/gc/gcHelpers.ts +22 -5
- package/src/gc/gcSummaryStateTracker.ts +7 -5
- package/src/gc/gcTelemetry.ts +13 -7
- package/src/gc/gcUnreferencedStateTracker.ts +3 -2
- package/src/gc/index.ts +1 -0
- package/src/index.ts +8 -1
- package/src/messageTypes.ts +20 -6
- package/src/opLifecycle/README.md +89 -0
- package/src/opLifecycle/batchManager.ts +1 -0
- package/src/opLifecycle/definitions.ts +3 -21
- package/src/opLifecycle/index.ts +3 -9
- package/src/opLifecycle/opCompressor.ts +6 -5
- package/src/opLifecycle/opDecompressor.ts +84 -100
- package/src/opLifecycle/opGroupingManager.ts +12 -14
- package/src/opLifecycle/opSplitter.ts +76 -48
- package/src/opLifecycle/outbox.ts +17 -32
- package/src/opLifecycle/remoteMessageProcessor.ts +43 -59
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +6 -6
- package/src/scheduleManager.ts +9 -8
- package/src/storageServiceWithAttachBlobs.ts +2 -2
- package/src/summary/documentSchema.ts +612 -0
- package/src/summary/index.ts +10 -1
- package/src/summary/orderedClientElection.ts +6 -7
- package/src/summary/runWhileConnectedCoordinator.ts +3 -2
- package/src/summary/runningSummarizer.ts +22 -20
- package/src/summary/summarizer.ts +17 -15
- package/src/summary/summarizerClientElection.ts +3 -2
- package/src/summary/summarizerHeuristics.ts +4 -2
- package/src/summary/summarizerNode/summarizerNode.ts +20 -18
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +3 -2
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +16 -8
- package/src/summary/summarizerTypes.ts +7 -3
- package/src/summary/summaryCollection.ts +3 -3
- package/src/summary/summaryFormat.ts +14 -26
- package/src/summary/summaryGenerator.ts +12 -15
- package/src/summary/summaryManager.ts +16 -13
- package/lib/test/batchTracker.spec.js +0 -88
- package/lib/test/batchTracker.spec.js.map +0 -1
- package/lib/test/blobManager.spec.js +0 -835
- package/lib/test/blobManager.spec.js.map +0 -1
- package/lib/test/channelCollection.spec.js +0 -138
- package/lib/test/channelCollection.spec.js.map +0 -1
- package/lib/test/containerRuntime.spec.js +0 -1748
- package/lib/test/containerRuntime.spec.js.map +0 -1
- package/lib/test/dataStoreContext.spec.js +0 -771
- package/lib/test/dataStoreContext.spec.js.map +0 -1
- package/lib/test/dataStoreCreation.spec.js +0 -303
- package/lib/test/dataStoreCreation.spec.js.map +0 -1
- package/lib/test/dataStoreRegistry.spec.js +0 -26
- package/lib/test/dataStoreRegistry.spec.js.map +0 -1
- package/lib/test/fuzz/fuzzUtils.js +0 -66
- package/lib/test/fuzz/fuzzUtils.js.map +0 -1
- package/lib/test/fuzz/summarizer.fuzz.spec.js +0 -31
- package/lib/test/fuzz/summarizer.fuzz.spec.js.map +0 -1
- package/lib/test/fuzz/summarizerFuzzMocks.js +0 -162
- package/lib/test/fuzz/summarizerFuzzMocks.js.map +0 -1
- package/lib/test/fuzz/summarizerFuzzSuite.js +0 -106
- package/lib/test/fuzz/summarizerFuzzSuite.js.map +0 -1
- package/lib/test/gc/garbageCollection.spec.js +0 -1464
- package/lib/test/gc/garbageCollection.spec.js.map +0 -1
- package/lib/test/gc/gcConfigs.spec.js +0 -689
- package/lib/test/gc/gcConfigs.spec.js.map +0 -1
- package/lib/test/gc/gcHelpers.spec.js +0 -110
- package/lib/test/gc/gcHelpers.spec.js.map +0 -1
- package/lib/test/gc/gcReferenceGraphAlgorithm.spec.js +0 -68
- package/lib/test/gc/gcReferenceGraphAlgorithm.spec.js.map +0 -1
- package/lib/test/gc/gcStats.spec.js +0 -390
- package/lib/test/gc/gcStats.spec.js.map +0 -1
- package/lib/test/gc/gcSummaryStateTracker.spec.js +0 -228
- package/lib/test/gc/gcSummaryStateTracker.spec.js.map +0 -1
- package/lib/test/gc/gcTelemetry.spec.js +0 -530
- package/lib/test/gc/gcTelemetry.spec.js.map +0 -1
- package/lib/test/gc/gcUnitTestHelpers.js +0 -29
- package/lib/test/gc/gcUnitTestHelpers.js.map +0 -1
- package/lib/test/gc/gcUnreferencedStateTracker.spec.js +0 -192
- package/lib/test/gc/gcUnreferencedStateTracker.spec.js.map +0 -1
- package/lib/test/getPendingBlobs.spec.js +0 -193
- package/lib/test/getPendingBlobs.spec.js.map +0 -1
- package/lib/test/hardwareStats.spec.js +0 -93
- package/lib/test/hardwareStats.spec.js.map +0 -1
- package/lib/test/index.js +0 -6
- package/lib/test/index.js.map +0 -1
- package/lib/test/opLifecycle/OpGroupingManager.spec.js +0 -225
- package/lib/test/opLifecycle/OpGroupingManager.spec.js.map +0 -1
- package/lib/test/opLifecycle/batchManager.spec.js +0 -189
- package/lib/test/opLifecycle/batchManager.spec.js.map +0 -1
- package/lib/test/opLifecycle/opCompressor.spec.js +0 -74
- package/lib/test/opLifecycle/opCompressor.spec.js.map +0 -1
- package/lib/test/opLifecycle/opDecompressor.spec.js +0 -218
- package/lib/test/opLifecycle/opDecompressor.spec.js.map +0 -1
- package/lib/test/opLifecycle/opSplitter.spec.js +0 -272
- package/lib/test/opLifecycle/opSplitter.spec.js.map +0 -1
- package/lib/test/opLifecycle/outbox.spec.js +0 -675
- package/lib/test/opLifecycle/outbox.spec.js.map +0 -1
- package/lib/test/opLifecycle/remoteMessageProcessor.spec.js +0 -196
- package/lib/test/opLifecycle/remoteMessageProcessor.spec.js.map +0 -1
- package/lib/test/pendingStateManager.spec.js +0 -329
- package/lib/test/pendingStateManager.spec.js.map +0 -1
- package/lib/test/scheduleManager.spec.js +0 -270
- package/lib/test/scheduleManager.spec.js.map +0 -1
- package/lib/test/summarizerNode.spec.js +0 -326
- package/lib/test/summarizerNode.spec.js.map +0 -1
- package/lib/test/summarizerNodeWithGc.spec.js +0 -318
- package/lib/test/summarizerNodeWithGc.spec.js.map +0 -1
- package/lib/test/summary/orderedClientElection.spec.js +0 -535
- package/lib/test/summary/orderedClientElection.spec.js.map +0 -1
- package/lib/test/summary/runningSummarizer.spec.js +0 -1349
- package/lib/test/summary/runningSummarizer.spec.js.map +0 -1
- package/lib/test/summary/summarizer.spec.js +0 -29
- package/lib/test/summary/summarizer.spec.js.map +0 -1
- package/lib/test/summary/summarizerClientElection.spec.js +0 -436
- package/lib/test/summary/summarizerClientElection.spec.js.map +0 -1
- package/lib/test/summary/summarizerHeuristics.spec.js +0 -289
- package/lib/test/summary/summarizerHeuristics.spec.js.map +0 -1
- package/lib/test/summary/summaryCollection.spec.js +0 -200
- package/lib/test/summary/summaryCollection.spec.js.map +0 -1
- package/lib/test/summary/summaryManager.spec.js +0 -430
- package/lib/test/summary/summaryManager.spec.js.map +0 -1
- package/lib/test/summary/testQuorumClients.js +0 -34
- package/lib/test/summary/testQuorumClients.js.map +0 -1
- package/lib/test/throttler.spec.js +0 -175
- package/lib/test/throttler.spec.js.map +0 -1
- package/lib/test/types/validateContainerRuntimePrevious.generated.js +0 -180
- package/lib/test/types/validateContainerRuntimePrevious.generated.js.map +0 -1
package/lib/containerRuntime.js
CHANGED
|
@@ -2,32 +2,35 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { AttachState, LoaderHeader, } from "@fluidframework/container-definitions";
|
|
6
|
-
import { assert, Deferred, delay, LazyPromise, PromiseCache } from "@fluidframework/core-utils";
|
|
7
5
|
import { Trace, TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import { AttachState, } from "@fluidframework/container-definitions";
|
|
7
|
+
import { LoaderHeader, } from "@fluidframework/container-definitions/internal";
|
|
8
|
+
import { assert, Deferred, LazyPromise, PromiseCache, delay, } from "@fluidframework/core-utils/internal";
|
|
9
|
+
import { DriverHeader, FetchSource, } from "@fluidframework/driver-definitions/internal";
|
|
10
|
+
import { readAndParse } from "@fluidframework/driver-utils/internal";
|
|
11
11
|
import { MessageType, SummaryType, } from "@fluidframework/protocol-definitions";
|
|
12
|
-
import { FlushMode, FlushModeExperimental,
|
|
13
|
-
import {
|
|
12
|
+
import { FlushMode, FlushModeExperimental, channelsTreeName, gcTreeKey, } from "@fluidframework/runtime-definitions/internal";
|
|
13
|
+
import { GCDataBuilder, RequestParser, TelemetryContext, addBlobToSummary, addSummarizeResultToSummary, calculateStats, create404Response, exceptionToResponse, responseToException, seqFromTree, } from "@fluidframework/runtime-utils/internal";
|
|
14
|
+
import { DataCorruptionError, DataProcessingError, GenericError, LoggingError, PerformanceEvent,
|
|
15
|
+
// eslint-disable-next-line import/no-deprecated
|
|
16
|
+
TaggedLoggerAdapter, UsageError, createChildLogger, createChildMonitoringContext, createSampledLogger, loggerToMonitoringContext, raiseConnectedEvent, wrapError, } from "@fluidframework/telemetry-utils/internal";
|
|
14
17
|
import { v4 as uuid } from "uuid";
|
|
15
|
-
import {
|
|
16
|
-
import { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
17
|
-
import { ReportOpPerfTelemetry } from "./connectionTelemetry.js";
|
|
18
|
-
import { PendingStateManager, } from "./pendingStateManager.js";
|
|
19
|
-
import { pkgVersion } from "./packageVersion.js";
|
|
18
|
+
import { BindBatchTracker } from "./batchTracker.js";
|
|
20
19
|
import { BlobManager } from "./blobManager.js";
|
|
21
20
|
import { ChannelCollection, getSummaryForDatastores, wrapContext } from "./channelCollection.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { GarbageCollector, GCNodeType, gcGenerationOptionName, } from "./gc/index.js";
|
|
21
|
+
import { ReportOpPerfTelemetry } from "./connectionTelemetry.js";
|
|
22
|
+
import { ContainerFluidHandleContext } from "./containerHandleContext.js";
|
|
25
23
|
import { channelToDataStore } from "./dataStore.js";
|
|
26
|
-
import {
|
|
27
|
-
import { ScheduleManager } from "./scheduleManager.js";
|
|
28
|
-
import { OpCompressor, OpDecompressor, Outbox, OpSplitter, RemoteMessageProcessor, OpGroupingManager, getLongStack, } from "./opLifecycle/index.js";
|
|
24
|
+
import { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
29
25
|
import { DeltaManagerSummarizerProxy } from "./deltaManagerSummarizerProxy.js";
|
|
26
|
+
import { GCNodeType, GarbageCollector, gcGenerationOptionName, } from "./gc/index.js";
|
|
30
27
|
import { ContainerMessageType, } from "./messageTypes.js";
|
|
28
|
+
import { OpCompressor, OpDecompressor, OpGroupingManager, OpSplitter, Outbox, RemoteMessageProcessor, getLongStack, } from "./opLifecycle/index.js";
|
|
29
|
+
import { pkgVersion } from "./packageVersion.js";
|
|
30
|
+
import { PendingStateManager, } from "./pendingStateManager.js";
|
|
31
|
+
import { ScheduleManager } from "./scheduleManager.js";
|
|
32
|
+
import { DocumentsSchemaController, OrderedClientCollection, OrderedClientElection, RetriableSummaryError, RunWhileConnectedCoordinator, Summarizer, SummarizerClientElection, SummaryCollection, SummaryManager, aliasBlobName, blobsTreeName, chunksBlobName, createRootSummarizerNodeWithGC, electedSummarizerBlobName, extractSummaryMetadataMessage, idCompressorBlobName, metadataBlobName, rootHasIsolatedChannels, summarizerClientType, wrapSummaryInChannelsTree, } from "./summary/index.js";
|
|
33
|
+
import { Throttler, formExponentialFn } from "./throttler.js";
|
|
31
34
|
/**
|
|
32
35
|
* Utility to implement compat behaviors given an unknown message type
|
|
33
36
|
* The parameters are typed to support compile-time enforcement of handling all known types/behaviors
|
|
@@ -82,6 +85,11 @@ export var CompressionAlgorithms;
|
|
|
82
85
|
(function (CompressionAlgorithms) {
|
|
83
86
|
CompressionAlgorithms["lz4"] = "lz4";
|
|
84
87
|
})(CompressionAlgorithms || (CompressionAlgorithms = {}));
|
|
88
|
+
/** @alpha */
|
|
89
|
+
export const disabledCompressionConfig = {
|
|
90
|
+
minimumBatchSizeInBytes: Infinity,
|
|
91
|
+
compressionAlgorithm: CompressionAlgorithms.lz4,
|
|
92
|
+
};
|
|
85
93
|
const maxConsecutiveReconnectsKey = "Fluid.ContainerRuntime.MaxConsecutiveReconnects";
|
|
86
94
|
const defaultFlushMode = FlushMode.TurnBased;
|
|
87
95
|
// The actual limit is 1Mb (socket.io and Kafka limits)
|
|
@@ -105,26 +113,12 @@ export const defaultPendingOpsRetryDelayMs = 1000;
|
|
|
105
113
|
* This delay's goal is to prevent tight restart loops
|
|
106
114
|
*/
|
|
107
115
|
const defaultCloseSummarizerDelayMs = 5000; // 5 seconds
|
|
108
|
-
/**
|
|
109
|
-
* @deprecated use ContainerRuntimeMessageType instead
|
|
110
|
-
* @internal
|
|
111
|
-
*/
|
|
112
|
-
export var RuntimeMessage;
|
|
113
|
-
(function (RuntimeMessage) {
|
|
114
|
-
RuntimeMessage["FluidDataStoreOp"] = "component";
|
|
115
|
-
RuntimeMessage["Attach"] = "attach";
|
|
116
|
-
RuntimeMessage["ChunkedOp"] = "chunkedOp";
|
|
117
|
-
RuntimeMessage["BlobAttach"] = "blobAttach";
|
|
118
|
-
RuntimeMessage["Rejoin"] = "rejoin";
|
|
119
|
-
RuntimeMessage["Alias"] = "alias";
|
|
120
|
-
RuntimeMessage["Operation"] = "op";
|
|
121
|
-
})(RuntimeMessage || (RuntimeMessage = {}));
|
|
122
116
|
/**
|
|
123
117
|
* @deprecated please use version in driver-utils
|
|
124
118
|
* @internal
|
|
125
119
|
*/
|
|
126
120
|
export function isRuntimeMessage(message) {
|
|
127
|
-
return Object.values(
|
|
121
|
+
return Object.values(ContainerMessageType).includes(message.type);
|
|
128
122
|
}
|
|
129
123
|
/**
|
|
130
124
|
* Legacy ID for the built-in AgentScheduler. To minimize disruption while removing it, retaining this as a
|
|
@@ -198,6 +192,17 @@ async function createSummarizer(loader, url) {
|
|
|
198
192
|
}
|
|
199
193
|
return fluidObject.ISummarizer;
|
|
200
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Extract last message from the snapshot metadata.
|
|
197
|
+
* Uses legacy property if not using explicit schema control, otherwise uses the new property.
|
|
198
|
+
* This allows new runtime to make documents not openable for old runtimes, one explicit document schema control is enabled.
|
|
199
|
+
* Please see addMetadataToSummary() as well
|
|
200
|
+
*/
|
|
201
|
+
function lastMessageFromMetadata(metadata) {
|
|
202
|
+
return metadata?.documentSchema?.runtime?.explicitSchemaControl
|
|
203
|
+
? metadata?.lastMessage
|
|
204
|
+
: metadata?.message;
|
|
205
|
+
}
|
|
201
206
|
/**
|
|
202
207
|
* Represents the runtime of the container. Contains helper functions/state of the container.
|
|
203
208
|
* It will define the store level mappings.
|
|
@@ -225,6 +230,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
225
230
|
// back-compat: Remove the TaggedLoggerAdapter fallback once all the host are using loader > 0.45
|
|
226
231
|
const backCompatContext = context;
|
|
227
232
|
const passLogger = backCompatContext.taggedLogger ??
|
|
233
|
+
// eslint-disable-next-line import/no-deprecated
|
|
228
234
|
new TaggedLoggerAdapter(backCompatContext.logger);
|
|
229
235
|
const logger = createChildLogger({
|
|
230
236
|
logger: passLogger,
|
|
@@ -235,7 +241,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
235
241
|
},
|
|
236
242
|
});
|
|
237
243
|
const mc = loggerToMonitoringContext(logger);
|
|
238
|
-
const { summaryOptions = {}, gcOptions = {}, loadSequenceNumberVerification = "close", flushMode = defaultFlushMode, compressionOptions = defaultCompressionConfig, maxBatchSizeInBytes = defaultMaxBatchSizeInBytes, enableRuntimeIdCompressor
|
|
244
|
+
const { summaryOptions = {}, gcOptions = {}, loadSequenceNumberVerification = "close", flushMode = defaultFlushMode, compressionOptions = defaultCompressionConfig, maxBatchSizeInBytes = defaultMaxBatchSizeInBytes, enableRuntimeIdCompressor, chunkSizeInBytes = defaultChunkSizeInBytes, enableOpReentryCheck = false, enableGroupedBatching = false, explicitSchemaControl = false, } = runtimeOptions;
|
|
239
245
|
const registry = new FluidDataStoreRegistry(registryEntries);
|
|
240
246
|
const tryFetchBlob = async (blobName) => {
|
|
241
247
|
const blobId = context.baseSnapshot?.blobs[blobName];
|
|
@@ -260,14 +266,21 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
260
266
|
assert(context.storage !== undefined, 0x256 /* "storage undefined in attached container" */);
|
|
261
267
|
return readAndParse(context.storage, id);
|
|
262
268
|
});
|
|
269
|
+
const messageAtLastSummary = lastMessageFromMetadata(metadata);
|
|
263
270
|
// Verify summary runtime sequence number matches protocol sequence number.
|
|
264
|
-
const runtimeSequenceNumber =
|
|
271
|
+
const runtimeSequenceNumber = messageAtLastSummary?.sequenceNumber;
|
|
265
272
|
// When we load with pending state, we reuse an old snapshot so we don't expect these numbers to match
|
|
266
273
|
if (!context.pendingLocalState && runtimeSequenceNumber !== undefined) {
|
|
267
274
|
const protocolSequenceNumber = context.deltaManager.initialSequenceNumber;
|
|
268
275
|
// Unless bypass is explicitly set, then take action when sequence numbers mismatch.
|
|
269
276
|
if (loadSequenceNumberVerification !== "bypass" &&
|
|
270
277
|
runtimeSequenceNumber !== protocolSequenceNumber) {
|
|
278
|
+
// Message to OCEs:
|
|
279
|
+
// You can hit this error with runtimeSequenceNumber === -1 in < 2.0 RC3 builds.
|
|
280
|
+
// This would indicate that explicit schema control is enabled in current (2.0 RC3+) builds and it
|
|
281
|
+
// results in addMetadataToSummary() creating a poison pill for older runtimes in the form of a -1 sequence number.
|
|
282
|
+
// Older runtimes do not understand new schema, and thus could corrupt document if they proceed, thus we are using
|
|
283
|
+
// this poison pill to prevent them from proceeding.
|
|
271
284
|
// "Load from summary, runtime metadata sequenceNumber !== initialSequenceNumber"
|
|
272
285
|
const error = new DataCorruptionError(
|
|
273
286
|
// pre-0.58 error message: SummaryMetadataMismatch
|
|
@@ -281,7 +294,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
281
294
|
}
|
|
282
295
|
}
|
|
283
296
|
// Enabling the IdCompressor is a one-way operation and we only want to
|
|
284
|
-
// allow new containers to turn it on
|
|
297
|
+
// allow new containers to turn it on.
|
|
285
298
|
let idCompressorMode;
|
|
286
299
|
if (existing) {
|
|
287
300
|
// This setting has to be sticky for correctness:
|
|
@@ -290,20 +303,20 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
290
303
|
// 2) if it's ON, then all sessions should load compressor right away
|
|
291
304
|
// 3) Same logic applies for "delayed" mode
|
|
292
305
|
// Maybe in the future we will need to enabled (and figure how to do it safely) "delayed" -> "on" change.
|
|
293
|
-
// We could do "off" -> "on"
|
|
294
|
-
// this will allow clients to eventually to disregard "off" setting (when it's safe so) and start
|
|
306
|
+
// We could do "off" -> "on" transition too, if all clients start loading compressor (but not using it initially) and
|
|
307
|
+
// do so for a while - this will allow clients to eventually to disregard "off" setting (when it's safe so) and start
|
|
308
|
+
// using compressor in future sessions.
|
|
295
309
|
// Everyting is possible, but it needs to be designed and executed carefully, when such need arises.
|
|
296
|
-
idCompressorMode = metadata?.
|
|
310
|
+
idCompressorMode = metadata?.documentSchema?.runtime
|
|
311
|
+
?.idCompressorMode;
|
|
297
312
|
}
|
|
298
313
|
else {
|
|
299
|
-
|
|
300
|
-
const enabled = mc.config.getBoolean("Fluid.ContainerRuntime.IdCompressorEnabled");
|
|
301
|
-
switch (enabled) {
|
|
314
|
+
switch (mc.config.getBoolean("Fluid.ContainerRuntime.IdCompressorEnabled")) {
|
|
302
315
|
case true:
|
|
303
316
|
idCompressorMode = "on";
|
|
304
317
|
break;
|
|
305
318
|
case false:
|
|
306
|
-
idCompressorMode =
|
|
319
|
+
idCompressorMode = undefined;
|
|
307
320
|
break;
|
|
308
321
|
default:
|
|
309
322
|
idCompressorMode = enableRuntimeIdCompressor;
|
|
@@ -311,7 +324,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
311
324
|
}
|
|
312
325
|
}
|
|
313
326
|
const createIdCompressorFn = async () => {
|
|
314
|
-
const { createIdCompressor, deserializeIdCompressor, createSessionId } = await import("@fluidframework/id-compressor");
|
|
327
|
+
const { createIdCompressor, deserializeIdCompressor, createSessionId } = await import("@fluidframework/id-compressor/internal");
|
|
315
328
|
/**
|
|
316
329
|
* Because the IdCompressor emits so much telemetry, this function is used to sample
|
|
317
330
|
* approximately 5% of all clients. Only the given percentage of sessions will emit telemetry.
|
|
@@ -336,6 +349,25 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
336
349
|
return createIdCompressor(compressorLogger);
|
|
337
350
|
}
|
|
338
351
|
};
|
|
352
|
+
const disableGroupedBatching = mc.config.getBoolean("Fluid.ContainerRuntime.DisableGroupedBatching");
|
|
353
|
+
const disableCompression = mc.config.getBoolean("Fluid.ContainerRuntime.CompressionDisabled");
|
|
354
|
+
const compressionLz4 = disableCompression !== true &&
|
|
355
|
+
compressionOptions.minimumBatchSizeInBytes !== Infinity &&
|
|
356
|
+
compressionOptions.compressionAlgorithm === "lz4";
|
|
357
|
+
const opGroupingEnabled = disableGroupedBatching !== true && enableGroupedBatching;
|
|
358
|
+
const documentSchemaController = new DocumentsSchemaController(existing, metadata?.documentSchema, {
|
|
359
|
+
explicitSchemaControl,
|
|
360
|
+
compressionLz4,
|
|
361
|
+
idCompressorMode,
|
|
362
|
+
opGroupingEnabled,
|
|
363
|
+
disallowedVersions: [],
|
|
364
|
+
}, (schema) => {
|
|
365
|
+
runtime.onSchemaChange(schema);
|
|
366
|
+
});
|
|
367
|
+
const featureGatesForTelemetry = {
|
|
368
|
+
disableGroupedBatching,
|
|
369
|
+
disableCompression,
|
|
370
|
+
};
|
|
339
371
|
const runtime = new containerRuntimeCtor(context, registry, metadata, electedSummarizerData, chunks ?? [], aliases ?? [], {
|
|
340
372
|
summaryOptions,
|
|
341
373
|
gcOptions,
|
|
@@ -344,10 +376,19 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
344
376
|
compressionOptions,
|
|
345
377
|
maxBatchSizeInBytes,
|
|
346
378
|
chunkSizeInBytes,
|
|
347
|
-
|
|
379
|
+
// Requires<> drops undefined from IdCompressorType
|
|
380
|
+
enableRuntimeIdCompressor: enableRuntimeIdCompressor,
|
|
348
381
|
enableOpReentryCheck,
|
|
349
382
|
enableGroupedBatching,
|
|
350
|
-
|
|
383
|
+
explicitSchemaControl,
|
|
384
|
+
}, containerScope, logger, existing, blobManagerSnapshot, context.storage, createIdCompressorFn, documentSchemaController, featureGatesForTelemetry, provideEntryPoint, requestHandler, undefined);
|
|
385
|
+
runtime.blobManager.trackPendingStashedUploads().then(() => {
|
|
386
|
+
// make sure we didn't reconnect before the promise resolved
|
|
387
|
+
if (runtime.delayConnectClientId !== undefined && !runtime.disposed) {
|
|
388
|
+
runtime.delayConnectClientId = undefined;
|
|
389
|
+
runtime.setConnectionStateCore(true, runtime.delayConnectClientId);
|
|
390
|
+
}
|
|
391
|
+
}, (error) => runtime.closeFn(error));
|
|
351
392
|
// Apply stashed ops with a reference sequence number equal to the sequence number of the snapshot,
|
|
352
393
|
// or zero. This must be done before Container replays saved ops.
|
|
353
394
|
await runtime.pendingStateManager.applyStashedOpsAt(runtimeSequenceNumber ?? 0);
|
|
@@ -376,6 +417,12 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
376
417
|
get attachState() {
|
|
377
418
|
return this._getAttachState();
|
|
378
419
|
}
|
|
420
|
+
get documentSchema() {
|
|
421
|
+
return this.documentsSchemaController.sessionSchema.runtime;
|
|
422
|
+
}
|
|
423
|
+
get idCompressorMode() {
|
|
424
|
+
return this.documentSchema.idCompressorMode;
|
|
425
|
+
}
|
|
379
426
|
/**
|
|
380
427
|
* See IContainerRuntimeBase.idCompressor() for details.
|
|
381
428
|
*/
|
|
@@ -456,7 +503,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
456
503
|
return this.garbageCollector.throwOnTombstoneUsage;
|
|
457
504
|
}
|
|
458
505
|
/***/
|
|
459
|
-
constructor(context, registry, metadata, electedSummarizerData, chunks, dataStoreAliasMap, runtimeOptions, containerScope, logger, existing, blobManagerSnapshot, _storage, createIdCompressor,
|
|
506
|
+
constructor(context, registry, metadata, electedSummarizerData, chunks, dataStoreAliasMap, runtimeOptions, containerScope, logger, existing, blobManagerSnapshot, _storage, createIdCompressor, documentsSchemaController, featureGatesForTelemetry, provideEntryPoint, requestHandler, summaryConfiguration = {
|
|
460
507
|
// the defaults
|
|
461
508
|
...DefaultSummaryConfiguration,
|
|
462
509
|
// the runtime configuration overrides
|
|
@@ -470,18 +517,13 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
470
517
|
this.logger = logger;
|
|
471
518
|
this._storage = _storage;
|
|
472
519
|
this.createIdCompressor = createIdCompressor;
|
|
473
|
-
this.
|
|
520
|
+
this.documentsSchemaController = documentsSchemaController;
|
|
474
521
|
this.requestHandler = requestHandler;
|
|
475
522
|
this.summaryConfiguration = summaryConfiguration;
|
|
476
523
|
this.imminentClosure = false;
|
|
477
524
|
// We accumulate Id compressor Ops while Id compressor is not loaded yet (only for "delayed" mode)
|
|
478
525
|
// Once it loads, it will process all such ops and we will stop accumulating further ops - ops will be processes as they come in.
|
|
479
526
|
this.pendingIdCompressorOps = [];
|
|
480
|
-
/**
|
|
481
|
-
* True if we have ID compressor loading in-flight (async operation). Useful only for
|
|
482
|
-
* this.idCompressorMode === "delayed" mode
|
|
483
|
-
*/
|
|
484
|
-
this.compressorLoadInitiated = false;
|
|
485
527
|
this.defaultMaxConsecutiveReconnects = 7;
|
|
486
528
|
this._orderSequentiallyCalls = 0;
|
|
487
529
|
this.flushTaskExists = false;
|
|
@@ -511,6 +553,20 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
511
553
|
expiry: { policy: "absolute", durationMs: 60000 },
|
|
512
554
|
});
|
|
513
555
|
const { options, clientDetails, connected, baseSnapshot, submitFn, submitBatchFn, submitSummaryFn, submitSignalFn, disposeFn, closeFn, deltaManager, quorum, audience, loader, pendingLocalState, supportedFeatures, } = context;
|
|
556
|
+
this.mc = createChildMonitoringContext({
|
|
557
|
+
logger: this.logger,
|
|
558
|
+
namespace: "ContainerRuntime",
|
|
559
|
+
});
|
|
560
|
+
// If we support multiple algorithms in the future, then we would need to manage it here carefully.
|
|
561
|
+
// We can use runtimeOptions.compressionOptions.compressionAlgorithm, but only if it's in the schema list!
|
|
562
|
+
// If it's not in the list, then we will need to either use no compression, or fallback to some other (supported by format)
|
|
563
|
+
// compression.
|
|
564
|
+
const compressionOptions = {
|
|
565
|
+
minimumBatchSizeInBytes: this.documentSchema.compressionLz4
|
|
566
|
+
? runtimeOptions.compressionOptions.minimumBatchSizeInBytes
|
|
567
|
+
: Number.POSITIVE_INFINITY,
|
|
568
|
+
compressionAlgorithm: CompressionAlgorithms.lz4,
|
|
569
|
+
};
|
|
514
570
|
this.innerDeltaManager = deltaManager;
|
|
515
571
|
this.deltaManager = new DeltaManagerSummarizerProxy(this.innerDeltaManager);
|
|
516
572
|
// Here we could wrap/intercept on these functions to block/modify outgoing messages if needed.
|
|
@@ -544,10 +600,6 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
544
600
|
this.disposeFn = disposeFn ?? closeFn;
|
|
545
601
|
// In cases of summarizer, we want to dispose instead since consumer doesn't interact with this container
|
|
546
602
|
this.closeFn = this.isSummarizerClient ? this.disposeFn : closeFn;
|
|
547
|
-
this.mc = createChildMonitoringContext({
|
|
548
|
-
logger: this.logger,
|
|
549
|
-
namespace: "ContainerRuntime",
|
|
550
|
-
});
|
|
551
603
|
let loadSummaryNumber;
|
|
552
604
|
// Get the container creation metadata. For new container, we initialize these. For existing containers,
|
|
553
605
|
// get the values from the metadata blob.
|
|
@@ -568,7 +620,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
568
620
|
loadSummaryNumber = 0;
|
|
569
621
|
}
|
|
570
622
|
this.nextSummaryNumber = loadSummaryNumber + 1;
|
|
571
|
-
this.messageAtLastSummary = metadata
|
|
623
|
+
this.messageAtLastSummary = lastMessageFromMetadata(metadata);
|
|
572
624
|
// Note that we only need to pull the *initial* connected state from the context.
|
|
573
625
|
// Later updates come through calls to setConnectionState.
|
|
574
626
|
this._connected = connected;
|
|
@@ -671,14 +723,24 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
671
723
|
return this.submitSignalFn(envelope2, targetClientId);
|
|
672
724
|
};
|
|
673
725
|
this.channelCollection = new ChannelCollection(getSummaryForDatastores(baseSnapshot, metadata), parentContext, this.mc.logger, (path, reason, timestampMs, packagePath, request, headerData) => this.garbageCollector.nodeUpdated(path, reason, timestampMs, packagePath, request, headerData), (path) => this.garbageCollector.isNodeDeleted(path), new Map(dataStoreAliasMap), async (runtime) => provideEntryPoint);
|
|
674
|
-
this.blobManager = new BlobManager(
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
726
|
+
this.blobManager = new BlobManager({
|
|
727
|
+
routeContext: this.handleContext,
|
|
728
|
+
snapshot: blobManagerSnapshot,
|
|
729
|
+
getStorage: () => this.storage,
|
|
730
|
+
sendBlobAttachOp: (localId, blobId) => {
|
|
731
|
+
if (!this.disposed) {
|
|
732
|
+
this.submit({ type: ContainerMessageType.BlobAttach, contents: undefined }, undefined, {
|
|
733
|
+
localId,
|
|
734
|
+
blobId,
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
},
|
|
738
|
+
blobRequested: (blobPath) => this.garbageCollector.nodeUpdated(blobPath, "Loaded"),
|
|
739
|
+
isBlobDeleted: (blobPath) => this.garbageCollector.isNodeDeleted(blobPath),
|
|
740
|
+
runtime: this,
|
|
741
|
+
stashedBlobs: pendingRuntimeState?.pendingAttachmentBlobs,
|
|
742
|
+
closeContainer: (error) => this.closeFn(error),
|
|
743
|
+
});
|
|
682
744
|
this.scheduleManager = new ScheduleManager(this.innerDeltaManager, this, () => this.clientId, createChildLogger({ logger: this.logger, namespace: "ScheduleManager" }));
|
|
683
745
|
this.pendingStateManager = new PendingStateManager({
|
|
684
746
|
applyStashedOp: this.applyStashedOp.bind(this),
|
|
@@ -693,13 +755,6 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
693
755
|
isActiveConnection: () => this.innerDeltaManager.active,
|
|
694
756
|
isAttached: () => this.attachState !== AttachState.Detached,
|
|
695
757
|
}, pendingRuntimeState?.pending, this.logger);
|
|
696
|
-
const disableCompression = this.mc.config.getBoolean("Fluid.ContainerRuntime.CompressionDisabled");
|
|
697
|
-
const compressionOptions = disableCompression === true
|
|
698
|
-
? {
|
|
699
|
-
minimumBatchSizeInBytes: Number.POSITIVE_INFINITY,
|
|
700
|
-
compressionAlgorithm: CompressionAlgorithms.lz4,
|
|
701
|
-
}
|
|
702
|
-
: runtimeOptions.compressionOptions;
|
|
703
758
|
const disablePartialFlush = this.mc.config.getBoolean("Fluid.ContainerRuntime.DisablePartialFlush");
|
|
704
759
|
const legacySendBatchFn = makeLegacySendBatchFn(this.submitFn, this.innerDeltaManager);
|
|
705
760
|
this.outbox = new Outbox({
|
|
@@ -804,10 +859,10 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
804
859
|
disableIsolatedChannels: metadata?.disableIsolatedChannels,
|
|
805
860
|
gcVersion: metadata?.gcFeature,
|
|
806
861
|
options: JSON.stringify(runtimeOptions),
|
|
807
|
-
idCompressorModeMetadata: metadata?.idCompressorMode,
|
|
862
|
+
idCompressorModeMetadata: metadata?.documentSchema?.runtime?.idCompressorMode,
|
|
808
863
|
idCompressorMode: this.idCompressorMode,
|
|
809
864
|
featureGates: JSON.stringify({
|
|
810
|
-
|
|
865
|
+
...featureGatesForTelemetry,
|
|
811
866
|
disableOpReentryCheck,
|
|
812
867
|
disableChunking,
|
|
813
868
|
disableAttachReorder: this.disableAttachReorder,
|
|
@@ -830,6 +885,20 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
830
885
|
// saved state, i.e. all the ops marked by Loader layer sa savedOp === true.
|
|
831
886
|
this.skipSavedCompressorOps = pendingRuntimeState?.pendingIdCompressorState !== undefined;
|
|
832
887
|
}
|
|
888
|
+
onSchemaChange(schema) {
|
|
889
|
+
// Most of the settings will be picked up only by new sessions (i.e. after reload).
|
|
890
|
+
// We can make it better in the future (i.e. start to use op compression right away), but for simplicity
|
|
891
|
+
// this is not done.
|
|
892
|
+
// But ID compressor is special. It's possible, that in future, we will remove "stickiness" of ID compressor setting
|
|
893
|
+
// and will allow to start using it. If that were to happen, we want to ensure that we do not break eventual consistency
|
|
894
|
+
// promises. To do so, we need to initialize id compressor right away.
|
|
895
|
+
// As it's implemented right now (with async initialization), this will only work for "off" -> "delayed" transitions.
|
|
896
|
+
// Anything else is too risky, and requires ability to initialize ID compressor synchronously!
|
|
897
|
+
if (schema.runtime.idCompressorMode !== undefined) {
|
|
898
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
899
|
+
this.loadIdCompressor();
|
|
900
|
+
}
|
|
901
|
+
}
|
|
833
902
|
getCreateChildSummarizerNodeFn(id, createParam) {
|
|
834
903
|
return (summarizeInternal, getGCDataFn) => this.summarizerNode.createChild(summarizeInternal, id, createParam, undefined, getGCDataFn);
|
|
835
904
|
}
|
|
@@ -1047,18 +1116,30 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1047
1116
|
}
|
|
1048
1117
|
/** Adds the container's metadata to the given summary tree. */
|
|
1049
1118
|
addMetadataToSummary(summaryTree) {
|
|
1119
|
+
// The last message processed at the time of summary. If there are no new messages, use the message from the
|
|
1120
|
+
// last summary.
|
|
1121
|
+
const message = extractSummaryMetadataMessage(this.deltaManager.lastMessage) ??
|
|
1122
|
+
this.messageAtLastSummary;
|
|
1123
|
+
const documentSchema = this.documentsSchemaController.summarizeDocumentSchema(this.deltaManager.lastSequenceNumber);
|
|
1124
|
+
// Is document schema explicit control on?
|
|
1125
|
+
const explitiSchemaControl = documentSchema?.runtime.explicitSchemaControl;
|
|
1050
1126
|
const metadata = {
|
|
1051
1127
|
...this.createContainerMetadata,
|
|
1052
1128
|
// Increment the summary number for the next summary that will be generated.
|
|
1053
1129
|
summaryNumber: this.nextSummaryNumber++,
|
|
1054
1130
|
summaryFormatVersion: 1,
|
|
1055
1131
|
...this.garbageCollector.getMetadata(),
|
|
1056
|
-
// The last message processed at the time of summary. If there are no new messages, use the message from the
|
|
1057
|
-
// last summary.
|
|
1058
|
-
message: extractSummaryMetadataMessage(this.deltaManager.lastMessage) ??
|
|
1059
|
-
this.messageAtLastSummary,
|
|
1060
1132
|
telemetryDocumentId: this.telemetryDocumentId,
|
|
1061
|
-
|
|
1133
|
+
// If explicit document schema control is not on, use legacy way to supply last message (using 'message' property).
|
|
1134
|
+
// Otherwise use new 'lastMessage' property, but also put content into the 'message' property that cases old
|
|
1135
|
+
// runtimes (that preceed document schema control capabilities) to close container on load due to mismatch in
|
|
1136
|
+
// last message's sequence number.
|
|
1137
|
+
// See also lastMessageFromMetadata()
|
|
1138
|
+
message: explitiSchemaControl
|
|
1139
|
+
? { sequenceNumber: -1 }
|
|
1140
|
+
: message,
|
|
1141
|
+
lastMessage: explitiSchemaControl ? message : undefined,
|
|
1142
|
+
documentSchema,
|
|
1062
1143
|
};
|
|
1063
1144
|
addBlobToSummary(summaryTree, metadataBlobName, JSON.stringify(metadata));
|
|
1064
1145
|
}
|
|
@@ -1169,7 +1250,18 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1169
1250
|
case ContainerMessageType.Alias:
|
|
1170
1251
|
return this.channelCollection.applyStashedOp(opContents);
|
|
1171
1252
|
case ContainerMessageType.IdAllocation:
|
|
1172
|
-
|
|
1253
|
+
// IDs allocation ops in stashed state are ignored because the tip state of the compressor
|
|
1254
|
+
// is serialized into the pending state. This is done because generation of new IDs during
|
|
1255
|
+
// stashed op application (or, later, resubmit) must generate new IDs and if the compressor
|
|
1256
|
+
// was loaded from a state serialized at the same time as the summary tree in the stashed state
|
|
1257
|
+
// then it would generate IDs that collide with any in later stashed ops.
|
|
1258
|
+
// In the future, IdCompressor could be extended to have an "applyStashedOp" or similar method
|
|
1259
|
+
// and the runtime could filter out all ID allocation ops from the stashed state and apply them
|
|
1260
|
+
// before applying the rest of the stashed ops. This would accomplish the same thing but with
|
|
1261
|
+
// better performance in future incremental stashed state creation.
|
|
1262
|
+
assert(this.idCompressorMode !== undefined, 0x8f1 /* ID compressor should be in use */);
|
|
1263
|
+
return;
|
|
1264
|
+
case ContainerMessageType.DocumentSchemaChange:
|
|
1173
1265
|
return;
|
|
1174
1266
|
case ContainerMessageType.BlobAttach:
|
|
1175
1267
|
return;
|
|
@@ -1200,12 +1292,14 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1200
1292
|
}
|
|
1201
1293
|
}
|
|
1202
1294
|
}
|
|
1203
|
-
|
|
1204
|
-
if (
|
|
1205
|
-
this.
|
|
1206
|
-
this.
|
|
1295
|
+
async loadIdCompressor() {
|
|
1296
|
+
if (this._idCompressor === undefined &&
|
|
1297
|
+
this.idCompressorMode !== undefined &&
|
|
1298
|
+
this._loadIdCompressor === undefined) {
|
|
1299
|
+
this._loadIdCompressor = this.createIdCompressor()
|
|
1207
1300
|
.then((compressor) => {
|
|
1208
1301
|
this._idCompressor = compressor;
|
|
1302
|
+
// Finalize any ranges we received while the compressor was turned off.
|
|
1209
1303
|
for (const range of this.pendingIdCompressorOps) {
|
|
1210
1304
|
this._idCompressor.finalizeCreationRange(range);
|
|
1211
1305
|
}
|
|
@@ -1213,8 +1307,16 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1213
1307
|
})
|
|
1214
1308
|
.catch((error) => {
|
|
1215
1309
|
this.logger.sendErrorEvent({ eventName: "IdCompressorDelayedLoad" }, error);
|
|
1310
|
+
throw error;
|
|
1216
1311
|
});
|
|
1217
1312
|
}
|
|
1313
|
+
return this._loadIdCompressor;
|
|
1314
|
+
}
|
|
1315
|
+
setConnectionState(connected, clientId) {
|
|
1316
|
+
if (connected && this.idCompressorMode === "delayed") {
|
|
1317
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
1318
|
+
this.loadIdCompressor();
|
|
1319
|
+
}
|
|
1218
1320
|
if (connected === false && this.delayConnectClientId !== undefined) {
|
|
1219
1321
|
this.delayConnectClientId = undefined;
|
|
1220
1322
|
this.mc.logger.sendTelemetryEvent({
|
|
@@ -1223,21 +1325,17 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1223
1325
|
// Don't propagate "disconnected" event because we didn't propagate the previous "connected" event
|
|
1224
1326
|
return;
|
|
1225
1327
|
}
|
|
1328
|
+
if (!connected) {
|
|
1329
|
+
this.documentsSchemaController.onDisconnect();
|
|
1330
|
+
}
|
|
1226
1331
|
// If there are stashed blobs in the pending state, we need to delay
|
|
1227
1332
|
// propagation of the "connected" event until we have uploaded them to
|
|
1228
1333
|
// ensure we don't submit ops referencing a blob that has not been uploaded
|
|
1229
1334
|
const connecting = connected && !this._connected;
|
|
1230
|
-
if (connecting && this.blobManager.
|
|
1335
|
+
if (connecting && this.blobManager.hasPendingStashedUploads()) {
|
|
1231
1336
|
assert(!this.delayConnectClientId, 0x791 /* Connect event delay must be canceled before subsequent connect event */);
|
|
1232
1337
|
assert(!!clientId, 0x792 /* Must have clientId when connecting */);
|
|
1233
1338
|
this.delayConnectClientId = clientId;
|
|
1234
|
-
this.blobManager.processStashedChanges().then(() => {
|
|
1235
|
-
// make sure we didn't reconnect before the promise resolved
|
|
1236
|
-
if (this.delayConnectClientId === clientId && !this.disposed) {
|
|
1237
|
-
this.delayConnectClientId = undefined;
|
|
1238
|
-
this.setConnectionStateCore(connected, clientId);
|
|
1239
|
-
}
|
|
1240
|
-
}, (error) => this.closeFn(error));
|
|
1241
1339
|
return;
|
|
1242
1340
|
}
|
|
1243
1341
|
this.setConnectionStateCore(connected, clientId);
|
|
@@ -1380,6 +1478,8 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1380
1478
|
messageWithContext.message.metadata?.savedOp ===
|
|
1381
1479
|
true)) {
|
|
1382
1480
|
const range = messageWithContext.message.contents;
|
|
1481
|
+
// Some other client turned on the id compressor. If we have not turned it on,
|
|
1482
|
+
// put it in a pending queue and delay finalization.
|
|
1383
1483
|
if (this._idCompressor === undefined) {
|
|
1384
1484
|
this.pendingIdCompressorOps.push(range);
|
|
1385
1485
|
}
|
|
@@ -1397,6 +1497,9 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1397
1497
|
assert(false, "should not even get here");
|
|
1398
1498
|
case ContainerMessageType.Rejoin:
|
|
1399
1499
|
break;
|
|
1500
|
+
case ContainerMessageType.DocumentSchemaChange:
|
|
1501
|
+
this.documentsSchemaController.processDocumentSchemaOp(messageWithContext.message.contents, messageWithContext.local, messageWithContext.message.sequenceNumber);
|
|
1502
|
+
break;
|
|
1400
1503
|
default: {
|
|
1401
1504
|
// If we didn't necessarily expect a runtime message type, then no worries - just return
|
|
1402
1505
|
// e.g. this case applies to system ops, or legacy ops that would have fallen into the above cases anyway.
|
|
@@ -1627,6 +1730,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1627
1730
|
break;
|
|
1628
1731
|
}
|
|
1629
1732
|
case ContainerMessageType.IdAllocation:
|
|
1733
|
+
case ContainerMessageType.DocumentSchemaChange:
|
|
1630
1734
|
case ContainerMessageType.GC: {
|
|
1631
1735
|
return false;
|
|
1632
1736
|
}
|
|
@@ -1653,7 +1757,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1653
1757
|
/**
|
|
1654
1758
|
* Submits the signal to be sent to other clients.
|
|
1655
1759
|
* @param type - Type of the signal.
|
|
1656
|
-
* @param content - Content of the signal.
|
|
1760
|
+
* @param content - Content of the signal. Should be a JSON serializable object or primitive.
|
|
1657
1761
|
* @param targetClientId - When specified, the signal is only sent to the provided client id.
|
|
1658
1762
|
*/
|
|
1659
1763
|
submitSignal(type, content, targetClientId) {
|
|
@@ -1689,6 +1793,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1689
1793
|
// We can finalize any allocated IDs since we're the only client
|
|
1690
1794
|
const idRange = this._idCompressor?.takeNextCreationRange();
|
|
1691
1795
|
if (idRange !== undefined) {
|
|
1796
|
+
assert(idRange.ids === undefined || idRange.ids.firstGenCount === 1, "No other ranges should be taken while container is detached.");
|
|
1692
1797
|
this._idCompressor?.finalizeCreationRange(idRange);
|
|
1693
1798
|
}
|
|
1694
1799
|
const summarizeResult = this.channelCollection.getAttachSummary(telemetryContext);
|
|
@@ -1702,6 +1807,8 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1702
1807
|
// Wrap data store summaries in .channels subtree.
|
|
1703
1808
|
wrapSummaryInChannelsTree(summarizeResult);
|
|
1704
1809
|
const pathPartsForChildren = [channelsTreeName];
|
|
1810
|
+
// Ensure that ID compressor had a chance to load, if we are using delayed mode.
|
|
1811
|
+
await this.loadIdCompressor();
|
|
1705
1812
|
this.addContainerStateToSummary(summarizeResult, fullTree, trackState, telemetryContext);
|
|
1706
1813
|
return {
|
|
1707
1814
|
...summarizeResult,
|
|
@@ -2244,19 +2351,18 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2244
2351
|
const idAllocationBatchMessage = {
|
|
2245
2352
|
contents: JSON.stringify(idAllocationMessage),
|
|
2246
2353
|
referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
|
|
2247
|
-
metadata: undefined,
|
|
2248
|
-
localOpMetadata: undefined,
|
|
2249
|
-
type: ContainerMessageType.IdAllocation,
|
|
2250
2354
|
};
|
|
2251
2355
|
this.outbox.submitIdAllocation(idAllocationBatchMessage);
|
|
2252
2356
|
}
|
|
2253
2357
|
}
|
|
2254
2358
|
}
|
|
2255
|
-
submit(containerRuntimeMessage, localOpMetadata = undefined, metadata
|
|
2359
|
+
submit(containerRuntimeMessage, localOpMetadata = undefined, metadata) {
|
|
2256
2360
|
this.verifyNotClosed();
|
|
2257
2361
|
this.verifyCanSubmitOps();
|
|
2258
2362
|
// There should be no ops in detached container state!
|
|
2259
2363
|
assert(this.attachState !== AttachState.Detached, 0x132 /* "sending ops in detached container" */);
|
|
2364
|
+
assert(metadata === undefined ||
|
|
2365
|
+
containerRuntimeMessage.type === ContainerMessageType.BlobAttach, "metadata");
|
|
2260
2366
|
const serializedContent = JSON.stringify(containerRuntimeMessage);
|
|
2261
2367
|
// Note that the real (non-proxy) delta manager is used here to get the readonly info. This is because
|
|
2262
2368
|
// container runtime's ability to submit ops depend on the actual readonly state of the delta manager.
|
|
@@ -2269,7 +2375,6 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2269
2375
|
const type = containerRuntimeMessage.type;
|
|
2270
2376
|
const message = {
|
|
2271
2377
|
contents: serializedContent,
|
|
2272
|
-
type,
|
|
2273
2378
|
metadata,
|
|
2274
2379
|
localOpMetadata,
|
|
2275
2380
|
referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
|
|
@@ -2284,6 +2389,20 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2284
2389
|
}
|
|
2285
2390
|
else {
|
|
2286
2391
|
this.submitIdAllocationOpIfNeeded();
|
|
2392
|
+
// Allow document schema controller to send a message if it needs to propose change in document schema.
|
|
2393
|
+
// If it needs to send a message, it will call provided callback with payload of such message and rely
|
|
2394
|
+
// on this callback to do actual sending.
|
|
2395
|
+
const contents = this.documentsSchemaController.maybeSendSchemaMessage();
|
|
2396
|
+
if (contents) {
|
|
2397
|
+
const msg = {
|
|
2398
|
+
type: ContainerMessageType.DocumentSchemaChange,
|
|
2399
|
+
contents,
|
|
2400
|
+
};
|
|
2401
|
+
this.outbox.submit({
|
|
2402
|
+
contents: JSON.stringify(msg),
|
|
2403
|
+
referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
|
|
2404
|
+
});
|
|
2405
|
+
}
|
|
2287
2406
|
// If this is attach message for new data store, and we are in a batch, send this op out of order
|
|
2288
2407
|
// Is it safe:
|
|
2289
2408
|
// Yes, this should be safe reordering. Newly created data stores are not visible through API surface.
|
|
@@ -2455,6 +2574,11 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2455
2574
|
case ContainerMessageType.GC:
|
|
2456
2575
|
this.submit(message);
|
|
2457
2576
|
break;
|
|
2577
|
+
case ContainerMessageType.DocumentSchemaChange:
|
|
2578
|
+
// There is no need to resend this message. Document schema controller will properly resend it again (if needed)
|
|
2579
|
+
// on a first occasion (any ops sent after reconnect). There is a good chance, though, that it will not want to
|
|
2580
|
+
// send any ops, as some other client already changed schema.
|
|
2581
|
+
break;
|
|
2458
2582
|
default: {
|
|
2459
2583
|
// This case should be very rare - it would imply an op was stashed from a
|
|
2460
2584
|
// future version of runtime code and now is being applied on an older version.
|
|
@@ -2657,8 +2781,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2657
2781
|
}
|
|
2658
2782
|
}
|
|
2659
2783
|
get groupedBatchingEnabled() {
|
|
2660
|
-
|
|
2661
|
-
return killSwitch !== true && this.runtimeOptions.enableGroupedBatching;
|
|
2784
|
+
return this.documentSchema.opGroupingEnabled === true;
|
|
2662
2785
|
}
|
|
2663
2786
|
}
|
|
2664
2787
|
//# sourceMappingURL=containerRuntime.js.map
|