@fluidframework/container-runtime 2.0.0-rc.2.0.1 → 2.0.0-rc.3.0.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/CHANGELOG.md +23 -0
- package/api-report/container-runtime.api.md +471 -52
- 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 -30
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +82 -107
- package/dist/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +27 -22
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +189 -165
- 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/containerHandleContext.d.ts.map +1 -1
- package/dist/containerHandleContext.js +2 -2
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +42 -39
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +425 -292
- 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 +8 -8
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +58 -19
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +171 -114
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +1 -0
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +12 -11
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +5 -1
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js +4 -4
- 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 +23 -23
- 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 -5
- 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 +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +91 -0
- 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 +30 -29
- 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 -32
- 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/public.d.ts +12 -0
- package/dist/scheduleManager.d.ts +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +28 -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 +390 -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 +12 -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/internal.d.ts +11 -0
- package/legacy.d.ts +11 -0
- 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 -30
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +48 -73
- package/lib/blobManager.js.map +1 -1
- package/lib/channelCollection.d.ts +27 -22
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +132 -108
- 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/containerHandleContext.d.ts.map +1 -1
- package/lib/containerHandleContext.js +1 -1
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +42 -39
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +276 -141
- 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 +3 -3
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +58 -19
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +110 -53
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts +1 -0
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +3 -2
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts +5 -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 +8 -8
- 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 -5
- 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 +5 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -2
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +91 -0
- 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 +19 -18
- 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 -32
- 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/public.d.ts +12 -0
- package/lib/scheduleManager.d.ts +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +7 -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 +386 -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 +7 -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/package.json +57 -65
- package/src/batchTracker.ts +4 -3
- package/src/blobManager.ts +100 -77
- package/src/channelCollection.ts +223 -167
- package/src/connectionTelemetry.ts +12 -12
- package/src/containerHandleContext.ts +3 -2
- package/src/containerRuntime.ts +481 -277
- package/src/dataStore.ts +9 -4
- package/src/dataStoreContext.ts +201 -97
- package/src/dataStoreContexts.ts +5 -2
- package/src/dataStoreRegistry.ts +3 -2
- package/src/deltaManagerSummarizerProxy.ts +1 -1
- package/src/deltaScheduler.ts +2 -1
- package/src/error.ts +2 -2
- package/src/gc/garbageCollection.ts +21 -20
- package/src/gc/gcConfigs.ts +15 -18
- package/src/gc/gcDefinitions.ts +6 -8
- 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 +22 -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 +90 -100
- package/src/opLifecycle/opGroupingManager.ts +12 -14
- package/src/opLifecycle/opSplitter.ts +76 -48
- package/src/opLifecycle/outbox.ts +30 -38
- package/src/opLifecycle/remoteMessageProcessor.ts +43 -55
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +6 -6
- package/src/scheduleManager.ts +10 -8
- package/src/storageServiceWithAttachBlobs.ts +2 -2
- package/src/summary/documentSchema.ts +631 -0
- package/src/summary/index.ts +10 -1
- package/src/summary/orderedClientElection.ts +7 -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/api-extractor-cjs.json +0 -8
- package/dist/container-runtime-alpha.d.ts +0 -1753
- package/dist/container-runtime-beta.d.ts +0 -268
- package/dist/container-runtime-public.d.ts +0 -268
- package/dist/container-runtime-untrimmed.d.ts +0 -1893
- package/lib/container-runtime-alpha.d.ts +0 -1753
- package/lib/container-runtime-beta.d.ts +0 -268
- package/lib/container-runtime-public.d.ts +0 -268
- package/lib/container-runtime-untrimmed.d.ts +0 -1893
- 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 -141
- 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 -801
- package/lib/test/dataStoreContext.spec.js.map +0 -1
- package/lib/test/dataStoreCreation.spec.js +0 -312
- 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 -1465
- package/lib/test/gc/garbageCollection.spec.js.map +0 -1
- package/lib/test/gc/gcConfigs.spec.js +0 -690
- 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 -391
- 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/{dist → lib}/tsdoc-metadata.json +0 -0
package/src/containerRuntime.ts
CHANGED
|
@@ -2,60 +2,57 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
|
|
6
|
+
import { Trace, TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
5
7
|
import {
|
|
6
|
-
|
|
7
|
-
FluidObject,
|
|
8
|
-
IFluidHandle,
|
|
9
|
-
IFluidHandleContext,
|
|
10
|
-
IRequest,
|
|
11
|
-
IResponse,
|
|
12
|
-
IProvideFluidHandleContext,
|
|
13
|
-
ISignalEnvelope,
|
|
14
|
-
} from "@fluidframework/core-interfaces";
|
|
15
|
-
import {
|
|
8
|
+
AttachState,
|
|
16
9
|
IAudience,
|
|
10
|
+
ICriticalContainerError,
|
|
11
|
+
IDeltaManager,
|
|
12
|
+
} from "@fluidframework/container-definitions";
|
|
13
|
+
import {
|
|
17
14
|
IBatchMessage,
|
|
18
15
|
IContainerContext,
|
|
19
|
-
|
|
20
|
-
IRuntime,
|
|
21
|
-
ICriticalContainerError,
|
|
22
|
-
AttachState,
|
|
16
|
+
IGetPendingLocalStateProps,
|
|
23
17
|
ILoader,
|
|
18
|
+
IRuntime,
|
|
24
19
|
LoaderHeader,
|
|
25
|
-
|
|
26
|
-
} from "@fluidframework/container-definitions";
|
|
20
|
+
} from "@fluidframework/container-definitions/internal";
|
|
27
21
|
import {
|
|
28
22
|
IContainerRuntime,
|
|
29
23
|
IContainerRuntimeEvents,
|
|
30
|
-
} from "@fluidframework/container-runtime-definitions";
|
|
31
|
-
import { assert, Deferred, delay, LazyPromise, PromiseCache } from "@fluidframework/core-utils";
|
|
32
|
-
import { Trace, TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
24
|
+
} from "@fluidframework/container-runtime-definitions/internal";
|
|
33
25
|
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
loggerToMonitoringContext,
|
|
51
|
-
} from "@fluidframework/telemetry-utils";
|
|
26
|
+
FluidObject,
|
|
27
|
+
IFluidHandle,
|
|
28
|
+
IFluidHandleContext,
|
|
29
|
+
IProvideFluidHandleContext,
|
|
30
|
+
IRequest,
|
|
31
|
+
IResponse,
|
|
32
|
+
ITelemetryBaseLogger,
|
|
33
|
+
} from "@fluidframework/core-interfaces";
|
|
34
|
+
import { ISignalEnvelope } from "@fluidframework/core-interfaces/internal";
|
|
35
|
+
import {
|
|
36
|
+
assert,
|
|
37
|
+
Deferred,
|
|
38
|
+
LazyPromise,
|
|
39
|
+
PromiseCache,
|
|
40
|
+
delay,
|
|
41
|
+
} from "@fluidframework/core-utils/internal";
|
|
52
42
|
import {
|
|
53
43
|
DriverHeader,
|
|
54
44
|
FetchSource,
|
|
55
45
|
IDocumentStorageService,
|
|
56
46
|
type ISnapshot,
|
|
57
|
-
} from "@fluidframework/driver-definitions";
|
|
58
|
-
import { readAndParse } from "@fluidframework/driver-utils";
|
|
47
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
48
|
+
import { readAndParse } from "@fluidframework/driver-utils/internal";
|
|
49
|
+
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
50
|
+
import type {
|
|
51
|
+
IIdCompressorCore,
|
|
52
|
+
IdCreationRange,
|
|
53
|
+
SerializedIdCompressorWithNoSession,
|
|
54
|
+
SerializedIdCompressorWithOngoingSession,
|
|
55
|
+
} from "@fluidframework/id-compressor/internal";
|
|
59
56
|
import {
|
|
60
57
|
IClientDetails,
|
|
61
58
|
IDocumentMessage,
|
|
@@ -69,134 +66,155 @@ import {
|
|
|
69
66
|
SummaryType,
|
|
70
67
|
} from "@fluidframework/protocol-definitions";
|
|
71
68
|
import {
|
|
69
|
+
IGarbageCollectionData,
|
|
70
|
+
IInboundSignalMessage,
|
|
71
|
+
ISummaryTreeWithStats,
|
|
72
|
+
ITelemetryContext,
|
|
73
|
+
} from "@fluidframework/runtime-definitions";
|
|
74
|
+
import {
|
|
75
|
+
CreateChildSummarizerNodeParam,
|
|
72
76
|
FlushMode,
|
|
73
77
|
FlushModeExperimental,
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
IDataStore,
|
|
79
|
+
IEnvelope,
|
|
76
80
|
IFluidDataStoreContextDetached,
|
|
77
81
|
IFluidDataStoreRegistry,
|
|
78
|
-
IGarbageCollectionData,
|
|
79
|
-
IInboundSignalMessage,
|
|
80
|
-
NamedFluidDataStoreRegistryEntries,
|
|
81
|
-
ISummaryTreeWithStats,
|
|
82
82
|
ISummarizeInternalResult,
|
|
83
|
-
|
|
83
|
+
InboundAttachMessage,
|
|
84
|
+
NamedFluidDataStoreRegistryEntries,
|
|
84
85
|
SummarizeInternalFn,
|
|
85
86
|
channelsTreeName,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
IEnvelope,
|
|
89
|
-
} from "@fluidframework/runtime-definitions";
|
|
90
|
-
import type {
|
|
91
|
-
SerializedIdCompressorWithNoSession,
|
|
92
|
-
IIdCompressor,
|
|
93
|
-
IIdCompressorCore,
|
|
94
|
-
SerializedIdCompressorWithOngoingSession,
|
|
95
|
-
IdCreationRange,
|
|
96
|
-
} from "@fluidframework/id-compressor";
|
|
87
|
+
gcTreeKey,
|
|
88
|
+
} from "@fluidframework/runtime-definitions/internal";
|
|
97
89
|
import {
|
|
90
|
+
GCDataBuilder,
|
|
91
|
+
ReadAndParseBlob,
|
|
92
|
+
RequestParser,
|
|
93
|
+
TelemetryContext,
|
|
98
94
|
addBlobToSummary,
|
|
99
95
|
addSummarizeResultToSummary,
|
|
100
|
-
|
|
96
|
+
calculateStats,
|
|
101
97
|
create404Response,
|
|
102
98
|
exceptionToResponse,
|
|
103
|
-
GCDataBuilder,
|
|
104
|
-
seqFromTree,
|
|
105
|
-
calculateStats,
|
|
106
|
-
TelemetryContext,
|
|
107
|
-
ReadAndParseBlob,
|
|
108
99
|
responseToException,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
import { ContainerFluidHandleContext } from "./containerHandleContext.js";
|
|
112
|
-
import { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
113
|
-
import { ReportOpPerfTelemetry, IPerfSignalReport } from "./connectionTelemetry.js";
|
|
100
|
+
seqFromTree,
|
|
101
|
+
} from "@fluidframework/runtime-utils/internal";
|
|
114
102
|
import {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
103
|
+
type ITelemetryGenericEventExt,
|
|
104
|
+
ITelemetryLoggerExt,
|
|
105
|
+
} from "@fluidframework/telemetry-utils";
|
|
106
|
+
import {
|
|
107
|
+
DataCorruptionError,
|
|
108
|
+
DataProcessingError,
|
|
109
|
+
GenericError,
|
|
110
|
+
IEventSampler,
|
|
111
|
+
LoggingError,
|
|
112
|
+
MonitoringContext,
|
|
113
|
+
PerformanceEvent,
|
|
114
|
+
// eslint-disable-next-line import/no-deprecated
|
|
115
|
+
TaggedLoggerAdapter,
|
|
116
|
+
UsageError,
|
|
117
|
+
createChildLogger,
|
|
118
|
+
createChildMonitoringContext,
|
|
119
|
+
createSampledLogger,
|
|
120
|
+
loggerToMonitoringContext,
|
|
121
|
+
raiseConnectedEvent,
|
|
122
|
+
wrapError,
|
|
123
|
+
} from "@fluidframework/telemetry-utils/internal";
|
|
124
|
+
import { v4 as uuid } from "uuid";
|
|
125
|
+
|
|
126
|
+
import { BindBatchTracker } from "./batchTracker.js";
|
|
120
127
|
import { BlobManager, IBlobManagerLoadInfo, IPendingBlobs } from "./blobManager.js";
|
|
121
128
|
import { ChannelCollection, getSummaryForDatastores, wrapContext } from "./channelCollection.js";
|
|
129
|
+
import { IPerfSignalReport, ReportOpPerfTelemetry } from "./connectionTelemetry.js";
|
|
130
|
+
import { ContainerFluidHandleContext } from "./containerHandleContext.js";
|
|
131
|
+
import { channelToDataStore } from "./dataStore.js";
|
|
132
|
+
import { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
133
|
+
import { DeltaManagerSummarizerProxy } from "./deltaManagerSummarizerProxy.js";
|
|
122
134
|
import {
|
|
123
|
-
aliasBlobName,
|
|
124
|
-
blobsTreeName,
|
|
125
|
-
chunksBlobName,
|
|
126
|
-
createRootSummarizerNodeWithGC,
|
|
127
|
-
electedSummarizerBlobName,
|
|
128
|
-
extractSummaryMetadataMessage,
|
|
129
|
-
IContainerRuntimeMetadata,
|
|
130
|
-
ICreateContainerMetadata,
|
|
131
|
-
idCompressorBlobName,
|
|
132
|
-
IRootSummarizerNodeWithGC,
|
|
133
|
-
ISummaryMetadataMessage,
|
|
134
|
-
metadataBlobName,
|
|
135
|
-
Summarizer,
|
|
136
|
-
SummaryManager,
|
|
137
|
-
wrapSummaryInChannelsTree,
|
|
138
|
-
SummaryCollection,
|
|
139
|
-
ISerializedElection,
|
|
140
|
-
OrderedClientCollection,
|
|
141
|
-
OrderedClientElection,
|
|
142
|
-
SummarizerClientElection,
|
|
143
|
-
summarizerClientType,
|
|
144
|
-
SubmitSummaryResult,
|
|
145
|
-
IConnectableRuntime,
|
|
146
|
-
IGeneratedSummaryStats,
|
|
147
|
-
ISubmitSummaryOptions,
|
|
148
|
-
ISummarizerInternalsProvider,
|
|
149
|
-
ISummarizerRuntime,
|
|
150
|
-
IRefreshSummaryAckOptions,
|
|
151
|
-
RunWhileConnectedCoordinator,
|
|
152
|
-
IGenerateSummaryTreeResult,
|
|
153
|
-
RetriableSummaryError,
|
|
154
|
-
IOnDemandSummarizeOptions,
|
|
155
|
-
ISummarizeResults,
|
|
156
|
-
IEnqueueSummarizeOptions,
|
|
157
|
-
EnqueueSummarizeResult,
|
|
158
|
-
ISummarizerEvents,
|
|
159
|
-
IBaseSummarizeResult,
|
|
160
|
-
ISummarizer,
|
|
161
|
-
rootHasIsolatedChannels,
|
|
162
|
-
IdCompressorMode,
|
|
163
|
-
} from "./summary/index.js";
|
|
164
|
-
import { formExponentialFn, Throttler } from "./throttler.js";
|
|
165
|
-
import {
|
|
166
|
-
GarbageCollector,
|
|
167
135
|
GCNodeType,
|
|
168
|
-
|
|
169
|
-
IGarbageCollector,
|
|
136
|
+
GarbageCollector,
|
|
170
137
|
IGCRuntimeOptions,
|
|
171
138
|
IGCStats,
|
|
139
|
+
IGarbageCollector,
|
|
140
|
+
gcGenerationOptionName,
|
|
172
141
|
} from "./gc/index.js";
|
|
173
|
-
import {
|
|
174
|
-
|
|
175
|
-
|
|
142
|
+
import {
|
|
143
|
+
ContainerMessageType,
|
|
144
|
+
type ContainerRuntimeDocumentSchemaMessage,
|
|
145
|
+
ContainerRuntimeGCMessage,
|
|
146
|
+
type ContainerRuntimeIdAllocationMessage,
|
|
147
|
+
type InboundSequencedContainerRuntimeMessage,
|
|
148
|
+
type InboundSequencedContainerRuntimeMessageOrSystemMessage,
|
|
149
|
+
type LocalContainerRuntimeMessage,
|
|
150
|
+
type OutboundContainerRuntimeMessage,
|
|
151
|
+
type UnknownContainerRuntimeMessage,
|
|
152
|
+
} from "./messageTypes.js";
|
|
153
|
+
import { IBatchMetadata, IIdAllocationMetadata } from "./metadata.js";
|
|
176
154
|
import {
|
|
177
155
|
BatchMessage,
|
|
178
156
|
IBatch,
|
|
179
157
|
IBatchCheckpoint,
|
|
180
158
|
OpCompressor,
|
|
181
159
|
OpDecompressor,
|
|
182
|
-
|
|
160
|
+
OpGroupingManager,
|
|
183
161
|
OpSplitter,
|
|
162
|
+
Outbox,
|
|
184
163
|
RemoteMessageProcessor,
|
|
185
|
-
OpGroupingManager,
|
|
186
164
|
getLongStack,
|
|
187
165
|
} from "./opLifecycle/index.js";
|
|
188
|
-
import {
|
|
189
|
-
import { IBatchMetadata, IIdAllocationMetadata } from "./metadata.js";
|
|
166
|
+
import { pkgVersion } from "./packageVersion.js";
|
|
190
167
|
import {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
168
|
+
IPendingBatchMessage,
|
|
169
|
+
IPendingLocalState,
|
|
170
|
+
PendingStateManager,
|
|
171
|
+
} from "./pendingStateManager.js";
|
|
172
|
+
import { ScheduleManager } from "./scheduleManager.js";
|
|
173
|
+
import {
|
|
174
|
+
DocumentsSchemaController,
|
|
175
|
+
EnqueueSummarizeResult,
|
|
176
|
+
IBaseSummarizeResult,
|
|
177
|
+
IConnectableRuntime,
|
|
178
|
+
IContainerRuntimeMetadata,
|
|
179
|
+
ICreateContainerMetadata,
|
|
180
|
+
type IDocumentSchemaCurrent,
|
|
181
|
+
IEnqueueSummarizeOptions,
|
|
182
|
+
IGenerateSummaryTreeResult,
|
|
183
|
+
IGeneratedSummaryStats,
|
|
184
|
+
IOnDemandSummarizeOptions,
|
|
185
|
+
IRefreshSummaryAckOptions,
|
|
186
|
+
IRootSummarizerNodeWithGC,
|
|
187
|
+
ISerializedElection,
|
|
188
|
+
ISubmitSummaryOptions,
|
|
189
|
+
ISummarizeResults,
|
|
190
|
+
ISummarizer,
|
|
191
|
+
ISummarizerEvents,
|
|
192
|
+
ISummarizerInternalsProvider,
|
|
193
|
+
ISummarizerRuntime,
|
|
194
|
+
ISummaryMetadataMessage,
|
|
195
|
+
IdCompressorMode,
|
|
196
|
+
OrderedClientCollection,
|
|
197
|
+
OrderedClientElection,
|
|
198
|
+
RetriableSummaryError,
|
|
199
|
+
RunWhileConnectedCoordinator,
|
|
200
|
+
SubmitSummaryResult,
|
|
201
|
+
Summarizer,
|
|
202
|
+
SummarizerClientElection,
|
|
203
|
+
SummaryCollection,
|
|
204
|
+
SummaryManager,
|
|
205
|
+
aliasBlobName,
|
|
206
|
+
blobsTreeName,
|
|
207
|
+
chunksBlobName,
|
|
208
|
+
createRootSummarizerNodeWithGC,
|
|
209
|
+
electedSummarizerBlobName,
|
|
210
|
+
extractSummaryMetadataMessage,
|
|
211
|
+
idCompressorBlobName,
|
|
212
|
+
metadataBlobName,
|
|
213
|
+
rootHasIsolatedChannels,
|
|
214
|
+
summarizerClientType,
|
|
215
|
+
wrapSummaryInChannelsTree,
|
|
216
|
+
} from "./summary/index.js";
|
|
217
|
+
import { Throttler, formExponentialFn } from "./throttler.js";
|
|
200
218
|
|
|
201
219
|
/**
|
|
202
220
|
* Utility to implement compat behaviors given an unknown message type
|
|
@@ -415,7 +433,7 @@ export interface IContainerRuntimeOptions {
|
|
|
415
433
|
* If specified, when in FlushMode.TurnBased, if the size of the ops between JS turns exceeds this value,
|
|
416
434
|
* an error will be thrown and the container will close.
|
|
417
435
|
*
|
|
418
|
-
* If unspecified, the limit is
|
|
436
|
+
* If unspecified, the limit is 700Kb.
|
|
419
437
|
*
|
|
420
438
|
* 'Infinity' will disable any limit.
|
|
421
439
|
*
|
|
@@ -464,6 +482,15 @@ export interface IContainerRuntimeOptions {
|
|
|
464
482
|
* @experimental Not ready for use.
|
|
465
483
|
*/
|
|
466
484
|
readonly enableGroupedBatching?: boolean;
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* When this property is set to true, it requires runtime to control is document schema properly through ops
|
|
488
|
+
* The benefit of this mode is that clients who do not understand schema will fail in predictable way, with predictable message,
|
|
489
|
+
* and will not attempt to limp along, which could cause data corruptions and crashes in random places.
|
|
490
|
+
* When this property is not set (or set to false), runtime operates in legacy mode, where new features (modifying document schema)
|
|
491
|
+
* are engaged as they become available, without giving legacy clients any chance to fail predictably.
|
|
492
|
+
*/
|
|
493
|
+
readonly explicitSchemaControl?: boolean;
|
|
467
494
|
}
|
|
468
495
|
|
|
469
496
|
/**
|
|
@@ -479,6 +506,7 @@ export const InactiveResponseHeaderKey = "isInactive";
|
|
|
479
506
|
|
|
480
507
|
/**
|
|
481
508
|
* The full set of parsed header data that may be found on Runtime requests
|
|
509
|
+
* @internal
|
|
482
510
|
*/
|
|
483
511
|
export interface RuntimeHeaderData {
|
|
484
512
|
wait?: boolean;
|
|
@@ -503,6 +531,12 @@ export enum CompressionAlgorithms {
|
|
|
503
531
|
lz4 = "lz4",
|
|
504
532
|
}
|
|
505
533
|
|
|
534
|
+
/** @alpha */
|
|
535
|
+
export const disabledCompressionConfig: ICompressionRuntimeOptions = {
|
|
536
|
+
minimumBatchSizeInBytes: Infinity,
|
|
537
|
+
compressionAlgorithm: CompressionAlgorithms.lz4,
|
|
538
|
+
};
|
|
539
|
+
|
|
506
540
|
/**
|
|
507
541
|
* @deprecated
|
|
508
542
|
* Untagged logger is unsupported going forward. There are old loaders with old ContainerContexts that only
|
|
@@ -569,26 +603,12 @@ export const defaultPendingOpsRetryDelayMs = 1000;
|
|
|
569
603
|
*/
|
|
570
604
|
const defaultCloseSummarizerDelayMs = 5000; // 5 seconds
|
|
571
605
|
|
|
572
|
-
/**
|
|
573
|
-
* @deprecated use ContainerRuntimeMessageType instead
|
|
574
|
-
* @internal
|
|
575
|
-
*/
|
|
576
|
-
export enum RuntimeMessage {
|
|
577
|
-
FluidDataStoreOp = "component",
|
|
578
|
-
Attach = "attach",
|
|
579
|
-
ChunkedOp = "chunkedOp",
|
|
580
|
-
BlobAttach = "blobAttach",
|
|
581
|
-
Rejoin = "rejoin",
|
|
582
|
-
Alias = "alias",
|
|
583
|
-
Operation = "op",
|
|
584
|
-
}
|
|
585
|
-
|
|
586
606
|
/**
|
|
587
607
|
* @deprecated please use version in driver-utils
|
|
588
608
|
* @internal
|
|
589
609
|
*/
|
|
590
610
|
export function isRuntimeMessage(message: ISequencedDocumentMessage): boolean {
|
|
591
|
-
return (Object.values(
|
|
611
|
+
return (Object.values(ContainerMessageType) as string[]).includes(message.type);
|
|
592
612
|
}
|
|
593
613
|
|
|
594
614
|
/**
|
|
@@ -695,6 +715,18 @@ async function createSummarizer(loader: ILoader, url: string): Promise<ISummariz
|
|
|
695
715
|
return fluidObject.ISummarizer;
|
|
696
716
|
}
|
|
697
717
|
|
|
718
|
+
/**
|
|
719
|
+
* Extract last message from the snapshot metadata.
|
|
720
|
+
* Uses legacy property if not using explicit schema control, otherwise uses the new property.
|
|
721
|
+
* This allows new runtime to make documents not openable for old runtimes, one explicit document schema control is enabled.
|
|
722
|
+
* Please see addMetadataToSummary() as well
|
|
723
|
+
*/
|
|
724
|
+
function lastMessageFromMetadata(metadata: IContainerRuntimeMetadata | undefined) {
|
|
725
|
+
return metadata?.documentSchema?.runtime?.explicitSchemaControl
|
|
726
|
+
? metadata?.lastMessage
|
|
727
|
+
: metadata?.message;
|
|
728
|
+
}
|
|
729
|
+
|
|
698
730
|
/**
|
|
699
731
|
* Represents the runtime of the container. Contains helper functions/state of the container.
|
|
700
732
|
* It will define the store level mappings.
|
|
@@ -741,7 +773,7 @@ export class ContainerRuntime
|
|
|
741
773
|
existing,
|
|
742
774
|
requestHandler,
|
|
743
775
|
provideEntryPoint,
|
|
744
|
-
runtimeOptions = {},
|
|
776
|
+
runtimeOptions = {} satisfies IContainerRuntimeOptions,
|
|
745
777
|
containerScope = {},
|
|
746
778
|
containerRuntimeCtor = ContainerRuntime,
|
|
747
779
|
} = params;
|
|
@@ -751,6 +783,7 @@ export class ContainerRuntime
|
|
|
751
783
|
const backCompatContext: IContainerContext | OldContainerContextWithLogger = context;
|
|
752
784
|
const passLogger =
|
|
753
785
|
backCompatContext.taggedLogger ??
|
|
786
|
+
// eslint-disable-next-line import/no-deprecated
|
|
754
787
|
new TaggedLoggerAdapter((backCompatContext as OldContainerContextWithLogger).logger);
|
|
755
788
|
const logger = createChildLogger({
|
|
756
789
|
logger: passLogger,
|
|
@@ -770,10 +803,11 @@ export class ContainerRuntime
|
|
|
770
803
|
flushMode = defaultFlushMode,
|
|
771
804
|
compressionOptions = defaultCompressionConfig,
|
|
772
805
|
maxBatchSizeInBytes = defaultMaxBatchSizeInBytes,
|
|
773
|
-
enableRuntimeIdCompressor
|
|
806
|
+
enableRuntimeIdCompressor,
|
|
774
807
|
chunkSizeInBytes = defaultChunkSizeInBytes,
|
|
775
808
|
enableOpReentryCheck = false,
|
|
776
809
|
enableGroupedBatching = false,
|
|
810
|
+
explicitSchemaControl = false,
|
|
777
811
|
} = runtimeOptions;
|
|
778
812
|
|
|
779
813
|
const registry = new FluidDataStoreRegistry(registryEntries);
|
|
@@ -814,8 +848,10 @@ export class ContainerRuntime
|
|
|
814
848
|
},
|
|
815
849
|
);
|
|
816
850
|
|
|
851
|
+
const messageAtLastSummary = lastMessageFromMetadata(metadata);
|
|
852
|
+
|
|
817
853
|
// Verify summary runtime sequence number matches protocol sequence number.
|
|
818
|
-
const runtimeSequenceNumber =
|
|
854
|
+
const runtimeSequenceNumber = messageAtLastSummary?.sequenceNumber;
|
|
819
855
|
// When we load with pending state, we reuse an old snapshot so we don't expect these numbers to match
|
|
820
856
|
if (!context.pendingLocalState && runtimeSequenceNumber !== undefined) {
|
|
821
857
|
const protocolSequenceNumber = context.deltaManager.initialSequenceNumber;
|
|
@@ -824,6 +860,13 @@ export class ContainerRuntime
|
|
|
824
860
|
loadSequenceNumberVerification !== "bypass" &&
|
|
825
861
|
runtimeSequenceNumber !== protocolSequenceNumber
|
|
826
862
|
) {
|
|
863
|
+
// Message to OCEs:
|
|
864
|
+
// You can hit this error with runtimeSequenceNumber === -1 in < 2.0 RC3 builds.
|
|
865
|
+
// This would indicate that explicit schema control is enabled in current (2.0 RC3+) builds and it
|
|
866
|
+
// results in addMetadataToSummary() creating a poison pill for older runtimes in the form of a -1 sequence number.
|
|
867
|
+
// Older runtimes do not understand new schema, and thus could corrupt document if they proceed, thus we are using
|
|
868
|
+
// this poison pill to prevent them from proceeding.
|
|
869
|
+
|
|
827
870
|
// "Load from summary, runtime metadata sequenceNumber !== initialSequenceNumber"
|
|
828
871
|
const error = new DataCorruptionError(
|
|
829
872
|
// pre-0.58 error message: SummaryMetadataMismatch
|
|
@@ -839,8 +882,21 @@ export class ContainerRuntime
|
|
|
839
882
|
}
|
|
840
883
|
}
|
|
841
884
|
|
|
885
|
+
let desiredIdCompressorMode: IdCompressorMode;
|
|
886
|
+
switch (mc.config.getBoolean("Fluid.ContainerRuntime.IdCompressorEnabled")) {
|
|
887
|
+
case true:
|
|
888
|
+
desiredIdCompressorMode = "on";
|
|
889
|
+
break;
|
|
890
|
+
case false:
|
|
891
|
+
desiredIdCompressorMode = undefined;
|
|
892
|
+
break;
|
|
893
|
+
default:
|
|
894
|
+
desiredIdCompressorMode = enableRuntimeIdCompressor;
|
|
895
|
+
break;
|
|
896
|
+
}
|
|
897
|
+
|
|
842
898
|
// Enabling the IdCompressor is a one-way operation and we only want to
|
|
843
|
-
// allow new containers to turn it on
|
|
899
|
+
// allow new containers to turn it on.
|
|
844
900
|
let idCompressorMode: IdCompressorMode;
|
|
845
901
|
if (existing) {
|
|
846
902
|
// This setting has to be sticky for correctness:
|
|
@@ -849,29 +905,34 @@ export class ContainerRuntime
|
|
|
849
905
|
// 2) if it's ON, then all sessions should load compressor right away
|
|
850
906
|
// 3) Same logic applies for "delayed" mode
|
|
851
907
|
// Maybe in the future we will need to enabled (and figure how to do it safely) "delayed" -> "on" change.
|
|
852
|
-
// We could do "off" -> "on"
|
|
853
|
-
// this will allow clients to eventually
|
|
908
|
+
// We could do "off" -> "on" transition too, if all clients start loading compressor (but not using it initially) and
|
|
909
|
+
// do so for a while - this will allow clients to eventually disregard "off" setting (when it's safe so) and start
|
|
910
|
+
// using compressor in future sessions.
|
|
854
911
|
// Everyting is possible, but it needs to be designed and executed carefully, when such need arises.
|
|
855
|
-
idCompressorMode = metadata?.
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
912
|
+
idCompressorMode = metadata?.documentSchema?.runtime
|
|
913
|
+
?.idCompressorMode as IdCompressorMode;
|
|
914
|
+
|
|
915
|
+
// This is the only exception to the rule above - we have proper plumbing to load ID compressor on schema change
|
|
916
|
+
// event. It is loaded async (relative to op processing), so this conversion is only safe for off -> delayed conversion!
|
|
917
|
+
// Clients do not expect ID compressor ops unless ID compressor is On for them, and that could be achieved only through
|
|
918
|
+
// explicit schema change, i.e. only if explicitSchemaControl is on.
|
|
919
|
+
// Note: it would be better if we throw on combination of options (explicitSchemaControl = off, desiredIdCompressorMode === "delayed")
|
|
920
|
+
// that is not supported. But our service tests are oblivious to these problems and throwing here will cause a ton of failures
|
|
921
|
+
// We ignored incompatible ID compressor changes from the start (they were sticky), so that's not a new problem being introduced...
|
|
922
|
+
if (
|
|
923
|
+
idCompressorMode === undefined &&
|
|
924
|
+
desiredIdCompressorMode === "delayed" &&
|
|
925
|
+
explicitSchemaControl
|
|
926
|
+
) {
|
|
927
|
+
idCompressorMode = desiredIdCompressorMode;
|
|
869
928
|
}
|
|
929
|
+
} else {
|
|
930
|
+
idCompressorMode = desiredIdCompressorMode;
|
|
870
931
|
}
|
|
871
932
|
|
|
872
933
|
const createIdCompressorFn = async () => {
|
|
873
934
|
const { createIdCompressor, deserializeIdCompressor, createSessionId } = await import(
|
|
874
|
-
"@fluidframework/id-compressor"
|
|
935
|
+
"@fluidframework/id-compressor/internal"
|
|
875
936
|
);
|
|
876
937
|
|
|
877
938
|
/**
|
|
@@ -906,6 +967,39 @@ export class ContainerRuntime
|
|
|
906
967
|
}
|
|
907
968
|
};
|
|
908
969
|
|
|
970
|
+
const disableGroupedBatching = mc.config.getBoolean(
|
|
971
|
+
"Fluid.ContainerRuntime.DisableGroupedBatching",
|
|
972
|
+
);
|
|
973
|
+
const disableCompression = mc.config.getBoolean(
|
|
974
|
+
"Fluid.ContainerRuntime.CompressionDisabled",
|
|
975
|
+
);
|
|
976
|
+
const compressionLz4 =
|
|
977
|
+
disableCompression !== true &&
|
|
978
|
+
compressionOptions.minimumBatchSizeInBytes !== Infinity &&
|
|
979
|
+
compressionOptions.compressionAlgorithm === "lz4";
|
|
980
|
+
|
|
981
|
+
const opGroupingEnabled = disableGroupedBatching !== true && enableGroupedBatching;
|
|
982
|
+
|
|
983
|
+
const documentSchemaController = new DocumentsSchemaController(
|
|
984
|
+
existing,
|
|
985
|
+
metadata?.documentSchema,
|
|
986
|
+
{
|
|
987
|
+
explicitSchemaControl,
|
|
988
|
+
compressionLz4,
|
|
989
|
+
idCompressorMode,
|
|
990
|
+
opGroupingEnabled,
|
|
991
|
+
disallowedVersions: [],
|
|
992
|
+
},
|
|
993
|
+
(schema) => {
|
|
994
|
+
runtime.onSchemaChange(schema);
|
|
995
|
+
},
|
|
996
|
+
);
|
|
997
|
+
|
|
998
|
+
const featureGatesForTelemetry: Record<string, boolean | number | undefined> = {
|
|
999
|
+
disableGroupedBatching,
|
|
1000
|
+
disableCompression,
|
|
1001
|
+
};
|
|
1002
|
+
|
|
909
1003
|
const runtime = new containerRuntimeCtor(
|
|
910
1004
|
context,
|
|
911
1005
|
registry,
|
|
@@ -921,9 +1015,11 @@ export class ContainerRuntime
|
|
|
921
1015
|
compressionOptions,
|
|
922
1016
|
maxBatchSizeInBytes,
|
|
923
1017
|
chunkSizeInBytes,
|
|
924
|
-
|
|
1018
|
+
// Requires<> drops undefined from IdCompressorType
|
|
1019
|
+
enableRuntimeIdCompressor: enableRuntimeIdCompressor as "on" | "delayed",
|
|
925
1020
|
enableOpReentryCheck,
|
|
926
1021
|
enableGroupedBatching,
|
|
1022
|
+
explicitSchemaControl,
|
|
927
1023
|
},
|
|
928
1024
|
containerScope,
|
|
929
1025
|
logger,
|
|
@@ -931,12 +1027,24 @@ export class ContainerRuntime
|
|
|
931
1027
|
blobManagerSnapshot,
|
|
932
1028
|
context.storage,
|
|
933
1029
|
createIdCompressorFn,
|
|
934
|
-
|
|
1030
|
+
documentSchemaController,
|
|
1031
|
+
featureGatesForTelemetry,
|
|
935
1032
|
provideEntryPoint,
|
|
936
1033
|
requestHandler,
|
|
937
1034
|
undefined, // summaryConfiguration
|
|
938
1035
|
);
|
|
939
1036
|
|
|
1037
|
+
runtime.blobManager.trackPendingStashedUploads().then(
|
|
1038
|
+
() => {
|
|
1039
|
+
// make sure we didn't reconnect before the promise resolved
|
|
1040
|
+
if (runtime.delayConnectClientId !== undefined && !runtime.disposed) {
|
|
1041
|
+
runtime.delayConnectClientId = undefined;
|
|
1042
|
+
runtime.setConnectionStateCore(true, runtime.delayConnectClientId);
|
|
1043
|
+
}
|
|
1044
|
+
},
|
|
1045
|
+
(error) => runtime.closeFn(error),
|
|
1046
|
+
);
|
|
1047
|
+
|
|
940
1048
|
// Apply stashed ops with a reference sequence number equal to the sequence number of the snapshot,
|
|
941
1049
|
// or zero. This must be done before Container replays saved ops.
|
|
942
1050
|
await runtime.pendingStateManager.applyStashedOpsAt(runtimeSequenceNumber ?? 0);
|
|
@@ -981,7 +1089,7 @@ export class ContainerRuntime
|
|
|
981
1089
|
summaryOp: ISummaryContent,
|
|
982
1090
|
referenceSequenceNumber?: number,
|
|
983
1091
|
) => number;
|
|
984
|
-
private readonly submitSignalFn: (content:
|
|
1092
|
+
private readonly submitSignalFn: (content: ISignalEnvelope, targetClientId?: string) => void;
|
|
985
1093
|
public readonly disposeFn: (error?: ICriticalContainerError) => void;
|
|
986
1094
|
public readonly closeFn: (error?: ICriticalContainerError) => void;
|
|
987
1095
|
|
|
@@ -1002,6 +1110,10 @@ export class ContainerRuntime
|
|
|
1002
1110
|
return this._getAttachState();
|
|
1003
1111
|
}
|
|
1004
1112
|
|
|
1113
|
+
public get documentSchema() {
|
|
1114
|
+
return this.documentsSchemaController.sessionSchema.runtime;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1005
1117
|
private _idCompressor: (IIdCompressor & IIdCompressorCore) | undefined;
|
|
1006
1118
|
|
|
1007
1119
|
// We accumulate Id compressor Ops while Id compressor is not loaded yet (only for "delayed" mode)
|
|
@@ -1014,6 +1126,9 @@ export class ContainerRuntime
|
|
|
1014
1126
|
// In such case we have to process all ops, including those marked with saveOp === true.
|
|
1015
1127
|
private readonly skipSavedCompressorOps: boolean;
|
|
1016
1128
|
|
|
1129
|
+
public get idCompressorMode() {
|
|
1130
|
+
return this.documentSchema.idCompressorMode;
|
|
1131
|
+
}
|
|
1017
1132
|
/**
|
|
1018
1133
|
* See IContainerRuntimeBase.idCompressor() for details.
|
|
1019
1134
|
*/
|
|
@@ -1035,7 +1150,7 @@ export class ContainerRuntime
|
|
|
1035
1150
|
* True if we have ID compressor loading in-flight (async operation). Useful only for
|
|
1036
1151
|
* this.idCompressorMode === "delayed" mode
|
|
1037
1152
|
*/
|
|
1038
|
-
protected
|
|
1153
|
+
protected _loadIdCompressor: Promise<void> | undefined;
|
|
1039
1154
|
|
|
1040
1155
|
/**
|
|
1041
1156
|
* See IContainerRuntimeBase.generateDocumentUniqueId() for details.
|
|
@@ -1257,7 +1372,8 @@ export class ContainerRuntime
|
|
|
1257
1372
|
blobManagerSnapshot: IBlobManagerLoadInfo,
|
|
1258
1373
|
private readonly _storage: IDocumentStorageService,
|
|
1259
1374
|
private readonly createIdCompressor: () => Promise<IIdCompressor & IIdCompressorCore>,
|
|
1260
|
-
private readonly
|
|
1375
|
+
private readonly documentsSchemaController: DocumentsSchemaController,
|
|
1376
|
+
featureGatesForTelemetry: Record<string, boolean | number | undefined>,
|
|
1261
1377
|
provideEntryPoint: (containerRuntime: IContainerRuntime) => Promise<FluidObject>,
|
|
1262
1378
|
private readonly requestHandler?: (
|
|
1263
1379
|
request: IRequest,
|
|
@@ -1291,6 +1407,22 @@ export class ContainerRuntime
|
|
|
1291
1407
|
supportedFeatures,
|
|
1292
1408
|
} = context;
|
|
1293
1409
|
|
|
1410
|
+
this.mc = createChildMonitoringContext({
|
|
1411
|
+
logger: this.logger,
|
|
1412
|
+
namespace: "ContainerRuntime",
|
|
1413
|
+
});
|
|
1414
|
+
|
|
1415
|
+
// If we support multiple algorithms in the future, then we would need to manage it here carefully.
|
|
1416
|
+
// We can use runtimeOptions.compressionOptions.compressionAlgorithm, but only if it's in the schema list!
|
|
1417
|
+
// If it's not in the list, then we will need to either use no compression, or fallback to some other (supported by format)
|
|
1418
|
+
// compression.
|
|
1419
|
+
const compressionOptions: ICompressionRuntimeOptions = {
|
|
1420
|
+
minimumBatchSizeInBytes: this.documentSchema.compressionLz4
|
|
1421
|
+
? runtimeOptions.compressionOptions.minimumBatchSizeInBytes
|
|
1422
|
+
: Number.POSITIVE_INFINITY,
|
|
1423
|
+
compressionAlgorithm: CompressionAlgorithms.lz4,
|
|
1424
|
+
};
|
|
1425
|
+
|
|
1294
1426
|
this.innerDeltaManager = deltaManager;
|
|
1295
1427
|
this.deltaManager = new DeltaManagerSummarizerProxy(this.innerDeltaManager);
|
|
1296
1428
|
|
|
@@ -1328,11 +1460,6 @@ export class ContainerRuntime
|
|
|
1328
1460
|
// In cases of summarizer, we want to dispose instead since consumer doesn't interact with this container
|
|
1329
1461
|
this.closeFn = this.isSummarizerClient ? this.disposeFn : closeFn;
|
|
1330
1462
|
|
|
1331
|
-
this.mc = createChildMonitoringContext({
|
|
1332
|
-
logger: this.logger,
|
|
1333
|
-
namespace: "ContainerRuntime",
|
|
1334
|
-
});
|
|
1335
|
-
|
|
1336
1463
|
let loadSummaryNumber: number;
|
|
1337
1464
|
// Get the container creation metadata. For new container, we initialize these. For existing containers,
|
|
1338
1465
|
// get the values from the metadata blob.
|
|
@@ -1353,7 +1480,7 @@ export class ContainerRuntime
|
|
|
1353
1480
|
}
|
|
1354
1481
|
this.nextSummaryNumber = loadSummaryNumber + 1;
|
|
1355
1482
|
|
|
1356
|
-
this.messageAtLastSummary = metadata
|
|
1483
|
+
this.messageAtLastSummary = lastMessageFromMetadata(metadata);
|
|
1357
1484
|
|
|
1358
1485
|
// Note that we only need to pull the *initial* connected state from the context.
|
|
1359
1486
|
// Later updates come through calls to setConnectionState.
|
|
@@ -1498,7 +1625,7 @@ export class ContainerRuntime
|
|
|
1498
1625
|
// Due to a mismatch between different layers in terms of
|
|
1499
1626
|
// what is the interface of passing signals, we need the
|
|
1500
1627
|
// downstream stores to wrap the signal.
|
|
1501
|
-
parentContext.submitSignal = (type: string, content:
|
|
1628
|
+
parentContext.submitSignal = (type: string, content: unknown, targetClientId?: string) => {
|
|
1502
1629
|
const envelope1 = content as IEnvelope;
|
|
1503
1630
|
const envelope2 = this.createNewSignalEnvelope(
|
|
1504
1631
|
envelope1.address,
|
|
@@ -1533,11 +1660,11 @@ export class ContainerRuntime
|
|
|
1533
1660
|
async (runtime: ChannelCollection) => provideEntryPoint,
|
|
1534
1661
|
);
|
|
1535
1662
|
|
|
1536
|
-
this.blobManager = new BlobManager(
|
|
1537
|
-
this.handleContext,
|
|
1538
|
-
blobManagerSnapshot,
|
|
1539
|
-
() => this.storage,
|
|
1540
|
-
(localId: string, blobId?: string) => {
|
|
1663
|
+
this.blobManager = new BlobManager({
|
|
1664
|
+
routeContext: this.handleContext,
|
|
1665
|
+
snapshot: blobManagerSnapshot,
|
|
1666
|
+
getStorage: () => this.storage,
|
|
1667
|
+
sendBlobAttachOp: (localId: string, blobId?: string) => {
|
|
1541
1668
|
if (!this.disposed) {
|
|
1542
1669
|
this.submit(
|
|
1543
1670
|
{ type: ContainerMessageType.BlobAttach, contents: undefined },
|
|
@@ -1549,12 +1676,13 @@ export class ContainerRuntime
|
|
|
1549
1676
|
);
|
|
1550
1677
|
}
|
|
1551
1678
|
},
|
|
1552
|
-
(blobPath: string) =>
|
|
1553
|
-
|
|
1554
|
-
this,
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1679
|
+
blobRequested: (blobPath: string) =>
|
|
1680
|
+
this.garbageCollector.nodeUpdated(blobPath, "Loaded"),
|
|
1681
|
+
isBlobDeleted: (blobPath: string) => this.garbageCollector.isNodeDeleted(blobPath),
|
|
1682
|
+
runtime: this,
|
|
1683
|
+
stashedBlobs: pendingRuntimeState?.pendingAttachmentBlobs,
|
|
1684
|
+
closeContainer: (error?: ICriticalContainerError) => this.closeFn(error),
|
|
1685
|
+
});
|
|
1558
1686
|
|
|
1559
1687
|
this.scheduleManager = new ScheduleManager(
|
|
1560
1688
|
this.innerDeltaManager,
|
|
@@ -1569,7 +1697,10 @@ export class ContainerRuntime
|
|
|
1569
1697
|
clientId: () => this.clientId,
|
|
1570
1698
|
close: this.closeFn,
|
|
1571
1699
|
connected: () => this.connected,
|
|
1572
|
-
reSubmit:
|
|
1700
|
+
reSubmit: (message: IPendingBatchMessage) => {
|
|
1701
|
+
this.reSubmit(message);
|
|
1702
|
+
this.flush();
|
|
1703
|
+
},
|
|
1573
1704
|
reSubmitBatch: this.reSubmitBatch.bind(this),
|
|
1574
1705
|
isActiveConnection: () => this.innerDeltaManager.active,
|
|
1575
1706
|
isAttached: () => this.attachState !== AttachState.Detached,
|
|
@@ -1578,17 +1709,6 @@ export class ContainerRuntime
|
|
|
1578
1709
|
this.logger,
|
|
1579
1710
|
);
|
|
1580
1711
|
|
|
1581
|
-
const disableCompression = this.mc.config.getBoolean(
|
|
1582
|
-
"Fluid.ContainerRuntime.CompressionDisabled",
|
|
1583
|
-
);
|
|
1584
|
-
const compressionOptions =
|
|
1585
|
-
disableCompression === true
|
|
1586
|
-
? {
|
|
1587
|
-
minimumBatchSizeInBytes: Number.POSITIVE_INFINITY,
|
|
1588
|
-
compressionAlgorithm: CompressionAlgorithms.lz4,
|
|
1589
|
-
}
|
|
1590
|
-
: runtimeOptions.compressionOptions;
|
|
1591
|
-
|
|
1592
1712
|
const disablePartialFlush = this.mc.config.getBoolean(
|
|
1593
1713
|
"Fluid.ContainerRuntime.DisablePartialFlush",
|
|
1594
1714
|
);
|
|
@@ -1742,10 +1862,10 @@ export class ContainerRuntime
|
|
|
1742
1862
|
disableIsolatedChannels: metadata?.disableIsolatedChannels,
|
|
1743
1863
|
gcVersion: metadata?.gcFeature,
|
|
1744
1864
|
options: JSON.stringify(runtimeOptions),
|
|
1745
|
-
idCompressorModeMetadata: metadata?.idCompressorMode,
|
|
1865
|
+
idCompressorModeMetadata: metadata?.documentSchema?.runtime?.idCompressorMode,
|
|
1746
1866
|
idCompressorMode: this.idCompressorMode,
|
|
1747
1867
|
featureGates: JSON.stringify({
|
|
1748
|
-
|
|
1868
|
+
...featureGatesForTelemetry,
|
|
1749
1869
|
disableOpReentryCheck,
|
|
1750
1870
|
disableChunking,
|
|
1751
1871
|
disableAttachReorder: this.disableAttachReorder,
|
|
@@ -1775,6 +1895,21 @@ export class ContainerRuntime
|
|
|
1775
1895
|
this.skipSavedCompressorOps = pendingRuntimeState?.pendingIdCompressorState !== undefined;
|
|
1776
1896
|
}
|
|
1777
1897
|
|
|
1898
|
+
public onSchemaChange(schema: IDocumentSchemaCurrent) {
|
|
1899
|
+
// Most of the settings will be picked up only by new sessions (i.e. after reload).
|
|
1900
|
+
// We can make it better in the future (i.e. start to use op compression right away), but for simplicity
|
|
1901
|
+
// this is not done.
|
|
1902
|
+
// But ID compressor is special. It's possible, that in future, we will remove "stickiness" of ID compressor setting
|
|
1903
|
+
// and will allow to start using it. If that were to happen, we want to ensure that we do not break eventual consistency
|
|
1904
|
+
// promises. To do so, we need to initialize id compressor right away.
|
|
1905
|
+
// As it's implemented right now (with async initialization), this will only work for "off" -> "delayed" transitions.
|
|
1906
|
+
// Anything else is too risky, and requires ability to initialize ID compressor synchronously!
|
|
1907
|
+
if (schema.runtime.idCompressorMode !== undefined) {
|
|
1908
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
1909
|
+
this.loadIdCompressor();
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1778
1913
|
public getCreateChildSummarizerNodeFn(id: string, createParam: CreateChildSummarizerNodeParam) {
|
|
1779
1914
|
return (
|
|
1780
1915
|
summarizeInternal: SummarizeInternalFn,
|
|
@@ -1793,10 +1928,15 @@ export class ContainerRuntime
|
|
|
1793
1928
|
return this.summarizerNode.deleteChild(id);
|
|
1794
1929
|
}
|
|
1795
1930
|
|
|
1931
|
+
/* IFluidParentContext APIs that should not be called on Root */
|
|
1796
1932
|
public makeLocallyVisible() {
|
|
1797
1933
|
assert(false, 0x8eb /* should not be called */);
|
|
1798
1934
|
}
|
|
1799
1935
|
|
|
1936
|
+
public setChannelDirty(address: string) {
|
|
1937
|
+
assert(false, 0x909 /* should not be called */);
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1800
1940
|
/**
|
|
1801
1941
|
* Initializes the state from the base snapshot this container runtime loaded from.
|
|
1802
1942
|
*/
|
|
@@ -2052,20 +2192,38 @@ export class ContainerRuntime
|
|
|
2052
2192
|
|
|
2053
2193
|
/** Adds the container's metadata to the given summary tree. */
|
|
2054
2194
|
private addMetadataToSummary(summaryTree: ISummaryTreeWithStats) {
|
|
2195
|
+
// The last message processed at the time of summary. If there are no new messages, use the message from the
|
|
2196
|
+
// last summary.
|
|
2197
|
+
const message =
|
|
2198
|
+
extractSummaryMetadataMessage(this.deltaManager.lastMessage) ??
|
|
2199
|
+
this.messageAtLastSummary;
|
|
2200
|
+
|
|
2201
|
+
const documentSchema = this.documentsSchemaController.summarizeDocumentSchema(
|
|
2202
|
+
this.deltaManager.lastSequenceNumber,
|
|
2203
|
+
);
|
|
2204
|
+
|
|
2205
|
+
// Is document schema explicit control on?
|
|
2206
|
+
const explitiSchemaControl = documentSchema?.runtime.explicitSchemaControl;
|
|
2207
|
+
|
|
2055
2208
|
const metadata: IContainerRuntimeMetadata = {
|
|
2056
2209
|
...this.createContainerMetadata,
|
|
2057
2210
|
// Increment the summary number for the next summary that will be generated.
|
|
2058
2211
|
summaryNumber: this.nextSummaryNumber++,
|
|
2059
2212
|
summaryFormatVersion: 1,
|
|
2060
2213
|
...this.garbageCollector.getMetadata(),
|
|
2061
|
-
// The last message processed at the time of summary. If there are no new messages, use the message from the
|
|
2062
|
-
// last summary.
|
|
2063
|
-
message:
|
|
2064
|
-
extractSummaryMetadataMessage(this.deltaManager.lastMessage) ??
|
|
2065
|
-
this.messageAtLastSummary,
|
|
2066
2214
|
telemetryDocumentId: this.telemetryDocumentId,
|
|
2067
|
-
|
|
2215
|
+
// If explicit document schema control is not on, use legacy way to supply last message (using 'message' property).
|
|
2216
|
+
// Otherwise use new 'lastMessage' property, but also put content into the 'message' property that cases old
|
|
2217
|
+
// runtimes (that preceed document schema control capabilities) to close container on load due to mismatch in
|
|
2218
|
+
// last message's sequence number.
|
|
2219
|
+
// See also lastMessageFromMetadata()
|
|
2220
|
+
message: explitiSchemaControl
|
|
2221
|
+
? ({ sequenceNumber: -1 } as any as ISummaryMetadataMessage)
|
|
2222
|
+
: message,
|
|
2223
|
+
lastMessage: explitiSchemaControl ? message : undefined,
|
|
2224
|
+
documentSchema,
|
|
2068
2225
|
};
|
|
2226
|
+
|
|
2069
2227
|
addBlobToSummary(summaryTree, metadataBlobName, JSON.stringify(metadata));
|
|
2070
2228
|
}
|
|
2071
2229
|
|
|
@@ -2144,14 +2302,8 @@ export class ContainerRuntime
|
|
|
2144
2302
|
return this.consecutiveReconnects < this.maxConsecutiveReconnects;
|
|
2145
2303
|
}
|
|
2146
2304
|
|
|
2147
|
-
private resetReconnectCount(
|
|
2148
|
-
|
|
2149
|
-
// in their own batches before the originating batch is sent.
|
|
2150
|
-
// Therefore, receiving them while attempting to send the originating batch
|
|
2151
|
-
// does not mean that the container is making any progress.
|
|
2152
|
-
if (message?.type !== ContainerMessageType.ChunkedOp) {
|
|
2153
|
-
this.consecutiveReconnects = 0;
|
|
2154
|
-
}
|
|
2305
|
+
private resetReconnectCount() {
|
|
2306
|
+
this.consecutiveReconnects = 0;
|
|
2155
2307
|
}
|
|
2156
2308
|
|
|
2157
2309
|
private replayPendingStates() {
|
|
@@ -2207,7 +2359,21 @@ export class ContainerRuntime
|
|
|
2207
2359
|
case ContainerMessageType.Alias:
|
|
2208
2360
|
return this.channelCollection.applyStashedOp(opContents);
|
|
2209
2361
|
case ContainerMessageType.IdAllocation:
|
|
2210
|
-
|
|
2362
|
+
// IDs allocation ops in stashed state are ignored because the tip state of the compressor
|
|
2363
|
+
// is serialized into the pending state. This is done because generation of new IDs during
|
|
2364
|
+
// stashed op application (or, later, resubmit) must generate new IDs and if the compressor
|
|
2365
|
+
// was loaded from a state serialized at the same time as the summary tree in the stashed state
|
|
2366
|
+
// then it would generate IDs that collide with any in later stashed ops.
|
|
2367
|
+
// In the future, IdCompressor could be extended to have an "applyStashedOp" or similar method
|
|
2368
|
+
// and the runtime could filter out all ID allocation ops from the stashed state and apply them
|
|
2369
|
+
// before applying the rest of the stashed ops. This would accomplish the same thing but with
|
|
2370
|
+
// better performance in future incremental stashed state creation.
|
|
2371
|
+
assert(
|
|
2372
|
+
this.idCompressorMode !== undefined,
|
|
2373
|
+
0x8f1 /* ID compressor should be in use */,
|
|
2374
|
+
);
|
|
2375
|
+
return;
|
|
2376
|
+
case ContainerMessageType.DocumentSchemaChange:
|
|
2211
2377
|
return;
|
|
2212
2378
|
case ContainerMessageType.BlobAttach:
|
|
2213
2379
|
return;
|
|
@@ -2244,12 +2410,16 @@ export class ContainerRuntime
|
|
|
2244
2410
|
}
|
|
2245
2411
|
}
|
|
2246
2412
|
|
|
2247
|
-
|
|
2248
|
-
if (
|
|
2249
|
-
this.
|
|
2250
|
-
this.
|
|
2413
|
+
private async loadIdCompressor() {
|
|
2414
|
+
if (
|
|
2415
|
+
this._idCompressor === undefined &&
|
|
2416
|
+
this.idCompressorMode !== undefined &&
|
|
2417
|
+
this._loadIdCompressor === undefined
|
|
2418
|
+
) {
|
|
2419
|
+
this._loadIdCompressor = this.createIdCompressor()
|
|
2251
2420
|
.then((compressor) => {
|
|
2252
2421
|
this._idCompressor = compressor;
|
|
2422
|
+
// Finalize any ranges we received while the compressor was turned off.
|
|
2253
2423
|
for (const range of this.pendingIdCompressorOps) {
|
|
2254
2424
|
this._idCompressor.finalizeCreationRange(range);
|
|
2255
2425
|
}
|
|
@@ -2257,8 +2427,17 @@ export class ContainerRuntime
|
|
|
2257
2427
|
})
|
|
2258
2428
|
.catch((error) => {
|
|
2259
2429
|
this.logger.sendErrorEvent({ eventName: "IdCompressorDelayedLoad" }, error);
|
|
2430
|
+
throw error;
|
|
2260
2431
|
});
|
|
2261
2432
|
}
|
|
2433
|
+
return this._loadIdCompressor;
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2436
|
+
public setConnectionState(connected: boolean, clientId?: string) {
|
|
2437
|
+
if (connected && this.idCompressorMode === "delayed") {
|
|
2438
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
2439
|
+
this.loadIdCompressor();
|
|
2440
|
+
}
|
|
2262
2441
|
if (connected === false && this.delayConnectClientId !== undefined) {
|
|
2263
2442
|
this.delayConnectClientId = undefined;
|
|
2264
2443
|
this.mc.logger.sendTelemetryEvent({
|
|
@@ -2268,27 +2447,21 @@ export class ContainerRuntime
|
|
|
2268
2447
|
return;
|
|
2269
2448
|
}
|
|
2270
2449
|
|
|
2450
|
+
if (!connected) {
|
|
2451
|
+
this.documentsSchemaController.onDisconnect();
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2271
2454
|
// If there are stashed blobs in the pending state, we need to delay
|
|
2272
2455
|
// propagation of the "connected" event until we have uploaded them to
|
|
2273
2456
|
// ensure we don't submit ops referencing a blob that has not been uploaded
|
|
2274
2457
|
const connecting = connected && !this._connected;
|
|
2275
|
-
if (connecting && this.blobManager.
|
|
2458
|
+
if (connecting && this.blobManager.hasPendingStashedUploads()) {
|
|
2276
2459
|
assert(
|
|
2277
2460
|
!this.delayConnectClientId,
|
|
2278
2461
|
0x791 /* Connect event delay must be canceled before subsequent connect event */,
|
|
2279
2462
|
);
|
|
2280
2463
|
assert(!!clientId, 0x792 /* Must have clientId when connecting */);
|
|
2281
2464
|
this.delayConnectClientId = clientId;
|
|
2282
|
-
this.blobManager.processStashedChanges().then(
|
|
2283
|
-
() => {
|
|
2284
|
-
// make sure we didn't reconnect before the promise resolved
|
|
2285
|
-
if (this.delayConnectClientId === clientId && !this.disposed) {
|
|
2286
|
-
this.delayConnectClientId = undefined;
|
|
2287
|
-
this.setConnectionStateCore(connected, clientId);
|
|
2288
|
-
}
|
|
2289
|
-
},
|
|
2290
|
-
(error) => this.closeFn(error),
|
|
2291
|
-
);
|
|
2292
2465
|
return;
|
|
2293
2466
|
}
|
|
2294
2467
|
|
|
@@ -2407,12 +2580,17 @@ export class ContainerRuntime
|
|
|
2407
2580
|
this._processedClientSequenceNumber = message.clientSequenceNumber;
|
|
2408
2581
|
|
|
2409
2582
|
try {
|
|
2583
|
+
// See commit that added this assert for more details.
|
|
2584
|
+
// These calls should be made for all but chunked ops:
|
|
2585
|
+
// 1) this.pendingStateManager.processPendingLocalMessage() below
|
|
2586
|
+
// 2) this.resetReconnectCount() below
|
|
2587
|
+
assert(
|
|
2588
|
+
message.type !== ContainerMessageType.ChunkedOp,
|
|
2589
|
+
0x93b /* we should never get here with chunked ops */,
|
|
2590
|
+
);
|
|
2591
|
+
|
|
2410
2592
|
let localOpMetadata: unknown;
|
|
2411
|
-
if (
|
|
2412
|
-
local &&
|
|
2413
|
-
messageWithContext.modernRuntimeMessage &&
|
|
2414
|
-
message.type !== ContainerMessageType.ChunkedOp
|
|
2415
|
-
) {
|
|
2593
|
+
if (local && messageWithContext.modernRuntimeMessage) {
|
|
2416
2594
|
localOpMetadata = this.pendingStateManager.processPendingLocalMessage(
|
|
2417
2595
|
messageWithContext.message,
|
|
2418
2596
|
);
|
|
@@ -2434,7 +2612,7 @@ export class ContainerRuntime
|
|
|
2434
2612
|
// If we have processed a local op, this means that the container is
|
|
2435
2613
|
// making progress and we can reset the counter for how many times
|
|
2436
2614
|
// we have consecutively replayed the pending states
|
|
2437
|
-
this.resetReconnectCount(
|
|
2615
|
+
this.resetReconnectCount();
|
|
2438
2616
|
}
|
|
2439
2617
|
} catch (e) {
|
|
2440
2618
|
this.scheduleManager.afterOpProcessing(e, message);
|
|
@@ -2479,7 +2657,13 @@ export class ContainerRuntime
|
|
|
2479
2657
|
)
|
|
2480
2658
|
) {
|
|
2481
2659
|
const range = messageWithContext.message.contents;
|
|
2660
|
+
// Some other client turned on the id compressor. If we have not turned it on,
|
|
2661
|
+
// put it in a pending queue and delay finalization.
|
|
2482
2662
|
if (this._idCompressor === undefined) {
|
|
2663
|
+
assert(
|
|
2664
|
+
this.idCompressorMode !== undefined,
|
|
2665
|
+
0x93c /* id compressor should be enabled */,
|
|
2666
|
+
);
|
|
2483
2667
|
this.pendingIdCompressorOps.push(range);
|
|
2484
2668
|
} else {
|
|
2485
2669
|
this._idCompressor.finalizeCreationRange(range);
|
|
@@ -2490,8 +2674,18 @@ export class ContainerRuntime
|
|
|
2490
2674
|
this.garbageCollector.processMessage(messageWithContext.message, local);
|
|
2491
2675
|
break;
|
|
2492
2676
|
case ContainerMessageType.ChunkedOp:
|
|
2677
|
+
// From observability POV, we should not exppse the rest of the system (including "op" events on object) to these messages.
|
|
2678
|
+
// Also resetReconnectCount() would be wrong - see comment that was there before this change was made.
|
|
2679
|
+
assert(false, 0x93d /* should not even get here */);
|
|
2493
2680
|
case ContainerMessageType.Rejoin:
|
|
2494
2681
|
break;
|
|
2682
|
+
case ContainerMessageType.DocumentSchemaChange:
|
|
2683
|
+
this.documentsSchemaController.processDocumentSchemaOp(
|
|
2684
|
+
messageWithContext.message.contents,
|
|
2685
|
+
messageWithContext.local,
|
|
2686
|
+
messageWithContext.message.sequenceNumber,
|
|
2687
|
+
);
|
|
2688
|
+
break;
|
|
2495
2689
|
default: {
|
|
2496
2690
|
// If we didn't necessarily expect a runtime message type, then no worries - just return
|
|
2497
2691
|
// e.g. this case applies to system ops, or legacy ops that would have fallen into the above cases anyway.
|
|
@@ -2720,14 +2914,14 @@ export class ContainerRuntime
|
|
|
2720
2914
|
pkg: Readonly<string[]>,
|
|
2721
2915
|
loadingGroupId?: string,
|
|
2722
2916
|
): IFluidDataStoreContextDetached {
|
|
2723
|
-
return this.channelCollection.
|
|
2917
|
+
return this.channelCollection.createDetachedDataStore(pkg, loadingGroupId);
|
|
2724
2918
|
}
|
|
2725
2919
|
|
|
2726
2920
|
public async createDataStore(
|
|
2727
2921
|
pkg: Readonly<string | string[]>,
|
|
2728
2922
|
loadingGroupId?: string,
|
|
2729
2923
|
): Promise<IDataStore> {
|
|
2730
|
-
const context = this.channelCollection.
|
|
2924
|
+
const context = this.channelCollection.createDataStoreContext(
|
|
2731
2925
|
Array.isArray(pkg) ? pkg : [pkg],
|
|
2732
2926
|
undefined, // props
|
|
2733
2927
|
loadingGroupId,
|
|
@@ -2747,7 +2941,7 @@ export class ContainerRuntime
|
|
|
2747
2941
|
pkg: Readonly<string | string[]>,
|
|
2748
2942
|
props?: any,
|
|
2749
2943
|
): Promise<IDataStore> {
|
|
2750
|
-
const context = this.channelCollection.
|
|
2944
|
+
const context = this.channelCollection.createDataStoreContext(
|
|
2751
2945
|
Array.isArray(pkg) ? pkg : [pkg],
|
|
2752
2946
|
props,
|
|
2753
2947
|
);
|
|
@@ -2810,6 +3004,8 @@ export class ContainerRuntime
|
|
|
2810
3004
|
}
|
|
2811
3005
|
break;
|
|
2812
3006
|
}
|
|
3007
|
+
case ContainerMessageType.IdAllocation:
|
|
3008
|
+
case ContainerMessageType.DocumentSchemaChange:
|
|
2813
3009
|
case ContainerMessageType.GC: {
|
|
2814
3010
|
return false;
|
|
2815
3011
|
}
|
|
@@ -2846,10 +3042,10 @@ export class ContainerRuntime
|
|
|
2846
3042
|
/**
|
|
2847
3043
|
* Submits the signal to be sent to other clients.
|
|
2848
3044
|
* @param type - Type of the signal.
|
|
2849
|
-
* @param content - Content of the signal.
|
|
3045
|
+
* @param content - Content of the signal. Should be a JSON serializable object or primitive.
|
|
2850
3046
|
* @param targetClientId - When specified, the signal is only sent to the provided client id.
|
|
2851
3047
|
*/
|
|
2852
|
-
public submitSignal(type: string, content:
|
|
3048
|
+
public submitSignal(type: string, content: unknown, targetClientId?: string) {
|
|
2853
3049
|
this.verifyNotClosed();
|
|
2854
3050
|
const envelope = this.createNewSignalEnvelope(undefined /* address */, type, content);
|
|
2855
3051
|
return this.submitSignalFn(envelope, targetClientId);
|
|
@@ -2894,6 +3090,10 @@ export class ContainerRuntime
|
|
|
2894
3090
|
// We can finalize any allocated IDs since we're the only client
|
|
2895
3091
|
const idRange = this._idCompressor?.takeNextCreationRange();
|
|
2896
3092
|
if (idRange !== undefined) {
|
|
3093
|
+
assert(
|
|
3094
|
+
idRange.ids === undefined || idRange.ids.firstGenCount === 1,
|
|
3095
|
+
0x93e /* No other ranges should be taken while container is detached. */,
|
|
3096
|
+
);
|
|
2897
3097
|
this._idCompressor?.finalizeCreationRange(idRange);
|
|
2898
3098
|
}
|
|
2899
3099
|
|
|
@@ -2927,6 +3127,9 @@ export class ContainerRuntime
|
|
|
2927
3127
|
wrapSummaryInChannelsTree(summarizeResult);
|
|
2928
3128
|
const pathPartsForChildren = [channelsTreeName];
|
|
2929
3129
|
|
|
3130
|
+
// Ensure that ID compressor had a chance to load, if we are using delayed mode.
|
|
3131
|
+
await this.loadIdCompressor();
|
|
3132
|
+
|
|
2930
3133
|
this.addContainerStateToSummary(summarizeResult, fullTree, trackState, telemetryContext);
|
|
2931
3134
|
return {
|
|
2932
3135
|
...summarizeResult,
|
|
@@ -3045,24 +3248,6 @@ export class ContainerRuntime
|
|
|
3045
3248
|
this.channelCollection.updateUsedRoutes(dataStoreRoutes);
|
|
3046
3249
|
}
|
|
3047
3250
|
|
|
3048
|
-
/**
|
|
3049
|
-
* This is called to update objects whose routes are unused.
|
|
3050
|
-
* @param unusedRoutes - Data store and attachment blob routes that are unused in this Container.
|
|
3051
|
-
*/
|
|
3052
|
-
public updateUnusedRoutes(unusedRoutes: readonly string[]) {
|
|
3053
|
-
const { blobManagerRoutes, dataStoreRoutes } =
|
|
3054
|
-
this.getDataStoreAndBlobManagerRoutes(unusedRoutes);
|
|
3055
|
-
this.blobManager.updateUnusedRoutes(blobManagerRoutes);
|
|
3056
|
-
this.channelCollection.updateUnusedRoutes(dataStoreRoutes);
|
|
3057
|
-
}
|
|
3058
|
-
|
|
3059
|
-
/**
|
|
3060
|
-
* @deprecated Replaced by deleteSweepReadyNodes.
|
|
3061
|
-
*/
|
|
3062
|
-
public deleteUnusedNodes(unusedRoutes: readonly string[]): string[] {
|
|
3063
|
-
throw new Error("deleteUnusedRoutes should not be called");
|
|
3064
|
-
}
|
|
3065
|
-
|
|
3066
3251
|
/**
|
|
3067
3252
|
* After GC has run and identified nodes that are sweep ready, this is called to delete the sweep ready nodes.
|
|
3068
3253
|
* @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.
|
|
@@ -3678,9 +3863,6 @@ export class ContainerRuntime
|
|
|
3678
3863
|
const idAllocationBatchMessage: BatchMessage = {
|
|
3679
3864
|
contents: JSON.stringify(idAllocationMessage),
|
|
3680
3865
|
referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
|
|
3681
|
-
metadata: undefined,
|
|
3682
|
-
localOpMetadata: undefined,
|
|
3683
|
-
type: ContainerMessageType.IdAllocation,
|
|
3684
3866
|
};
|
|
3685
3867
|
this.outbox.submitIdAllocation(idAllocationBatchMessage);
|
|
3686
3868
|
}
|
|
@@ -3690,7 +3872,7 @@ export class ContainerRuntime
|
|
|
3690
3872
|
private submit(
|
|
3691
3873
|
containerRuntimeMessage: OutboundContainerRuntimeMessage,
|
|
3692
3874
|
localOpMetadata: unknown = undefined,
|
|
3693
|
-
metadata:
|
|
3875
|
+
metadata?: { localId: string; blobId?: string },
|
|
3694
3876
|
): void {
|
|
3695
3877
|
this.verifyNotClosed();
|
|
3696
3878
|
this.verifyCanSubmitOps();
|
|
@@ -3701,6 +3883,12 @@ export class ContainerRuntime
|
|
|
3701
3883
|
0x132 /* "sending ops in detached container" */,
|
|
3702
3884
|
);
|
|
3703
3885
|
|
|
3886
|
+
assert(
|
|
3887
|
+
metadata === undefined ||
|
|
3888
|
+
containerRuntimeMessage.type === ContainerMessageType.BlobAttach,
|
|
3889
|
+
0x93f /* metadata */,
|
|
3890
|
+
);
|
|
3891
|
+
|
|
3704
3892
|
const serializedContent = JSON.stringify(containerRuntimeMessage);
|
|
3705
3893
|
|
|
3706
3894
|
// Note that the real (non-proxy) delta manager is used here to get the readonly info. This is because
|
|
@@ -3715,7 +3903,6 @@ export class ContainerRuntime
|
|
|
3715
3903
|
const type = containerRuntimeMessage.type;
|
|
3716
3904
|
const message: BatchMessage = {
|
|
3717
3905
|
contents: serializedContent,
|
|
3718
|
-
type,
|
|
3719
3906
|
metadata,
|
|
3720
3907
|
localOpMetadata,
|
|
3721
3908
|
referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
|
|
@@ -3731,6 +3918,21 @@ export class ContainerRuntime
|
|
|
3731
3918
|
} else {
|
|
3732
3919
|
this.submitIdAllocationOpIfNeeded();
|
|
3733
3920
|
|
|
3921
|
+
// Allow document schema controller to send a message if it needs to propose change in document schema.
|
|
3922
|
+
// If it needs to send a message, it will call provided callback with payload of such message and rely
|
|
3923
|
+
// on this callback to do actual sending.
|
|
3924
|
+
const contents = this.documentsSchemaController.maybeSendSchemaMessage();
|
|
3925
|
+
if (contents) {
|
|
3926
|
+
const msg: ContainerRuntimeDocumentSchemaMessage = {
|
|
3927
|
+
type: ContainerMessageType.DocumentSchemaChange,
|
|
3928
|
+
contents,
|
|
3929
|
+
};
|
|
3930
|
+
this.outbox.submit({
|
|
3931
|
+
contents: JSON.stringify(msg),
|
|
3932
|
+
referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
|
|
3933
|
+
});
|
|
3934
|
+
}
|
|
3935
|
+
|
|
3734
3936
|
// If this is attach message for new data store, and we are in a batch, send this op out of order
|
|
3735
3937
|
// Is it safe:
|
|
3736
3938
|
// Yes, this should be safe reordering. Newly created data stores are not visible through API surface.
|
|
@@ -3931,6 +4133,11 @@ export class ContainerRuntime
|
|
|
3931
4133
|
case ContainerMessageType.GC:
|
|
3932
4134
|
this.submit(message);
|
|
3933
4135
|
break;
|
|
4136
|
+
case ContainerMessageType.DocumentSchemaChange:
|
|
4137
|
+
// There is no need to resend this message. Document schema controller will properly resend it again (if needed)
|
|
4138
|
+
// on a first occasion (any ops sent after reconnect). There is a good chance, though, that it will not want to
|
|
4139
|
+
// send any ops, as some other client already changed schema.
|
|
4140
|
+
break;
|
|
3934
4141
|
default: {
|
|
3935
4142
|
// This case should be very rare - it would imply an op was stashed from a
|
|
3936
4143
|
// future version of runtime code and now is being applied on an older version.
|
|
@@ -4220,9 +4427,6 @@ export class ContainerRuntime
|
|
|
4220
4427
|
}
|
|
4221
4428
|
|
|
4222
4429
|
private get groupedBatchingEnabled(): boolean {
|
|
4223
|
-
|
|
4224
|
-
"Fluid.ContainerRuntime.DisableGroupedBatching",
|
|
4225
|
-
);
|
|
4226
|
-
return killSwitch !== true && this.runtimeOptions.enableGroupedBatching;
|
|
4430
|
+
return this.documentSchema.opGroupingEnabled === true;
|
|
4227
4431
|
}
|
|
4228
4432
|
}
|