@fluidframework/container-runtime 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.1
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 +155 -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 +169 -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 +96 -106
- 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 +107 -52
- 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 +180 -165
- 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 +195 -93
- 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,23 +504,27 @@ 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
|
const { id, snapshot } = message;
|
|
524
525
|
// build the snapshot from the summary in the attach message
|
|
525
526
|
const flatAttachBlobs = new Map();
|
|
526
|
-
const snapshotTree = (0,
|
|
527
|
+
const snapshotTree = (0, internal_3.buildSnapshotTree)(snapshot.entries, flatAttachBlobs);
|
|
527
528
|
const storage = new storageServiceWithAttachBlobs_js_1.StorageServiceWithAttachBlobs(this.parentContext.storage, flatAttachBlobs);
|
|
528
529
|
// create a local datastore context for the data store context,
|
|
529
530
|
// which this message represents. All newly created data store
|
|
@@ -537,11 +538,10 @@ class ChannelCollection {
|
|
|
537
538
|
storage,
|
|
538
539
|
scope: this.parentContext.scope,
|
|
539
540
|
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(id, {
|
|
540
|
-
type:
|
|
541
|
+
type: internal_4.CreateSummarizerNodeSource.FromSummary,
|
|
541
542
|
}),
|
|
542
543
|
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),
|
|
543
544
|
snapshotTree,
|
|
544
|
-
isRootDataStore: false,
|
|
545
545
|
});
|
|
546
546
|
// realize the local context, as local contexts shouldn't be delay
|
|
547
547
|
// loaded, as this client is playing the role of creating client,
|
|
@@ -566,59 +566,63 @@ class ChannelCollection {
|
|
|
566
566
|
case messageTypes_js_1.ContainerMessageType.Alias:
|
|
567
567
|
this.processAliasMessage(message, localMessageMetadata, local);
|
|
568
568
|
return;
|
|
569
|
-
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
|
+
}
|
|
570
585
|
break;
|
|
586
|
+
}
|
|
571
587
|
default:
|
|
572
|
-
(0,
|
|
588
|
+
(0, internal_1.assert)(false, 0x8e9 /* unreached */);
|
|
573
589
|
}
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
const
|
|
577
|
-
...message,
|
|
578
|
-
type: innerContents.type,
|
|
579
|
-
contents: innerContents.content,
|
|
580
|
-
};
|
|
581
|
-
const context = this.contexts.get(envelope.address);
|
|
590
|
+
}
|
|
591
|
+
processChannelOp(address, message, local, localMessageMetadata) {
|
|
592
|
+
const context = this.contexts.get(address);
|
|
582
593
|
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
583
594
|
// corruption in case a deleted data store accidentally submitted an op.
|
|
584
|
-
if (this.checkAndLogIfDeleted(
|
|
595
|
+
if (this.checkAndLogIfDeleted(address, context, "Changed", "processFluidDataStoreOp")) {
|
|
585
596
|
return;
|
|
586
597
|
}
|
|
587
598
|
if (context === undefined) {
|
|
588
599
|
// Former assert 0x162
|
|
589
|
-
throw
|
|
600
|
+
throw internal_6.DataProcessingError.create("No context for op", "processFluidDataStoreOp", message, {
|
|
590
601
|
local,
|
|
591
602
|
messageDetails: JSON.stringify({
|
|
592
603
|
type: message.type,
|
|
593
604
|
contentType: typeof message.contents,
|
|
594
605
|
}),
|
|
595
|
-
...(0,
|
|
606
|
+
...(0, internal_6.tagCodeArtifacts)({ address }),
|
|
596
607
|
});
|
|
597
608
|
}
|
|
598
|
-
context.process(
|
|
599
|
-
// By default, we use the new behavior of detecting outbound routes here.
|
|
600
|
-
// If this setting is true, then DataStoreContext would be notifying GC instead.
|
|
601
|
-
if (this.mc.config.getBoolean(index_js_1.detectOutboundRoutesViaDDSKey) !== true &&
|
|
602
|
-
addedOutboundReference !== undefined) {
|
|
603
|
-
// Notify GC of any outbound references that were added by this op.
|
|
604
|
-
detectOutboundReferences(envelope, addedOutboundReference);
|
|
605
|
-
}
|
|
609
|
+
context.process(message, local, localMessageMetadata);
|
|
606
610
|
// Notify that a GC node for the data store changed. This is used to detect if a deleted data store is
|
|
607
611
|
// being used.
|
|
608
|
-
this.gcNodeUpdated(`/${
|
|
612
|
+
this.gcNodeUpdated(`/${address}`, "Changed", message.timestamp, context.isLoaded ? context.packagePath : undefined);
|
|
609
613
|
}
|
|
610
614
|
async getDataStore(id, requestHeaderData) {
|
|
611
615
|
const headerData = { ...containerRuntime_js_1.defaultRuntimeHeaderData, ...requestHeaderData };
|
|
612
616
|
if (this.checkAndLogIfDeleted(id, this.contexts.get(id), "Requested", "getDataStore", requestHeaderData)) {
|
|
613
617
|
// The requested data store has been deleted by gc. Create a 404 response exception.
|
|
614
618
|
const request = { url: id };
|
|
615
|
-
throw (0,
|
|
619
|
+
throw (0, internal_5.responseToException)((0, internal_5.createResponseError)(404, "DataStore was deleted", request), request);
|
|
616
620
|
}
|
|
617
621
|
const context = await this.contexts.getBoundOrRemoted(id, headerData.wait);
|
|
618
622
|
if (context === undefined) {
|
|
619
623
|
// The requested data store does not exits. Throw a 404 response exception.
|
|
620
624
|
const request = { url: id };
|
|
621
|
-
throw (0,
|
|
625
|
+
throw (0, internal_5.responseToException)((0, internal_5.create404Response)(request), request);
|
|
622
626
|
}
|
|
623
627
|
return context;
|
|
624
628
|
}
|
|
@@ -652,7 +656,7 @@ class ChannelCollection {
|
|
|
652
656
|
}
|
|
653
657
|
this.mc.logger.sendErrorEvent({
|
|
654
658
|
eventName: `GC_Deleted_DataStore_${deletedLogSuffix}`,
|
|
655
|
-
...(0,
|
|
659
|
+
...(0, internal_6.tagCodeArtifacts)({ id }),
|
|
656
660
|
callSite,
|
|
657
661
|
headers: JSON.stringify(requestHeaderData),
|
|
658
662
|
exists: context !== undefined,
|
|
@@ -671,10 +675,10 @@ class ChannelCollection {
|
|
|
671
675
|
}
|
|
672
676
|
if (!context) {
|
|
673
677
|
// Attach message may not have been processed yet
|
|
674
|
-
(0,
|
|
678
|
+
(0, internal_1.assert)(!local, 0x163 /* "Missing datastore for local signal" */);
|
|
675
679
|
this.mc.logger.sendTelemetryEvent({
|
|
676
680
|
eventName: "SignalFluidDataStoreNotFound",
|
|
677
|
-
...(0,
|
|
681
|
+
...(0, internal_6.tagCodeArtifacts)({
|
|
678
682
|
fluidDataStoreId,
|
|
679
683
|
}),
|
|
680
684
|
});
|
|
@@ -691,7 +695,7 @@ class ChannelCollection {
|
|
|
691
695
|
this.mc.logger.sendErrorEvent({
|
|
692
696
|
eventName: "SetConnectionStateError",
|
|
693
697
|
clientId,
|
|
694
|
-
...(0,
|
|
698
|
+
...(0, internal_6.tagCodeArtifacts)({
|
|
695
699
|
fluidDataStoreId,
|
|
696
700
|
}),
|
|
697
701
|
details: JSON.stringify({
|
|
@@ -703,11 +707,10 @@ class ChannelCollection {
|
|
|
703
707
|
}
|
|
704
708
|
}
|
|
705
709
|
setAttachState(attachState) {
|
|
706
|
-
const eventName = attachState === container_definitions_1.AttachState.Attaching ? "attaching" : "attached";
|
|
707
710
|
for (const [, context] of this.contexts) {
|
|
708
711
|
// Fire only for bounded stores.
|
|
709
712
|
if (!this.contexts.isNotBound(context.id)) {
|
|
710
|
-
context.
|
|
713
|
+
context.setAttachState(attachState);
|
|
711
714
|
}
|
|
712
715
|
}
|
|
713
716
|
}
|
|
@@ -715,7 +718,7 @@ class ChannelCollection {
|
|
|
715
718
|
return this.contexts.size;
|
|
716
719
|
}
|
|
717
720
|
async summarize(fullTree, trackState, telemetryContext) {
|
|
718
|
-
const summaryBuilder = new
|
|
721
|
+
const summaryBuilder = new internal_5.SummaryTreeBuilder();
|
|
719
722
|
// Iterate over each store and ask it to snapshot
|
|
720
723
|
await Promise.all(Array.from(this.contexts)
|
|
721
724
|
.filter(([_, context]) => {
|
|
@@ -724,7 +727,7 @@ class ChannelCollection {
|
|
|
724
727
|
// had not yet round tripped back to the client.
|
|
725
728
|
if (context.attachState === container_definitions_1.AttachState.Attaching) {
|
|
726
729
|
// Formerly assert 0x588
|
|
727
|
-
const error =
|
|
730
|
+
const error = internal_6.DataProcessingError.create("Local data store detected in attaching state during summarize", "summarize");
|
|
728
731
|
throw error;
|
|
729
732
|
}
|
|
730
733
|
return context.attachState === container_definitions_1.AttachState.Attached;
|
|
@@ -739,7 +742,7 @@ class ChannelCollection {
|
|
|
739
742
|
* Create a summary. Used when attaching or serializing a detached container.
|
|
740
743
|
*/
|
|
741
744
|
getAttachSummary(telemetryContext) {
|
|
742
|
-
const builder = new
|
|
745
|
+
const builder = new internal_5.SummaryTreeBuilder();
|
|
743
746
|
// Attaching graph of some stores can cause other stores to get bound too.
|
|
744
747
|
// So keep taking summary until no new stores get bound.
|
|
745
748
|
let notBoundContextsLength;
|
|
@@ -764,8 +767,8 @@ class ChannelCollection {
|
|
|
764
767
|
else {
|
|
765
768
|
// If this data store is not yet loaded, then there should be no changes in the snapshot from
|
|
766
769
|
// which it was created as it is detached container. So just use the previous snapshot.
|
|
767
|
-
(0,
|
|
768
|
-
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]);
|
|
769
772
|
}
|
|
770
773
|
builder.addWithStats(key, dataStoreSummary);
|
|
771
774
|
});
|
|
@@ -780,10 +783,10 @@ class ChannelCollection {
|
|
|
780
783
|
async updateStateBeforeGC() {
|
|
781
784
|
for (const id of this.dataStoresSinceLastGC) {
|
|
782
785
|
const context = this.contexts.get(id);
|
|
783
|
-
(0,
|
|
786
|
+
(0, internal_1.assert)(context !== undefined, 0x2b6 /* Missing data store context */);
|
|
784
787
|
if (await context.isRoot()) {
|
|
785
788
|
// A root data store is basically a reference from the container runtime to the data store.
|
|
786
|
-
const handle = new
|
|
789
|
+
const handle = new internal_2.FluidObjectHandle(context, id, this.parentContext.IFluidHandleContext);
|
|
787
790
|
this.parentContext.addedGCOutboundReference?.(this.containerRuntimeHandle, handle);
|
|
788
791
|
}
|
|
789
792
|
}
|
|
@@ -803,7 +806,7 @@ class ChannelCollection {
|
|
|
803
806
|
* @param fullGC - true to bypass optimizations and force full generation of GC data.
|
|
804
807
|
*/
|
|
805
808
|
async getGCData(fullGC = false) {
|
|
806
|
-
const builder = new
|
|
809
|
+
const builder = new internal_5.GCDataBuilder();
|
|
807
810
|
// Iterate over each store and get their GC data.
|
|
808
811
|
await Promise.all(Array.from(this.contexts)
|
|
809
812
|
.filter(([_, context]) => {
|
|
@@ -812,7 +815,7 @@ class ChannelCollection {
|
|
|
812
815
|
// had not yet round tripped back to the client.
|
|
813
816
|
// Formerly assert 0x589
|
|
814
817
|
if (context.attachState === container_definitions_1.AttachState.Attaching) {
|
|
815
|
-
const error =
|
|
818
|
+
const error = internal_6.DataProcessingError.create("Local data store detected in attaching state while running GC", "getGCData");
|
|
816
819
|
throw error;
|
|
817
820
|
}
|
|
818
821
|
return context.attachState === container_definitions_1.AttachState.Attached;
|
|
@@ -833,35 +836,24 @@ class ChannelCollection {
|
|
|
833
836
|
*/
|
|
834
837
|
updateUsedRoutes(usedRoutes) {
|
|
835
838
|
// Get a map of data store ids to routes used in it.
|
|
836
|
-
const usedDataStoreRoutes = (0,
|
|
839
|
+
const usedDataStoreRoutes = (0, internal_5.unpackChildNodesUsedRoutes)(usedRoutes);
|
|
837
840
|
// Verify that the used routes are correct.
|
|
838
841
|
for (const [id] of usedDataStoreRoutes) {
|
|
839
|
-
(0,
|
|
842
|
+
(0, internal_1.assert)(this.contexts.has(id), 0x167 /* "Used route does not belong to any known data store" */);
|
|
840
843
|
}
|
|
841
844
|
// Update the used routes in each data store. Used routes is empty for unused data stores.
|
|
842
845
|
for (const [contextId, context] of this.contexts) {
|
|
843
846
|
context.updateUsedRoutes(usedDataStoreRoutes.get(contextId) ?? []);
|
|
844
847
|
}
|
|
845
848
|
}
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
// store based on its DDS being unused.
|
|
855
|
-
if (pathParts.length > 2) {
|
|
856
|
-
continue;
|
|
857
|
-
}
|
|
858
|
-
const dataStoreId = pathParts[1];
|
|
859
|
-
(0, core_utils_1.assert)(this.contexts.has(dataStoreId), 0x2d7 /* No data store with specified id */);
|
|
860
|
-
// Delete the contexts of unused data stores.
|
|
861
|
-
this.contexts.delete(dataStoreId);
|
|
862
|
-
// Delete the summarizer node of the unused data stores.
|
|
863
|
-
this.parentContext.deleteChildSummarizerNode?.(dataStoreId);
|
|
864
|
-
}
|
|
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);
|
|
865
857
|
}
|
|
866
858
|
/**
|
|
867
859
|
* Delete data stores and its objects that are sweep ready.
|
|
@@ -888,16 +880,12 @@ class ChannelCollection {
|
|
|
888
880
|
this.mc.logger.sendTelemetryEvent({
|
|
889
881
|
eventName: "DeletedDataStoreNotFound",
|
|
890
882
|
category: alreadyDeleted ? "generic" : "error",
|
|
891
|
-
...(0,
|
|
883
|
+
...(0, internal_6.tagCodeArtifacts)({ id: dataStoreId }),
|
|
892
884
|
details: { alreadyDeleted },
|
|
893
885
|
});
|
|
894
886
|
continue;
|
|
895
887
|
}
|
|
896
|
-
|
|
897
|
-
// Delete the contexts of sweep ready data stores.
|
|
898
|
-
this.contexts.delete(dataStoreId);
|
|
899
|
-
// Delete the summarizer node of the sweep ready data stores.
|
|
900
|
-
this.parentContext.deleteChildSummarizerNode?.(dataStoreId);
|
|
888
|
+
this.deleteChild(dataStoreId);
|
|
901
889
|
}
|
|
902
890
|
return Array.from(sweepReadyDataStoreRoutes);
|
|
903
891
|
}
|
|
@@ -918,7 +906,7 @@ class ChannelCollection {
|
|
|
918
906
|
continue;
|
|
919
907
|
}
|
|
920
908
|
const dataStoreId = pathParts[1];
|
|
921
|
-
(0,
|
|
909
|
+
(0, internal_1.assert)(this.contexts.has(dataStoreId), 0x510 /* No data store with specified id */);
|
|
922
910
|
tombstonedDataStoresSet.add(dataStoreId);
|
|
923
911
|
}
|
|
924
912
|
// Update the used routes in each data store. Used routes is empty for unused data stores.
|
|
@@ -932,8 +920,9 @@ class ChannelCollection {
|
|
|
932
920
|
*/
|
|
933
921
|
async getOutboundRoutes() {
|
|
934
922
|
const outboundRoutes = [];
|
|
923
|
+
// Getting this information is a performance optimization that reduces network calls for virtualized datastores
|
|
935
924
|
for (const [contextId, context] of this.contexts) {
|
|
936
|
-
const isRootDataStore = await context.isRoot();
|
|
925
|
+
const isRootDataStore = await context.isRoot(this.aliasedDataStores);
|
|
937
926
|
if (isRootDataStore) {
|
|
938
927
|
outboundRoutes.push(`/${contextId}`);
|
|
939
928
|
}
|
|
@@ -969,7 +958,7 @@ class ChannelCollection {
|
|
|
969
958
|
return this.aliases.get(maybeAlias) ?? maybeAlias;
|
|
970
959
|
}
|
|
971
960
|
async request(request) {
|
|
972
|
-
const requestParser =
|
|
961
|
+
const requestParser = internal_5.RequestParser.create(request);
|
|
973
962
|
const id = requestParser.pathParts[0];
|
|
974
963
|
// Differentiate between requesting the dataStore directly, or one of its children
|
|
975
964
|
const requestForChild = !requestParser.isLeaf(1);
|
|
@@ -1005,7 +994,7 @@ class ChannelCollection {
|
|
|
1005
994
|
const subRequest = requestParser.createSubRequest(1);
|
|
1006
995
|
// We always expect createSubRequest to include a leading slash, but asserting here to protect against
|
|
1007
996
|
// unintentionally modifying the url if that changes.
|
|
1008
|
-
(0,
|
|
997
|
+
(0, internal_1.assert)(subRequest.url.startsWith("/"), 0x126 /* "Expected createSubRequest url to include a leading slash" */);
|
|
1009
998
|
return dataStore.request(subRequest);
|
|
1010
999
|
}
|
|
1011
1000
|
}
|
|
@@ -1015,8 +1004,8 @@ function getSummaryForDatastores(snapshot, metadata) {
|
|
|
1015
1004
|
return undefined;
|
|
1016
1005
|
}
|
|
1017
1006
|
if ((0, index_js_2.rootHasIsolatedChannels)(metadata)) {
|
|
1018
|
-
const datastoresSnapshot = snapshot.trees[
|
|
1019
|
-
(0,
|
|
1007
|
+
const datastoresSnapshot = snapshot.trees[internal_4.channelsTreeName];
|
|
1008
|
+
(0, internal_1.assert)(!!datastoresSnapshot, 0x168 /* Expected tree in snapshot not found */);
|
|
1020
1009
|
return datastoresSnapshot;
|
|
1021
1010
|
}
|
|
1022
1011
|
else {
|
|
@@ -1039,7 +1028,7 @@ exports.getSummaryForDatastores = getSummaryForDatastores;
|
|
|
1039
1028
|
*
|
|
1040
1029
|
* @internal
|
|
1041
1030
|
*/
|
|
1042
|
-
function detectOutboundReferences(
|
|
1031
|
+
function detectOutboundReferences(address, contents, addedOutboundReference) {
|
|
1043
1032
|
// These will be built up as we traverse the envelope contents
|
|
1044
1033
|
const outboundPaths = [];
|
|
1045
1034
|
let ddsAddress;
|
|
@@ -1047,7 +1036,7 @@ function detectOutboundReferences(envelope, addedOutboundReference) {
|
|
|
1047
1036
|
if (typeof obj === "object" && obj !== null) {
|
|
1048
1037
|
for (const [key, value] of Object.entries(obj)) {
|
|
1049
1038
|
// If 'value' is a serialized IFluidHandle, it represents a new outbound route.
|
|
1050
|
-
if ((0,
|
|
1039
|
+
if ((0, internal_5.isSerializedHandle)(value)) {
|
|
1051
1040
|
outboundPaths.push(value.url);
|
|
1052
1041
|
}
|
|
1053
1042
|
// NOTE: This is taking a hard dependency on the fact that in our DataStore implementation,
|
|
@@ -1060,10 +1049,10 @@ function detectOutboundReferences(envelope, addedOutboundReference) {
|
|
|
1060
1049
|
}
|
|
1061
1050
|
}
|
|
1062
1051
|
}
|
|
1063
|
-
recursivelyFindHandles(
|
|
1052
|
+
recursivelyFindHandles(contents);
|
|
1064
1053
|
// GC node paths are all absolute paths, hence the "" prefix.
|
|
1065
1054
|
// e.g. this will yield "/dataStoreId/ddsId"
|
|
1066
|
-
const fromPath = ["",
|
|
1055
|
+
const fromPath = ["", address, ddsAddress].join("/");
|
|
1067
1056
|
outboundPaths.forEach((toPath) => addedOutboundReference(fromPath, toPath));
|
|
1068
1057
|
}
|
|
1069
1058
|
exports.detectOutboundReferences = detectOutboundReferences;
|
|
@@ -1071,8 +1060,9 @@ exports.detectOutboundReferences = detectOutboundReferences;
|
|
|
1071
1060
|
class ChannelCollectionFactory {
|
|
1072
1061
|
constructor(registryEntries,
|
|
1073
1062
|
// ADO:7302 We need a better type here
|
|
1074
|
-
provideEntryPoint) {
|
|
1063
|
+
provideEntryPoint, ctor) {
|
|
1075
1064
|
this.provideEntryPoint = provideEntryPoint;
|
|
1065
|
+
this.ctor = ctor;
|
|
1076
1066
|
this.type = "ChannelCollectionChannel";
|
|
1077
1067
|
this.IFluidDataStoreRegistry = new dataStoreRegistry_js_1.FluidDataStoreRegistry(registryEntries);
|
|
1078
1068
|
}
|
|
@@ -1080,7 +1070,7 @@ class ChannelCollectionFactory {
|
|
|
1080
1070
|
return this;
|
|
1081
1071
|
}
|
|
1082
1072
|
async instantiateDataStore(context, _existing) {
|
|
1083
|
-
const runtime =
|
|
1073
|
+
const runtime = this.ctor(context.baseSnapshot, context, // parentContext
|
|
1084
1074
|
context.logger, () => { }, // gcNodeUpdated
|
|
1085
1075
|
(_nodePath) => false, // isDataStoreDeleted
|
|
1086
1076
|
new Map(), // aliasMap
|