@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
|
@@ -5,22 +5,22 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.ChannelCollectionFactory = exports.detectOutboundReferences = exports.getSummaryForDatastores = exports.ChannelCollection = exports.wrapContextForInnerChannel = exports.wrapContext = exports.AllowInactiveRequestHeaderKey = exports.AllowTombstoneRequestHeaderKey = exports.RuntimeHeaders = void 0;
|
|
8
|
-
const datastore_1 = require("@fluidframework/datastore");
|
|
9
|
-
const runtime_definitions_1 = require("@fluidframework/runtime-definitions");
|
|
10
|
-
const runtime_utils_1 = require("@fluidframework/runtime-utils");
|
|
11
|
-
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
12
8
|
const container_definitions_1 = require("@fluidframework/container-definitions");
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
9
|
+
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
10
|
+
const internal_2 = require("@fluidframework/datastore/internal");
|
|
11
|
+
const internal_3 = require("@fluidframework/driver-utils/internal");
|
|
12
|
+
const internal_4 = require("@fluidframework/runtime-definitions/internal");
|
|
13
|
+
const internal_5 = require("@fluidframework/runtime-utils/internal");
|
|
14
|
+
const internal_6 = require("@fluidframework/telemetry-utils/internal");
|
|
16
15
|
const containerRuntime_js_1 = require("./containerRuntime.js");
|
|
17
|
-
const dataStoreContext_js_1 = require("./dataStoreContext.js");
|
|
18
|
-
const storageServiceWithAttachBlobs_js_1 = require("./storageServiceWithAttachBlobs.js");
|
|
19
16
|
const dataStore_js_1 = require("./dataStore.js");
|
|
17
|
+
const dataStoreContext_js_1 = require("./dataStoreContext.js");
|
|
18
|
+
const dataStoreContexts_js_1 = require("./dataStoreContexts.js");
|
|
19
|
+
const dataStoreRegistry_js_1 = require("./dataStoreRegistry.js");
|
|
20
20
|
const index_js_1 = require("./gc/index.js");
|
|
21
|
-
const index_js_2 = require("./summary/index.js");
|
|
22
21
|
const messageTypes_js_1 = require("./messageTypes.js");
|
|
23
|
-
const
|
|
22
|
+
const storageServiceWithAttachBlobs_js_1 = require("./storageServiceWithAttachBlobs.js");
|
|
23
|
+
const index_js_2 = require("./summary/index.js");
|
|
24
24
|
/**
|
|
25
25
|
* Accepted header keys for requests coming to the runtime.
|
|
26
26
|
* @internal
|
|
@@ -105,7 +105,10 @@ function wrapContext(context) {
|
|
|
105
105
|
return context.getCreateChildSummarizerNodeFn?.(...args);
|
|
106
106
|
},
|
|
107
107
|
deleteChildSummarizerNode: (...args) => {
|
|
108
|
-
return context.deleteChildSummarizerNode
|
|
108
|
+
return context.deleteChildSummarizerNode(...args);
|
|
109
|
+
},
|
|
110
|
+
setChannelDirty: (address) => {
|
|
111
|
+
return context.setChannelDirty(address);
|
|
109
112
|
},
|
|
110
113
|
};
|
|
111
114
|
}
|
|
@@ -157,7 +160,7 @@ class ChannelCollection {
|
|
|
157
160
|
this.pendingAttach = new Map();
|
|
158
161
|
// 0.24 back-compat attachingBeforeSummary
|
|
159
162
|
this.attachOpFiredForDataStore = new Set();
|
|
160
|
-
this.disposeOnce = new
|
|
163
|
+
this.disposeOnce = new internal_1.Lazy(() => this.contexts.dispose());
|
|
161
164
|
// Stores the ids of new data stores between two GC runs. This is used to notify the garbage collector of new
|
|
162
165
|
// root data stores that are added.
|
|
163
166
|
this.dataStoresSinceLastGC = [];
|
|
@@ -165,10 +168,11 @@ class ChannelCollection {
|
|
|
165
168
|
/** For sampling. Only log once per container */
|
|
166
169
|
this.shouldSendAttachLog = true;
|
|
167
170
|
this.dispose = () => this.disposeOnce.value;
|
|
168
|
-
this.mc = (0,
|
|
171
|
+
this.mc = (0, internal_6.createChildMonitoringContext)({ logger: baseLogger });
|
|
169
172
|
this.contexts = new dataStoreContexts_js_1.DataStoreContexts(baseLogger);
|
|
170
|
-
this.containerRuntimeHandle = new
|
|
171
|
-
this.entryPoint = new
|
|
173
|
+
this.containerRuntimeHandle = new internal_2.FluidObjectHandle(this.parentContext, "/", this.parentContext.IFluidHandleContext);
|
|
174
|
+
this.entryPoint = new internal_2.FluidObjectHandle(new internal_1.LazyPromise(async () => provideEntryPoint(this)), "", this.parentContext.IFluidHandleContext);
|
|
175
|
+
this.aliasedDataStores = new Set(aliasMap.values());
|
|
172
176
|
// Extract stores stored inside the snapshot
|
|
173
177
|
const fluidDataStores = new Map();
|
|
174
178
|
if (baseSnapshot) {
|
|
@@ -193,14 +197,14 @@ class ChannelCollection {
|
|
|
193
197
|
storage: this.parentContext.storage,
|
|
194
198
|
scope: this.parentContext.scope,
|
|
195
199
|
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {
|
|
196
|
-
type:
|
|
200
|
+
type: internal_4.CreateSummarizerNodeSource.FromSummary,
|
|
197
201
|
}),
|
|
198
202
|
loadingGroupId: value.groupId,
|
|
199
203
|
});
|
|
200
204
|
}
|
|
201
205
|
else {
|
|
202
206
|
if (typeof value !== "object") {
|
|
203
|
-
throw new
|
|
207
|
+
throw new internal_6.LoggingError("Snapshot should be there to load from!!");
|
|
204
208
|
}
|
|
205
209
|
const snapshotTree = value;
|
|
206
210
|
dataStoreContext = new dataStoreContext_js_1.LocalFluidDataStoreContext({
|
|
@@ -210,11 +214,10 @@ class ChannelCollection {
|
|
|
210
214
|
storage: this.parentContext.storage,
|
|
211
215
|
scope: this.parentContext.scope,
|
|
212
216
|
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {
|
|
213
|
-
type:
|
|
217
|
+
type: internal_4.CreateSummarizerNodeSource.FromSummary,
|
|
214
218
|
}),
|
|
215
219
|
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(key),
|
|
216
220
|
snapshotTree,
|
|
217
|
-
isRootDataStore: undefined,
|
|
218
221
|
});
|
|
219
222
|
}
|
|
220
223
|
this.contexts.addBoundOrRemoted(dataStoreContext);
|
|
@@ -249,7 +252,7 @@ class ChannelCollection {
|
|
|
249
252
|
const attachMessage = message.contents;
|
|
250
253
|
this.dataStoresSinceLastGC.push(attachMessage.id);
|
|
251
254
|
// We need to process the GC Data for both local and remote attach messages
|
|
252
|
-
const foundGCData = (0,
|
|
255
|
+
const foundGCData = (0, internal_5.processAttachMessageGCData)(attachMessage.snapshot, (nodeId, toPath) => {
|
|
253
256
|
// nodeId is the relative path under the node being attached. Always starts with "/", but no trailing "/" after an id
|
|
254
257
|
const fromPath = `/${attachMessage.id}${nodeId === "/" ? "" : nodeId}`;
|
|
255
258
|
this.parentContext.addedGCOutboundReference?.({ absolutePath: fromPath }, { absolutePath: toPath });
|
|
@@ -260,37 +263,37 @@ class ChannelCollection {
|
|
|
260
263
|
this.shouldSendAttachLog = false;
|
|
261
264
|
this.mc.logger.sendTelemetryEvent({
|
|
262
265
|
eventName: "dataStoreAttachMessage_sampled",
|
|
263
|
-
...(0,
|
|
266
|
+
...(0, internal_6.tagCodeArtifacts)({ id: attachMessage.id, pkg: attachMessage.type }),
|
|
264
267
|
details: {
|
|
265
268
|
local,
|
|
266
269
|
snapshot: !!attachMessage.snapshot,
|
|
267
270
|
foundGCData,
|
|
268
271
|
},
|
|
269
|
-
...(0,
|
|
272
|
+
...(0, internal_6.extractSafePropertiesFromMessage)(message),
|
|
270
273
|
});
|
|
271
274
|
}
|
|
272
275
|
// The local object has already been attached
|
|
273
276
|
if (local) {
|
|
274
|
-
(0,
|
|
275
|
-
this.contexts.get(attachMessage.id)?.
|
|
277
|
+
(0, internal_1.assert)(this.pendingAttach.has(attachMessage.id), 0x15e /* "Local object does not have matching attach message id" */);
|
|
278
|
+
this.contexts.get(attachMessage.id)?.setAttachState(container_definitions_1.AttachState.Attached);
|
|
276
279
|
this.pendingAttach.delete(attachMessage.id);
|
|
277
280
|
return;
|
|
278
281
|
}
|
|
279
282
|
// If a non-local operation then go and create the object, otherwise mark it as officially attached.
|
|
280
283
|
if (this.alreadyProcessed(attachMessage.id)) {
|
|
281
284
|
// TODO: dataStoreId may require a different tag from PackageData #7488
|
|
282
|
-
const error = new
|
|
285
|
+
const error = new internal_6.DataCorruptionError(
|
|
283
286
|
// pre-0.58 error message: duplicateDataStoreCreatedWithExistingId
|
|
284
287
|
"Duplicate DataStore created with existing id", {
|
|
285
|
-
...(0,
|
|
286
|
-
...(0,
|
|
288
|
+
...(0, internal_6.extractSafePropertiesFromMessage)(message),
|
|
289
|
+
...(0, internal_6.tagCodeArtifacts)({ dataStoreId: attachMessage.id }),
|
|
287
290
|
});
|
|
288
291
|
throw error;
|
|
289
292
|
}
|
|
290
293
|
const flatAttachBlobs = new Map();
|
|
291
294
|
let snapshotTree;
|
|
292
295
|
if (attachMessage.snapshot) {
|
|
293
|
-
snapshotTree = (0,
|
|
296
|
+
snapshotTree = (0, internal_3.buildSnapshotTree)(attachMessage.snapshot.entries, flatAttachBlobs);
|
|
294
297
|
}
|
|
295
298
|
// Include the type of attach message which is the pkg of the store to be
|
|
296
299
|
// used by RemoteFluidDataStoreContext in case it is not in the snapshot.
|
|
@@ -303,7 +306,7 @@ class ChannelCollection {
|
|
|
303
306
|
scope: this.parentContext.scope,
|
|
304
307
|
loadingGroupId: attachMessage.snapshot?.groupId,
|
|
305
308
|
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(attachMessage.id, {
|
|
306
|
-
type:
|
|
309
|
+
type: internal_4.CreateSummarizerNodeSource.FromAttach,
|
|
307
310
|
sequenceNumber: message.sequenceNumber,
|
|
308
311
|
snapshot: attachMessage.snapshot ?? {
|
|
309
312
|
entries: [(0, dataStoreContext_js_1.createAttributesBlob)(pkg, true /* isRootDataStore */)],
|
|
@@ -316,36 +319,37 @@ class ChannelCollection {
|
|
|
316
319
|
processAliasMessage(message, localOpMetadata, local) {
|
|
317
320
|
const aliasMessage = message.contents;
|
|
318
321
|
if (!(0, dataStore_js_1.isDataStoreAliasMessage)(aliasMessage)) {
|
|
319
|
-
throw new
|
|
320
|
-
...(0,
|
|
322
|
+
throw new internal_6.DataCorruptionError("malformedDataStoreAliasMessage", {
|
|
323
|
+
...(0, internal_6.extractSafePropertiesFromMessage)(message),
|
|
321
324
|
});
|
|
322
325
|
}
|
|
323
326
|
const resolve = localOpMetadata;
|
|
324
|
-
const aliasResult = this.processAliasMessageCore(aliasMessage);
|
|
327
|
+
const aliasResult = this.processAliasMessageCore(aliasMessage.internalId, aliasMessage.alias);
|
|
325
328
|
if (local) {
|
|
326
329
|
resolve(aliasResult);
|
|
327
330
|
}
|
|
328
331
|
}
|
|
329
|
-
processAliasMessageCore(
|
|
330
|
-
if (this.alreadyProcessed(
|
|
332
|
+
processAliasMessageCore(internalId, alias) {
|
|
333
|
+
if (this.alreadyProcessed(alias)) {
|
|
331
334
|
return false;
|
|
332
335
|
}
|
|
333
|
-
const context = this.contexts.get(
|
|
336
|
+
const context = this.contexts.get(internalId);
|
|
334
337
|
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
335
338
|
// corruption in case a deleted data store accidentally submitted a signal.
|
|
336
|
-
if (this.checkAndLogIfDeleted(
|
|
339
|
+
if (this.checkAndLogIfDeleted(internalId, context, "Changed", "processAliasMessageCore")) {
|
|
337
340
|
return false;
|
|
338
341
|
}
|
|
339
342
|
if (context === undefined) {
|
|
340
343
|
this.mc.logger.sendErrorEvent({
|
|
341
344
|
eventName: "AliasFluidDataStoreNotFound",
|
|
342
|
-
fluidDataStoreId:
|
|
345
|
+
fluidDataStoreId: internalId,
|
|
343
346
|
});
|
|
344
347
|
return false;
|
|
345
348
|
}
|
|
346
|
-
const handle = new
|
|
349
|
+
const handle = new internal_2.FluidObjectHandle(context, internalId, this.parentContext.IFluidHandleContext);
|
|
347
350
|
this.parentContext.addedGCOutboundReference?.(this.containerRuntimeHandle, handle);
|
|
348
|
-
this.aliasMap.set(
|
|
351
|
+
this.aliasMap.set(alias, context.id);
|
|
352
|
+
this.aliasedDataStores.add(context.id);
|
|
349
353
|
context.setInMemoryRoot();
|
|
350
354
|
return true;
|
|
351
355
|
}
|
|
@@ -357,7 +361,7 @@ class ChannelCollection {
|
|
|
357
361
|
const { attachSummary } = localContext.getAttachData(/* includeGCData: */ true);
|
|
358
362
|
const type = localContext.packagePath[localContext.packagePath.length - 1];
|
|
359
363
|
// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.
|
|
360
|
-
const snapshot = (0,
|
|
364
|
+
const snapshot = (0, internal_5.convertSummaryTreeToITree)(attachSummary.summary);
|
|
361
365
|
return {
|
|
362
366
|
id: localContext.id,
|
|
363
367
|
snapshot,
|
|
@@ -371,21 +375,24 @@ class ChannelCollection {
|
|
|
371
375
|
*/
|
|
372
376
|
makeDataStoreLocallyVisible(id) {
|
|
373
377
|
const localContext = this.contexts.getUnbound(id);
|
|
374
|
-
(0,
|
|
378
|
+
(0, internal_1.assert)(!!localContext, 0x15f /* "Could not find unbound context to bind" */);
|
|
375
379
|
/**
|
|
376
380
|
* If the container is not detached, it is globally visible to all clients. This data store should also be
|
|
377
381
|
* globally visible. Move it to attaching state and send an "attach" op for it.
|
|
378
382
|
* If the container is detached, this data store will be part of the summary that makes the container attached.
|
|
379
383
|
*/
|
|
380
384
|
if (this.parentContext.attachState !== container_definitions_1.AttachState.Detached) {
|
|
381
|
-
localContext.
|
|
382
|
-
|
|
383
|
-
this.pendingAttach.set(id, message);
|
|
384
|
-
this.parentContext.submitMessage(messageTypes_js_1.ContainerMessageType.Attach, message, undefined);
|
|
385
|
-
this.attachOpFiredForDataStore.add(id);
|
|
385
|
+
localContext.setAttachState(container_definitions_1.AttachState.Attaching);
|
|
386
|
+
this.submitAttachChannelOp(localContext);
|
|
386
387
|
}
|
|
387
388
|
this.contexts.bind(id);
|
|
388
389
|
}
|
|
390
|
+
submitAttachChannelOp(localContext) {
|
|
391
|
+
const message = this.generateAttachMessage(localContext);
|
|
392
|
+
this.pendingAttach.set(localContext.id, message);
|
|
393
|
+
this.parentContext.submitMessage(messageTypes_js_1.ContainerMessageType.Attach, message, undefined);
|
|
394
|
+
this.attachOpFiredForDataStore.add(localContext.id);
|
|
395
|
+
}
|
|
389
396
|
/**
|
|
390
397
|
* Generate compact internal DataStore ID.
|
|
391
398
|
*
|
|
@@ -410,50 +417,36 @@ class ChannelCollection {
|
|
|
410
417
|
// In first two cases we will encode result as strings in more compact form.
|
|
411
418
|
if (this.parentContext.attachState === container_definitions_1.AttachState.Detached) {
|
|
412
419
|
// container is detached, only one client observes content, no way to hit collisions with other clients.
|
|
413
|
-
return (0,
|
|
420
|
+
return (0, internal_5.encodeCompactIdToString)(2 * this.contexts.size);
|
|
414
421
|
}
|
|
415
422
|
const id = this.parentContext.containerRuntime.generateDocumentUniqueId();
|
|
416
423
|
if (typeof id === "number") {
|
|
417
|
-
return (0,
|
|
424
|
+
return (0, internal_5.encodeCompactIdToString)(2 * id + 1);
|
|
418
425
|
}
|
|
419
426
|
return id;
|
|
420
427
|
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
storage: this.parentContext.storage,
|
|
428
|
-
scope: this.parentContext.scope,
|
|
429
|
-
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(id, {
|
|
430
|
-
type: runtime_definitions_1.CreateSummarizerNodeSource.Local,
|
|
431
|
-
}),
|
|
432
|
-
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),
|
|
433
|
-
snapshotTree: undefined,
|
|
434
|
-
isRootDataStore: false,
|
|
435
|
-
loadingGroupId,
|
|
436
|
-
channelToDataStoreFn: (channel) => (0, dataStore_js_1.channelToDataStore)(channel, id, this, (0, telemetry_utils_1.createChildLogger)({ logger: this.parentContext.logger })),
|
|
437
|
-
});
|
|
438
|
-
this.contexts.addUnbound(context);
|
|
439
|
-
return context;
|
|
428
|
+
createDetachedDataStore(pkg, loadingGroupId) {
|
|
429
|
+
return this.createContext(this.createDataStoreId(), pkg, dataStoreContext_js_1.LocalDetachedFluidDataStoreContext, undefined, // props
|
|
430
|
+
loadingGroupId);
|
|
431
|
+
}
|
|
432
|
+
createDataStoreContext(pkg, props, loadingGroupId) {
|
|
433
|
+
return this.createContext(this.createDataStoreId(), pkg, dataStoreContext_js_1.LocalFluidDataStoreContext, props, loadingGroupId);
|
|
440
434
|
}
|
|
441
|
-
|
|
442
|
-
const
|
|
443
|
-
const context = new dataStoreContext_js_1.LocalFluidDataStoreContext({
|
|
435
|
+
createContext(id, pkg, contextCtor, createProps, loadingGroupId) {
|
|
436
|
+
const context = new contextCtor({
|
|
444
437
|
id,
|
|
445
438
|
pkg,
|
|
446
439
|
parentContext: this.wrapContextForInnerChannel(id),
|
|
447
440
|
storage: this.parentContext.storage,
|
|
448
441
|
scope: this.parentContext.scope,
|
|
449
442
|
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(id, {
|
|
450
|
-
type:
|
|
443
|
+
type: internal_4.CreateSummarizerNodeSource.Local,
|
|
451
444
|
}),
|
|
452
445
|
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),
|
|
453
446
|
snapshotTree: undefined,
|
|
454
|
-
|
|
455
|
-
createProps: props,
|
|
447
|
+
createProps,
|
|
456
448
|
loadingGroupId,
|
|
449
|
+
channelToDataStoreFn: (channel) => (0, dataStore_js_1.channelToDataStore)(channel, id, this, (0, internal_6.createChildLogger)({ logger: this.parentContext.logger })),
|
|
457
450
|
});
|
|
458
451
|
this.contexts.addUnbound(context);
|
|
459
452
|
return context;
|
|
@@ -467,36 +460,40 @@ class ChannelCollection {
|
|
|
467
460
|
case messageTypes_js_1.ContainerMessageType.Alias:
|
|
468
461
|
this.parentContext.submitMessage(type, content, localOpMetadata);
|
|
469
462
|
return;
|
|
463
|
+
case messageTypes_js_1.ContainerMessageType.FluidDataStoreOp:
|
|
464
|
+
return this.reSubmitChannelOp(type, content, localOpMetadata);
|
|
470
465
|
default:
|
|
466
|
+
(0, internal_1.assert)(false, 0x907 /* unknown op type */);
|
|
471
467
|
}
|
|
472
|
-
|
|
468
|
+
}
|
|
469
|
+
reSubmitChannelOp(type, content, localOpMetadata) {
|
|
473
470
|
const envelope = content;
|
|
474
471
|
const context = this.contexts.get(envelope.address);
|
|
475
472
|
// If the data store has been deleted, log an error and throw an error. If there are local changes for a
|
|
476
473
|
// deleted data store, it can otherwise lead to inconsistent state when compared to other clients.
|
|
477
474
|
if (this.checkAndLogIfDeleted(envelope.address, context, "Changed", "resubmitDataStoreOp")) {
|
|
478
|
-
throw new
|
|
475
|
+
throw new internal_6.DataCorruptionError("Context is deleted!", {
|
|
479
476
|
callSite: "resubmitDataStoreOp",
|
|
480
|
-
...(0,
|
|
477
|
+
...(0, internal_6.tagCodeArtifacts)({ id: envelope.address }),
|
|
481
478
|
});
|
|
482
479
|
}
|
|
483
|
-
(0,
|
|
480
|
+
(0, internal_1.assert)(!!context, 0x160 /* "There should be a store context for the op" */);
|
|
484
481
|
const innerContents = envelope.contents;
|
|
485
482
|
context.reSubmit(innerContents.type, innerContents.content, localOpMetadata);
|
|
486
483
|
}
|
|
487
484
|
rollback(type, content, localOpMetadata) {
|
|
488
|
-
(0,
|
|
485
|
+
(0, internal_1.assert)(type === messageTypes_js_1.ContainerMessageType.FluidDataStoreOp, 0x8e8 /* type */);
|
|
489
486
|
const envelope = content;
|
|
490
487
|
const context = this.contexts.get(envelope.address);
|
|
491
488
|
// If the data store has been deleted, log an error and throw an error. If there are local changes for a
|
|
492
489
|
// deleted data store, it can otherwise lead to inconsistent state when compared to other clients.
|
|
493
490
|
if (this.checkAndLogIfDeleted(envelope.address, context, "Changed", "rollbackDataStoreOp")) {
|
|
494
|
-
throw new
|
|
491
|
+
throw new internal_6.DataCorruptionError("Context is deleted!", {
|
|
495
492
|
callSite: "rollbackDataStoreOp",
|
|
496
|
-
...(0,
|
|
493
|
+
...(0, internal_6.tagCodeArtifacts)({ id: envelope.address }),
|
|
497
494
|
});
|
|
498
495
|
}
|
|
499
|
-
(0,
|
|
496
|
+
(0, internal_1.assert)(!!context, 0x2e8 /* "There should be a store context for the op" */);
|
|
500
497
|
const innerContents = envelope.contents;
|
|
501
498
|
context.rollback(innerContents.type, innerContents.content, localOpMetadata);
|
|
502
499
|
}
|
|
@@ -507,22 +504,59 @@ class ChannelCollection {
|
|
|
507
504
|
return this.applyStashedAttachOp(opContents.contents);
|
|
508
505
|
case messageTypes_js_1.ContainerMessageType.Alias:
|
|
509
506
|
return;
|
|
507
|
+
case messageTypes_js_1.ContainerMessageType.FluidDataStoreOp:
|
|
508
|
+
return this.applyStashedChannelChannelOp(opContents.contents);
|
|
510
509
|
default:
|
|
510
|
+
(0, internal_1.assert)(false, 0x908 /* unknon type of op */);
|
|
511
511
|
}
|
|
512
|
-
|
|
512
|
+
}
|
|
513
|
+
async applyStashedChannelChannelOp(envelope) {
|
|
513
514
|
const context = this.contexts.get(envelope.address);
|
|
514
515
|
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
515
516
|
// corruption in case the data store that stashed the op is deleted.
|
|
516
517
|
if (this.checkAndLogIfDeleted(envelope.address, context, "Changed", "applyStashedOp")) {
|
|
517
518
|
return undefined;
|
|
518
519
|
}
|
|
519
|
-
(0,
|
|
520
|
+
(0, internal_1.assert)(!!context, 0x161 /* "There should be a store context for the op" */);
|
|
520
521
|
return context.applyStashedOp(envelope.contents);
|
|
521
522
|
}
|
|
522
523
|
async applyStashedAttachOp(message) {
|
|
523
|
-
|
|
524
|
-
//
|
|
525
|
-
|
|
524
|
+
const { id, snapshot } = message;
|
|
525
|
+
// build the snapshot from the summary in the attach message
|
|
526
|
+
const flatAttachBlobs = new Map();
|
|
527
|
+
const snapshotTree = (0, internal_3.buildSnapshotTree)(snapshot.entries, flatAttachBlobs);
|
|
528
|
+
const storage = new storageServiceWithAttachBlobs_js_1.StorageServiceWithAttachBlobs(this.parentContext.storage, flatAttachBlobs);
|
|
529
|
+
// create a local datastore context for the data store context,
|
|
530
|
+
// which this message represents. All newly created data store
|
|
531
|
+
// contexts start as a local context on the client that created
|
|
532
|
+
// them, and for stashed ops, the client that applies it plays
|
|
533
|
+
// the role of creating client.
|
|
534
|
+
const dataStoreContext = new dataStoreContext_js_1.LocalFluidDataStoreContext({
|
|
535
|
+
id,
|
|
536
|
+
pkg: undefined,
|
|
537
|
+
parentContext: this.wrapContextForInnerChannel(id),
|
|
538
|
+
storage,
|
|
539
|
+
scope: this.parentContext.scope,
|
|
540
|
+
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(id, {
|
|
541
|
+
type: internal_4.CreateSummarizerNodeSource.FromSummary,
|
|
542
|
+
}),
|
|
543
|
+
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),
|
|
544
|
+
snapshotTree,
|
|
545
|
+
});
|
|
546
|
+
// realize the local context, as local contexts shouldn't be delay
|
|
547
|
+
// loaded, as this client is playing the role of creating client,
|
|
548
|
+
// and creating clients always create realized data store contexts.
|
|
549
|
+
const channel = await dataStoreContext.realize();
|
|
550
|
+
await channel.entryPoint.get();
|
|
551
|
+
// add to the list of bound or remoted, as this context must be bound
|
|
552
|
+
// to had an attach message sent, and is the non-detached case is remoted.
|
|
553
|
+
this.contexts.addBoundOrRemoted(dataStoreContext);
|
|
554
|
+
if (this.parentContext.attachState !== container_definitions_1.AttachState.Detached) {
|
|
555
|
+
// if the client is not detached put in the pending attach list
|
|
556
|
+
// so that on ack of the stashed op, the context is found.
|
|
557
|
+
// detached client don't send ops, so should not expect and ack.
|
|
558
|
+
this.pendingAttach.set(message.id, message);
|
|
559
|
+
}
|
|
526
560
|
}
|
|
527
561
|
process(message, local, localMessageMetadata, addedOutboundReference) {
|
|
528
562
|
switch (message.type) {
|
|
@@ -532,59 +566,63 @@ class ChannelCollection {
|
|
|
532
566
|
case messageTypes_js_1.ContainerMessageType.Alias:
|
|
533
567
|
this.processAliasMessage(message, localMessageMetadata, local);
|
|
534
568
|
return;
|
|
535
|
-
case messageTypes_js_1.ContainerMessageType.FluidDataStoreOp:
|
|
569
|
+
case messageTypes_js_1.ContainerMessageType.FluidDataStoreOp: {
|
|
570
|
+
const envelope = message.contents;
|
|
571
|
+
const innerContents = envelope.contents;
|
|
572
|
+
const transformed = {
|
|
573
|
+
...message,
|
|
574
|
+
type: innerContents.type,
|
|
575
|
+
contents: innerContents.content,
|
|
576
|
+
};
|
|
577
|
+
this.processChannelOp(envelope.address, transformed, local, localMessageMetadata);
|
|
578
|
+
// By default, we use the new behavior of detecting outbound routes here.
|
|
579
|
+
// If this setting is true, then DataStoreContext would be notifying GC instead.
|
|
580
|
+
if (this.mc.config.getBoolean(index_js_1.detectOutboundRoutesViaDDSKey) !== true &&
|
|
581
|
+
addedOutboundReference !== undefined) {
|
|
582
|
+
// Notify GC of any outbound references that were added by this op.
|
|
583
|
+
detectOutboundReferences(envelope.address, transformed.contents, addedOutboundReference);
|
|
584
|
+
}
|
|
536
585
|
break;
|
|
586
|
+
}
|
|
537
587
|
default:
|
|
538
|
-
(0,
|
|
588
|
+
(0, internal_1.assert)(false, 0x8e9 /* unreached */);
|
|
539
589
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
const
|
|
543
|
-
...message,
|
|
544
|
-
type: innerContents.type,
|
|
545
|
-
contents: innerContents.content,
|
|
546
|
-
};
|
|
547
|
-
const context = this.contexts.get(envelope.address);
|
|
590
|
+
}
|
|
591
|
+
processChannelOp(address, message, local, localMessageMetadata) {
|
|
592
|
+
const context = this.contexts.get(address);
|
|
548
593
|
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
549
594
|
// corruption in case a deleted data store accidentally submitted an op.
|
|
550
|
-
if (this.checkAndLogIfDeleted(
|
|
595
|
+
if (this.checkAndLogIfDeleted(address, context, "Changed", "processFluidDataStoreOp")) {
|
|
551
596
|
return;
|
|
552
597
|
}
|
|
553
598
|
if (context === undefined) {
|
|
554
599
|
// Former assert 0x162
|
|
555
|
-
throw
|
|
600
|
+
throw internal_6.DataProcessingError.create("No context for op", "processFluidDataStoreOp", message, {
|
|
556
601
|
local,
|
|
557
602
|
messageDetails: JSON.stringify({
|
|
558
603
|
type: message.type,
|
|
559
604
|
contentType: typeof message.contents,
|
|
560
605
|
}),
|
|
561
|
-
...(0,
|
|
606
|
+
...(0, internal_6.tagCodeArtifacts)({ address }),
|
|
562
607
|
});
|
|
563
608
|
}
|
|
564
|
-
context.process(
|
|
565
|
-
// By default, we use the new behavior of detecting outbound routes here.
|
|
566
|
-
// If this setting is true, then DataStoreContext would be notifying GC instead.
|
|
567
|
-
if (this.mc.config.getBoolean(index_js_1.detectOutboundRoutesViaDDSKey) !== true &&
|
|
568
|
-
addedOutboundReference !== undefined) {
|
|
569
|
-
// Notify GC of any outbound references that were added by this op.
|
|
570
|
-
detectOutboundReferences(envelope, addedOutboundReference);
|
|
571
|
-
}
|
|
609
|
+
context.process(message, local, localMessageMetadata);
|
|
572
610
|
// Notify that a GC node for the data store changed. This is used to detect if a deleted data store is
|
|
573
611
|
// being used.
|
|
574
|
-
this.gcNodeUpdated(`/${
|
|
612
|
+
this.gcNodeUpdated(`/${address}`, "Changed", message.timestamp, context.isLoaded ? context.packagePath : undefined);
|
|
575
613
|
}
|
|
576
614
|
async getDataStore(id, requestHeaderData) {
|
|
577
615
|
const headerData = { ...containerRuntime_js_1.defaultRuntimeHeaderData, ...requestHeaderData };
|
|
578
616
|
if (this.checkAndLogIfDeleted(id, this.contexts.get(id), "Requested", "getDataStore", requestHeaderData)) {
|
|
579
617
|
// The requested data store has been deleted by gc. Create a 404 response exception.
|
|
580
618
|
const request = { url: id };
|
|
581
|
-
throw (0,
|
|
619
|
+
throw (0, internal_5.responseToException)((0, internal_5.createResponseError)(404, "DataStore was deleted", request), request);
|
|
582
620
|
}
|
|
583
621
|
const context = await this.contexts.getBoundOrRemoted(id, headerData.wait);
|
|
584
622
|
if (context === undefined) {
|
|
585
623
|
// The requested data store does not exits. Throw a 404 response exception.
|
|
586
624
|
const request = { url: id };
|
|
587
|
-
throw (0,
|
|
625
|
+
throw (0, internal_5.responseToException)((0, internal_5.create404Response)(request), request);
|
|
588
626
|
}
|
|
589
627
|
return context;
|
|
590
628
|
}
|
|
@@ -618,7 +656,7 @@ class ChannelCollection {
|
|
|
618
656
|
}
|
|
619
657
|
this.mc.logger.sendErrorEvent({
|
|
620
658
|
eventName: `GC_Deleted_DataStore_${deletedLogSuffix}`,
|
|
621
|
-
...(0,
|
|
659
|
+
...(0, internal_6.tagCodeArtifacts)({ id }),
|
|
622
660
|
callSite,
|
|
623
661
|
headers: JSON.stringify(requestHeaderData),
|
|
624
662
|
exists: context !== undefined,
|
|
@@ -637,10 +675,10 @@ class ChannelCollection {
|
|
|
637
675
|
}
|
|
638
676
|
if (!context) {
|
|
639
677
|
// Attach message may not have been processed yet
|
|
640
|
-
(0,
|
|
678
|
+
(0, internal_1.assert)(!local, 0x163 /* "Missing datastore for local signal" */);
|
|
641
679
|
this.mc.logger.sendTelemetryEvent({
|
|
642
680
|
eventName: "SignalFluidDataStoreNotFound",
|
|
643
|
-
...(0,
|
|
681
|
+
...(0, internal_6.tagCodeArtifacts)({
|
|
644
682
|
fluidDataStoreId,
|
|
645
683
|
}),
|
|
646
684
|
});
|
|
@@ -657,7 +695,7 @@ class ChannelCollection {
|
|
|
657
695
|
this.mc.logger.sendErrorEvent({
|
|
658
696
|
eventName: "SetConnectionStateError",
|
|
659
697
|
clientId,
|
|
660
|
-
...(0,
|
|
698
|
+
...(0, internal_6.tagCodeArtifacts)({
|
|
661
699
|
fluidDataStoreId,
|
|
662
700
|
}),
|
|
663
701
|
details: JSON.stringify({
|
|
@@ -669,11 +707,10 @@ class ChannelCollection {
|
|
|
669
707
|
}
|
|
670
708
|
}
|
|
671
709
|
setAttachState(attachState) {
|
|
672
|
-
const eventName = attachState === container_definitions_1.AttachState.Attaching ? "attaching" : "attached";
|
|
673
710
|
for (const [, context] of this.contexts) {
|
|
674
711
|
// Fire only for bounded stores.
|
|
675
712
|
if (!this.contexts.isNotBound(context.id)) {
|
|
676
|
-
context.
|
|
713
|
+
context.setAttachState(attachState);
|
|
677
714
|
}
|
|
678
715
|
}
|
|
679
716
|
}
|
|
@@ -681,7 +718,7 @@ class ChannelCollection {
|
|
|
681
718
|
return this.contexts.size;
|
|
682
719
|
}
|
|
683
720
|
async summarize(fullTree, trackState, telemetryContext) {
|
|
684
|
-
const summaryBuilder = new
|
|
721
|
+
const summaryBuilder = new internal_5.SummaryTreeBuilder();
|
|
685
722
|
// Iterate over each store and ask it to snapshot
|
|
686
723
|
await Promise.all(Array.from(this.contexts)
|
|
687
724
|
.filter(([_, context]) => {
|
|
@@ -690,7 +727,7 @@ class ChannelCollection {
|
|
|
690
727
|
// had not yet round tripped back to the client.
|
|
691
728
|
if (context.attachState === container_definitions_1.AttachState.Attaching) {
|
|
692
729
|
// Formerly assert 0x588
|
|
693
|
-
const error =
|
|
730
|
+
const error = internal_6.DataProcessingError.create("Local data store detected in attaching state during summarize", "summarize");
|
|
694
731
|
throw error;
|
|
695
732
|
}
|
|
696
733
|
return context.attachState === container_definitions_1.AttachState.Attached;
|
|
@@ -705,7 +742,7 @@ class ChannelCollection {
|
|
|
705
742
|
* Create a summary. Used when attaching or serializing a detached container.
|
|
706
743
|
*/
|
|
707
744
|
getAttachSummary(telemetryContext) {
|
|
708
|
-
const builder = new
|
|
745
|
+
const builder = new internal_5.SummaryTreeBuilder();
|
|
709
746
|
// Attaching graph of some stores can cause other stores to get bound too.
|
|
710
747
|
// So keep taking summary until no new stores get bound.
|
|
711
748
|
let notBoundContextsLength;
|
|
@@ -730,8 +767,8 @@ class ChannelCollection {
|
|
|
730
767
|
else {
|
|
731
768
|
// If this data store is not yet loaded, then there should be no changes in the snapshot from
|
|
732
769
|
// which it was created as it is detached container. So just use the previous snapshot.
|
|
733
|
-
(0,
|
|
734
|
-
dataStoreSummary = (0,
|
|
770
|
+
(0, internal_1.assert)(!!this.baseSnapshot, 0x166 /* "BaseSnapshot should be there as detached container loaded from snapshot" */);
|
|
771
|
+
dataStoreSummary = (0, internal_5.convertSnapshotTreeToSummaryTree)(this.baseSnapshot.trees[key]);
|
|
735
772
|
}
|
|
736
773
|
builder.addWithStats(key, dataStoreSummary);
|
|
737
774
|
});
|
|
@@ -746,10 +783,10 @@ class ChannelCollection {
|
|
|
746
783
|
async updateStateBeforeGC() {
|
|
747
784
|
for (const id of this.dataStoresSinceLastGC) {
|
|
748
785
|
const context = this.contexts.get(id);
|
|
749
|
-
(0,
|
|
786
|
+
(0, internal_1.assert)(context !== undefined, 0x2b6 /* Missing data store context */);
|
|
750
787
|
if (await context.isRoot()) {
|
|
751
788
|
// A root data store is basically a reference from the container runtime to the data store.
|
|
752
|
-
const handle = new
|
|
789
|
+
const handle = new internal_2.FluidObjectHandle(context, id, this.parentContext.IFluidHandleContext);
|
|
753
790
|
this.parentContext.addedGCOutboundReference?.(this.containerRuntimeHandle, handle);
|
|
754
791
|
}
|
|
755
792
|
}
|
|
@@ -769,7 +806,7 @@ class ChannelCollection {
|
|
|
769
806
|
* @param fullGC - true to bypass optimizations and force full generation of GC data.
|
|
770
807
|
*/
|
|
771
808
|
async getGCData(fullGC = false) {
|
|
772
|
-
const builder = new
|
|
809
|
+
const builder = new internal_5.GCDataBuilder();
|
|
773
810
|
// Iterate over each store and get their GC data.
|
|
774
811
|
await Promise.all(Array.from(this.contexts)
|
|
775
812
|
.filter(([_, context]) => {
|
|
@@ -778,7 +815,7 @@ class ChannelCollection {
|
|
|
778
815
|
// had not yet round tripped back to the client.
|
|
779
816
|
// Formerly assert 0x589
|
|
780
817
|
if (context.attachState === container_definitions_1.AttachState.Attaching) {
|
|
781
|
-
const error =
|
|
818
|
+
const error = internal_6.DataProcessingError.create("Local data store detected in attaching state while running GC", "getGCData");
|
|
782
819
|
throw error;
|
|
783
820
|
}
|
|
784
821
|
return context.attachState === container_definitions_1.AttachState.Attached;
|
|
@@ -799,35 +836,24 @@ class ChannelCollection {
|
|
|
799
836
|
*/
|
|
800
837
|
updateUsedRoutes(usedRoutes) {
|
|
801
838
|
// Get a map of data store ids to routes used in it.
|
|
802
|
-
const usedDataStoreRoutes = (0,
|
|
839
|
+
const usedDataStoreRoutes = (0, internal_5.unpackChildNodesUsedRoutes)(usedRoutes);
|
|
803
840
|
// Verify that the used routes are correct.
|
|
804
841
|
for (const [id] of usedDataStoreRoutes) {
|
|
805
|
-
(0,
|
|
842
|
+
(0, internal_1.assert)(this.contexts.has(id), 0x167 /* "Used route does not belong to any known data store" */);
|
|
806
843
|
}
|
|
807
844
|
// Update the used routes in each data store. Used routes is empty for unused data stores.
|
|
808
845
|
for (const [contextId, context] of this.contexts) {
|
|
809
846
|
context.updateUsedRoutes(usedDataStoreRoutes.get(contextId) ?? []);
|
|
810
847
|
}
|
|
811
848
|
}
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
// store based on its DDS being unused.
|
|
821
|
-
if (pathParts.length > 2) {
|
|
822
|
-
continue;
|
|
823
|
-
}
|
|
824
|
-
const dataStoreId = pathParts[1];
|
|
825
|
-
(0, core_utils_1.assert)(this.contexts.has(dataStoreId), 0x2d7 /* No data store with specified id */);
|
|
826
|
-
// Delete the contexts of unused data stores.
|
|
827
|
-
this.contexts.delete(dataStoreId);
|
|
828
|
-
// Delete the summarizer node of the unused data stores.
|
|
829
|
-
this.parentContext.deleteChildSummarizerNode?.(dataStoreId);
|
|
830
|
-
}
|
|
849
|
+
deleteChild(dataStoreId) {
|
|
850
|
+
const dataStoreContext = this.contexts.get(dataStoreId);
|
|
851
|
+
(0, internal_1.assert)(dataStoreContext !== undefined, 0x2d7 /* No data store with specified id */);
|
|
852
|
+
dataStoreContext.delete();
|
|
853
|
+
// Delete the contexts of unused data stores.
|
|
854
|
+
this.contexts.delete(dataStoreId);
|
|
855
|
+
// Delete the summarizer node of the unused data stores.
|
|
856
|
+
this.parentContext.deleteChildSummarizerNode(dataStoreId);
|
|
831
857
|
}
|
|
832
858
|
/**
|
|
833
859
|
* Delete data stores and its objects that are sweep ready.
|
|
@@ -854,16 +880,12 @@ class ChannelCollection {
|
|
|
854
880
|
this.mc.logger.sendTelemetryEvent({
|
|
855
881
|
eventName: "DeletedDataStoreNotFound",
|
|
856
882
|
category: alreadyDeleted ? "generic" : "error",
|
|
857
|
-
...(0,
|
|
883
|
+
...(0, internal_6.tagCodeArtifacts)({ id: dataStoreId }),
|
|
858
884
|
details: { alreadyDeleted },
|
|
859
885
|
});
|
|
860
886
|
continue;
|
|
861
887
|
}
|
|
862
|
-
|
|
863
|
-
// Delete the contexts of sweep ready data stores.
|
|
864
|
-
this.contexts.delete(dataStoreId);
|
|
865
|
-
// Delete the summarizer node of the sweep ready data stores.
|
|
866
|
-
this.parentContext.deleteChildSummarizerNode?.(dataStoreId);
|
|
888
|
+
this.deleteChild(dataStoreId);
|
|
867
889
|
}
|
|
868
890
|
return Array.from(sweepReadyDataStoreRoutes);
|
|
869
891
|
}
|
|
@@ -884,7 +906,7 @@ class ChannelCollection {
|
|
|
884
906
|
continue;
|
|
885
907
|
}
|
|
886
908
|
const dataStoreId = pathParts[1];
|
|
887
|
-
(0,
|
|
909
|
+
(0, internal_1.assert)(this.contexts.has(dataStoreId), 0x510 /* No data store with specified id */);
|
|
888
910
|
tombstonedDataStoresSet.add(dataStoreId);
|
|
889
911
|
}
|
|
890
912
|
// Update the used routes in each data store. Used routes is empty for unused data stores.
|
|
@@ -898,8 +920,9 @@ class ChannelCollection {
|
|
|
898
920
|
*/
|
|
899
921
|
async getOutboundRoutes() {
|
|
900
922
|
const outboundRoutes = [];
|
|
923
|
+
// Getting this information is a performance optimization that reduces network calls for virtualized datastores
|
|
901
924
|
for (const [contextId, context] of this.contexts) {
|
|
902
|
-
const isRootDataStore = await context.isRoot();
|
|
925
|
+
const isRootDataStore = await context.isRoot(this.aliasedDataStores);
|
|
903
926
|
if (isRootDataStore) {
|
|
904
927
|
outboundRoutes.push(`/${contextId}`);
|
|
905
928
|
}
|
|
@@ -935,7 +958,7 @@ class ChannelCollection {
|
|
|
935
958
|
return this.aliases.get(maybeAlias) ?? maybeAlias;
|
|
936
959
|
}
|
|
937
960
|
async request(request) {
|
|
938
|
-
const requestParser =
|
|
961
|
+
const requestParser = internal_5.RequestParser.create(request);
|
|
939
962
|
const id = requestParser.pathParts[0];
|
|
940
963
|
// Differentiate between requesting the dataStore directly, or one of its children
|
|
941
964
|
const requestForChild = !requestParser.isLeaf(1);
|
|
@@ -971,7 +994,7 @@ class ChannelCollection {
|
|
|
971
994
|
const subRequest = requestParser.createSubRequest(1);
|
|
972
995
|
// We always expect createSubRequest to include a leading slash, but asserting here to protect against
|
|
973
996
|
// unintentionally modifying the url if that changes.
|
|
974
|
-
(0,
|
|
997
|
+
(0, internal_1.assert)(subRequest.url.startsWith("/"), 0x126 /* "Expected createSubRequest url to include a leading slash" */);
|
|
975
998
|
return dataStore.request(subRequest);
|
|
976
999
|
}
|
|
977
1000
|
}
|
|
@@ -981,8 +1004,8 @@ function getSummaryForDatastores(snapshot, metadata) {
|
|
|
981
1004
|
return undefined;
|
|
982
1005
|
}
|
|
983
1006
|
if ((0, index_js_2.rootHasIsolatedChannels)(metadata)) {
|
|
984
|
-
const datastoresSnapshot = snapshot.trees[
|
|
985
|
-
(0,
|
|
1007
|
+
const datastoresSnapshot = snapshot.trees[internal_4.channelsTreeName];
|
|
1008
|
+
(0, internal_1.assert)(!!datastoresSnapshot, 0x168 /* Expected tree in snapshot not found */);
|
|
986
1009
|
return datastoresSnapshot;
|
|
987
1010
|
}
|
|
988
1011
|
else {
|
|
@@ -1005,7 +1028,7 @@ exports.getSummaryForDatastores = getSummaryForDatastores;
|
|
|
1005
1028
|
*
|
|
1006
1029
|
* @internal
|
|
1007
1030
|
*/
|
|
1008
|
-
function detectOutboundReferences(
|
|
1031
|
+
function detectOutboundReferences(address, contents, addedOutboundReference) {
|
|
1009
1032
|
// These will be built up as we traverse the envelope contents
|
|
1010
1033
|
const outboundPaths = [];
|
|
1011
1034
|
let ddsAddress;
|
|
@@ -1013,7 +1036,7 @@ function detectOutboundReferences(envelope, addedOutboundReference) {
|
|
|
1013
1036
|
if (typeof obj === "object" && obj !== null) {
|
|
1014
1037
|
for (const [key, value] of Object.entries(obj)) {
|
|
1015
1038
|
// If 'value' is a serialized IFluidHandle, it represents a new outbound route.
|
|
1016
|
-
if ((0,
|
|
1039
|
+
if ((0, internal_5.isSerializedHandle)(value)) {
|
|
1017
1040
|
outboundPaths.push(value.url);
|
|
1018
1041
|
}
|
|
1019
1042
|
// NOTE: This is taking a hard dependency on the fact that in our DataStore implementation,
|
|
@@ -1026,10 +1049,10 @@ function detectOutboundReferences(envelope, addedOutboundReference) {
|
|
|
1026
1049
|
}
|
|
1027
1050
|
}
|
|
1028
1051
|
}
|
|
1029
|
-
recursivelyFindHandles(
|
|
1052
|
+
recursivelyFindHandles(contents);
|
|
1030
1053
|
// GC node paths are all absolute paths, hence the "" prefix.
|
|
1031
1054
|
// e.g. this will yield "/dataStoreId/ddsId"
|
|
1032
|
-
const fromPath = ["",
|
|
1055
|
+
const fromPath = ["", address, ddsAddress].join("/");
|
|
1033
1056
|
outboundPaths.forEach((toPath) => addedOutboundReference(fromPath, toPath));
|
|
1034
1057
|
}
|
|
1035
1058
|
exports.detectOutboundReferences = detectOutboundReferences;
|
|
@@ -1037,8 +1060,9 @@ exports.detectOutboundReferences = detectOutboundReferences;
|
|
|
1037
1060
|
class ChannelCollectionFactory {
|
|
1038
1061
|
constructor(registryEntries,
|
|
1039
1062
|
// ADO:7302 We need a better type here
|
|
1040
|
-
provideEntryPoint) {
|
|
1063
|
+
provideEntryPoint, ctor) {
|
|
1041
1064
|
this.provideEntryPoint = provideEntryPoint;
|
|
1065
|
+
this.ctor = ctor;
|
|
1042
1066
|
this.type = "ChannelCollectionChannel";
|
|
1043
1067
|
this.IFluidDataStoreRegistry = new dataStoreRegistry_js_1.FluidDataStoreRegistry(registryEntries);
|
|
1044
1068
|
}
|
|
@@ -1046,7 +1070,7 @@ class ChannelCollectionFactory {
|
|
|
1046
1070
|
return this;
|
|
1047
1071
|
}
|
|
1048
1072
|
async instantiateDataStore(context, _existing) {
|
|
1049
|
-
const runtime =
|
|
1073
|
+
const runtime = this.ctor(context.baseSnapshot, context, // parentContext
|
|
1050
1074
|
context.logger, () => { }, // gcNodeUpdated
|
|
1051
1075
|
(_nodePath) => false, // isDataStoreDeleted
|
|
1052
1076
|
new Map(), // aliasMap
|