@fluidframework/container-runtime 2.0.0-internal.6.1.1 → 2.0.0-internal.6.3.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 +39 -0
- package/README.md +4 -3
- package/dist/batchTracker.d.ts +1 -1
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +5 -4
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +4 -21
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +119 -185
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +13 -12
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +99 -16
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +380 -242
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +4 -5
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +2 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +40 -41
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +1 -2
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +7 -8
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.js +2 -2
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +23 -25
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaManagerProxyBase.d.ts +1 -1
- package/dist/deltaManagerProxyBase.js +2 -2
- package/dist/deltaManagerProxyBase.js.map +1 -1
- package/dist/deltaScheduler.js +6 -6
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/error.d.ts +14 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +21 -0
- package/dist/error.js.map +1 -0
- package/dist/gc/garbageCollection.d.ts +4 -6
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +26 -25
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +5 -3
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +4 -2
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.js +7 -7
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts +4 -7
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +15 -52
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +2 -0
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +4 -4
- 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 +1 -2
- package/dist/gc/index.js.map +1 -1
- package/dist/id-compressor/appendOnlySortedMap.d.ts +8 -30
- package/dist/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
- package/dist/id-compressor/appendOnlySortedMap.js +26 -68
- package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/dist/id-compressor/finalSpace.d.ts +29 -0
- package/dist/id-compressor/finalSpace.d.ts.map +1 -0
- package/dist/id-compressor/finalSpace.js +62 -0
- package/dist/id-compressor/finalSpace.js.map +1 -0
- package/dist/id-compressor/idCompressor.d.ts +25 -250
- package/dist/id-compressor/idCompressor.d.ts.map +1 -1
- package/dist/id-compressor/idCompressor.js +387 -1150
- package/dist/id-compressor/idCompressor.js.map +1 -1
- package/dist/id-compressor/identifiers.d.ts +32 -0
- package/dist/id-compressor/identifiers.d.ts.map +1 -0
- package/dist/id-compressor/identifiers.js +15 -0
- package/dist/id-compressor/identifiers.js.map +1 -0
- package/dist/id-compressor/index.d.ts +5 -6
- package/dist/id-compressor/index.d.ts.map +1 -1
- package/dist/id-compressor/index.js +20 -26
- package/dist/id-compressor/index.js.map +1 -1
- package/dist/id-compressor/persistanceUtilities.d.ts +22 -0
- package/dist/id-compressor/persistanceUtilities.d.ts.map +1 -0
- package/dist/id-compressor/persistanceUtilities.js +43 -0
- package/dist/id-compressor/persistanceUtilities.js.map +1 -0
- package/dist/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
- package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
- package/dist/id-compressor/sessionSpaceNormalizer.js +80 -0
- package/dist/id-compressor/sessionSpaceNormalizer.js.map +1 -0
- package/dist/id-compressor/sessions.d.ts +115 -0
- package/dist/id-compressor/sessions.d.ts.map +1 -0
- package/dist/id-compressor/sessions.js +305 -0
- package/dist/id-compressor/sessions.js.map +1 -0
- package/dist/id-compressor/utilities.d.ts +49 -0
- package/dist/id-compressor/utilities.d.ts.map +1 -0
- package/dist/id-compressor/utilities.js +166 -0
- package/dist/id-compressor/utilities.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.js +5 -5
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +11 -10
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +3 -3
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +14 -15
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +1 -0
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +16 -17
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +11 -5
- 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 +12 -5
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +36 -23
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +23 -23
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/index.d.ts +3 -3
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js +2 -1
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +2 -3
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +8 -8
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +3 -3
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +27 -4
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +246 -74
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +6 -5
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +73 -69
- 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 +2 -2
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js +2 -2
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/index.d.ts +1 -1
- package/dist/summary/summarizerNode/index.d.ts.map +1 -1
- package/dist/summary/summarizerNode/index.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +5 -14
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +32 -109
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +6 -30
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +0 -11
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +5 -88
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +38 -25
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +2 -3
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +9 -8
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.js +2 -2
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +10 -4
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +52 -48
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +7 -6
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +30 -22
- package/dist/summary/summaryManager.js.map +1 -1
- package/lib/batchTracker.d.ts +1 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +3 -2
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +4 -21
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +91 -157
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +2 -1
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +99 -16
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +332 -192
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +2 -3
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +2 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +3 -4
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts +1 -2
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +1 -2
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.js +1 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +2 -4
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaManagerProxyBase.d.ts +1 -1
- package/lib/deltaManagerProxyBase.js +1 -1
- package/lib/deltaManagerProxyBase.js.map +1 -1
- package/lib/deltaScheduler.js +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/error.d.ts +14 -0
- package/lib/error.d.ts.map +1 -0
- package/lib/error.js +17 -0
- package/lib/error.js.map +1 -0
- package/lib/gc/garbageCollection.d.ts +4 -6
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +26 -25
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +3 -1
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +4 -2
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.js +1 -1
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts +4 -7
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +16 -53
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +2 -0
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +1 -1
- 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/id-compressor/appendOnlySortedMap.d.ts +8 -30
- package/lib/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
- package/lib/id-compressor/appendOnlySortedMap.js +25 -66
- package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/lib/id-compressor/finalSpace.d.ts +29 -0
- package/lib/id-compressor/finalSpace.d.ts.map +1 -0
- package/lib/id-compressor/finalSpace.js +58 -0
- package/lib/id-compressor/finalSpace.js.map +1 -0
- package/lib/id-compressor/idCompressor.d.ts +25 -250
- package/lib/id-compressor/idCompressor.d.ts.map +1 -1
- package/lib/id-compressor/idCompressor.js +382 -1139
- package/lib/id-compressor/idCompressor.js.map +1 -1
- package/lib/id-compressor/identifiers.d.ts +32 -0
- package/lib/id-compressor/identifiers.d.ts.map +1 -0
- package/lib/id-compressor/identifiers.js +11 -0
- package/lib/id-compressor/identifiers.js.map +1 -0
- package/lib/id-compressor/index.d.ts +5 -6
- package/lib/id-compressor/index.d.ts.map +1 -1
- package/lib/id-compressor/index.js +5 -6
- package/lib/id-compressor/index.js.map +1 -1
- package/lib/id-compressor/persistanceUtilities.d.ts +22 -0
- package/lib/id-compressor/persistanceUtilities.d.ts.map +1 -0
- package/lib/id-compressor/persistanceUtilities.js +34 -0
- package/lib/id-compressor/persistanceUtilities.js.map +1 -0
- package/lib/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
- package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
- package/lib/id-compressor/sessionSpaceNormalizer.js +76 -0
- package/lib/id-compressor/sessionSpaceNormalizer.js.map +1 -0
- package/lib/id-compressor/sessions.d.ts +115 -0
- package/lib/id-compressor/sessions.d.ts.map +1 -0
- package/lib/id-compressor/sessions.js +290 -0
- package/lib/id-compressor/sessions.js.map +1 -0
- package/lib/id-compressor/utilities.d.ts +49 -0
- package/lib/id-compressor/utilities.d.ts.map +1 -0
- package/lib/id-compressor/utilities.js +148 -0
- package/lib/id-compressor/utilities.js.map +1 -0
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/opCompressor.js +3 -3
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +2 -1
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +1 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +2 -3
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +1 -0
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +7 -8
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +12 -6
- 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 +12 -5
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +21 -8
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +3 -3
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/index.d.ts +3 -3
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js +1 -1
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +2 -3
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +3 -3
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +27 -4
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +240 -68
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +6 -5
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +69 -65
- 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 +1 -1
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.js +1 -1
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/index.d.ts +1 -1
- package/lib/summary/summarizerNode/index.d.ts.map +1 -1
- package/lib/summary/summarizerNode/index.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +5 -14
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +16 -93
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +6 -30
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +0 -11
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +3 -86
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +38 -25
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +2 -3
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +2 -1
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.js +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +10 -4
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +46 -42
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +7 -6
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +26 -18
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +30 -29
- package/src/batchTracker.ts +3 -2
- package/src/blobManager.ts +105 -185
- package/src/connectionTelemetry.ts +2 -1
- package/src/containerRuntime.ts +481 -267
- package/src/dataStore.ts +2 -3
- package/src/dataStoreContext.ts +5 -8
- package/src/dataStoreContexts.ts +2 -4
- package/src/dataStoreRegistry.ts +1 -1
- package/src/dataStores.ts +4 -7
- package/src/deltaManagerProxyBase.ts +1 -1
- package/src/deltaScheduler.ts +1 -1
- package/src/error.ts +18 -0
- package/src/gc/garbageCollection.ts +39 -41
- package/src/gc/gcConfigs.ts +4 -2
- package/src/gc/gcDefinitions.ts +4 -6
- package/src/gc/gcHelpers.ts +1 -1
- package/src/gc/gcSummaryStateTracker.ts +19 -65
- package/src/gc/gcTelemetry.ts +2 -0
- package/src/gc/gcUnreferencedStateTracker.ts +1 -1
- package/src/gc/index.ts +0 -1
- package/src/id-compressor/appendOnlySortedMap.ts +26 -87
- package/src/id-compressor/finalSpace.ts +67 -0
- package/src/id-compressor/idCompressor.ts +456 -1681
- package/src/id-compressor/identifiers.ts +42 -0
- package/src/id-compressor/index.ts +11 -20
- package/src/id-compressor/persistanceUtilities.ts +58 -0
- package/src/id-compressor/sessionSpaceNormalizer.ts +83 -0
- package/src/id-compressor/sessions.ts +405 -0
- package/src/id-compressor/utilities.ts +187 -0
- package/src/index.ts +7 -1
- package/src/opLifecycle/opCompressor.ts +3 -3
- package/src/opLifecycle/opDecompressor.ts +2 -1
- package/src/opLifecycle/opGroupingManager.ts +1 -1
- package/src/opLifecycle/opSplitter.ts +4 -4
- package/src/opLifecycle/outbox.ts +14 -11
- package/src/opLifecycle/remoteMessageProcessor.ts +19 -6
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +50 -29
- package/src/scheduleManager.ts +6 -4
- package/src/summary/index.ts +4 -3
- package/src/summary/orderedClientElection.ts +8 -5
- package/src/summary/runWhileConnectedCoordinator.ts +1 -1
- package/src/summary/runningSummarizer.ts +273 -97
- package/src/summary/summarizer.ts +23 -12
- package/src/summary/summarizerClientElection.ts +2 -2
- package/src/summary/summarizerHeuristics.ts +1 -1
- package/src/summary/summarizerNode/index.ts +1 -2
- package/src/summary/summarizerNode/summarizerNode.ts +23 -145
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +7 -38
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +3 -123
- package/src/summary/summarizerTypes.ts +40 -25
- package/src/summary/summaryCollection.ts +3 -3
- package/src/summary/summaryFormat.ts +1 -1
- package/src/summary/summaryGenerator.ts +52 -55
- package/src/summary/summaryManager.ts +36 -13
- package/dist/id-compressor/idRange.d.ts +0 -11
- package/dist/id-compressor/idRange.d.ts.map +0 -1
- package/dist/id-compressor/idRange.js +0 -29
- package/dist/id-compressor/idRange.js.map +0 -1
- package/dist/id-compressor/numericUuid.d.ts +0 -59
- package/dist/id-compressor/numericUuid.d.ts.map +0 -1
- package/dist/id-compressor/numericUuid.js +0 -325
- package/dist/id-compressor/numericUuid.js.map +0 -1
- package/dist/id-compressor/sessionIdNormalizer.d.ts +0 -138
- package/dist/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
- package/dist/id-compressor/sessionIdNormalizer.js +0 -483
- package/dist/id-compressor/sessionIdNormalizer.js.map +0 -1
- package/dist/id-compressor/utils.d.ts +0 -57
- package/dist/id-compressor/utils.d.ts.map +0 -1
- package/dist/id-compressor/utils.js +0 -90
- package/dist/id-compressor/utils.js.map +0 -1
- package/dist/id-compressor/uuidUtilities.d.ts +0 -28
- package/dist/id-compressor/uuidUtilities.d.ts.map +0 -1
- package/dist/id-compressor/uuidUtilities.js +0 -104
- package/dist/id-compressor/uuidUtilities.js.map +0 -1
- package/lib/id-compressor/idRange.d.ts +0 -11
- package/lib/id-compressor/idRange.d.ts.map +0 -1
- package/lib/id-compressor/idRange.js +0 -25
- package/lib/id-compressor/idRange.js.map +0 -1
- package/lib/id-compressor/numericUuid.d.ts +0 -59
- package/lib/id-compressor/numericUuid.d.ts.map +0 -1
- package/lib/id-compressor/numericUuid.js +0 -315
- package/lib/id-compressor/numericUuid.js.map +0 -1
- package/lib/id-compressor/sessionIdNormalizer.d.ts +0 -138
- package/lib/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
- package/lib/id-compressor/sessionIdNormalizer.js +0 -479
- package/lib/id-compressor/sessionIdNormalizer.js.map +0 -1
- package/lib/id-compressor/utils.d.ts +0 -57
- package/lib/id-compressor/utils.d.ts.map +0 -1
- package/lib/id-compressor/utils.js +0 -79
- package/lib/id-compressor/utils.js.map +0 -1
- package/lib/id-compressor/uuidUtilities.d.ts +0 -28
- package/lib/id-compressor/uuidUtilities.d.ts.map +0 -1
- package/lib/id-compressor/uuidUtilities.js +0 -96
- package/lib/id-compressor/uuidUtilities.js.map +0 -1
- package/src/id-compressor/idRange.ts +0 -35
- package/src/id-compressor/numericUuid.ts +0 -383
- package/src/id-compressor/sessionIdNormalizer.ts +0 -609
- package/src/id-compressor/utils.ts +0 -114
- package/src/id-compressor/uuidUtilities.ts +0 -120
package/src/blobManager.ts
CHANGED
|
@@ -17,21 +17,17 @@ import {
|
|
|
17
17
|
responseToException,
|
|
18
18
|
SummaryTreeBuilder,
|
|
19
19
|
} from "@fluidframework/runtime-utils";
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
bufferToString,
|
|
23
|
-
Deferred,
|
|
24
|
-
stringToBuffer,
|
|
25
|
-
TypedEventEmitter,
|
|
26
|
-
} from "@fluidframework/common-utils";
|
|
20
|
+
import { assert, Deferred } from "@fluidframework/core-utils";
|
|
21
|
+
import { bufferToString, stringToBuffer, TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
27
22
|
import {
|
|
28
23
|
IContainerRuntime,
|
|
29
24
|
IContainerRuntimeEvents,
|
|
30
25
|
} from "@fluidframework/container-runtime-definitions";
|
|
31
26
|
import { AttachState, ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
32
27
|
import {
|
|
33
|
-
LoggingError,
|
|
34
28
|
createChildMonitoringContext,
|
|
29
|
+
GenericError,
|
|
30
|
+
LoggingError,
|
|
35
31
|
MonitoringContext,
|
|
36
32
|
PerformanceEvent,
|
|
37
33
|
} from "@fluidframework/telemetry-utils";
|
|
@@ -40,7 +36,7 @@ import {
|
|
|
40
36
|
ISummaryTreeWithStats,
|
|
41
37
|
ITelemetryContext,
|
|
42
38
|
} from "@fluidframework/runtime-definitions";
|
|
43
|
-
|
|
39
|
+
|
|
44
40
|
import { ContainerRuntime, TombstoneResponseHeaderKey } from "./containerRuntime";
|
|
45
41
|
import { sendGCUnexpectedUsageEvent, sweepAttachmentBlobsKey, throwOnTombstoneLoadKey } from "./gc";
|
|
46
42
|
import { Throttler, formExponentialFn, IThrottler } from "./throttler";
|
|
@@ -122,20 +118,12 @@ export type IBlobManagerRuntime = Pick<
|
|
|
122
118
|
Pick<ContainerRuntime, "gcTombstoneEnforcementAllowed"> &
|
|
123
119
|
TypedEventEmitter<IContainerRuntimeEvents>;
|
|
124
120
|
|
|
125
|
-
// Note that while offline we "submit" an op before uploading the blob, but we always
|
|
126
|
-
// expect blobs to be uploaded before we actually see the op round-trip
|
|
127
|
-
export enum PendingBlobStatus {
|
|
128
|
-
OnlinePendingUpload,
|
|
129
|
-
OnlinePendingOp,
|
|
130
|
-
OfflinePendingUpload,
|
|
131
|
-
OfflinePendingOp,
|
|
132
|
-
}
|
|
133
|
-
|
|
134
121
|
type ICreateBlobResponseWithTTL = ICreateBlobResponse & Partial<Record<"minTTLInSeconds", number>>;
|
|
135
122
|
|
|
136
123
|
interface PendingBlob {
|
|
137
124
|
blob: ArrayBufferLike;
|
|
138
|
-
|
|
125
|
+
uploading?: boolean;
|
|
126
|
+
opsent?: boolean;
|
|
139
127
|
storageId?: string;
|
|
140
128
|
handleP: Deferred<BlobHandle>;
|
|
141
129
|
uploadP?: Promise<ICreateBlobResponse | void>;
|
|
@@ -144,7 +132,6 @@ interface PendingBlob {
|
|
|
144
132
|
attached?: boolean;
|
|
145
133
|
acked?: boolean;
|
|
146
134
|
abortSignal?: AbortSignal;
|
|
147
|
-
opsent?: boolean;
|
|
148
135
|
}
|
|
149
136
|
|
|
150
137
|
export interface IPendingBlobs {
|
|
@@ -177,9 +164,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
177
164
|
private readonly redirectTable: Map<string, string | undefined>;
|
|
178
165
|
|
|
179
166
|
/**
|
|
180
|
-
* Blobs which
|
|
181
|
-
* Until we see the op round-trip, there is a possibility we may need to re-upload the blob, so
|
|
182
|
-
* we must save it. This is true for both the online and offline flow.
|
|
167
|
+
* Blobs which we have not yet seen a BlobAttach op round-trip and not yet attached to a DDS.
|
|
183
168
|
*/
|
|
184
169
|
private readonly pendingBlobs: Map<string, PendingBlob> = new Map();
|
|
185
170
|
|
|
@@ -245,8 +230,6 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
245
230
|
this.runtime.gcTombstoneEnforcementAllowed &&
|
|
246
231
|
this.runtime.clientDetails.type !== summarizerClientType;
|
|
247
232
|
|
|
248
|
-
this.runtime.on("disconnected", () => this.onDisconnected());
|
|
249
|
-
|
|
250
233
|
this.redirectTable = this.load(snapshot);
|
|
251
234
|
|
|
252
235
|
// Begin uploading stashed blobs from previous container instance
|
|
@@ -261,7 +244,8 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
261
244
|
if (entry.minTTLInSeconds - timeLapseSinceLocalUpload > entry.minTTLInSeconds / 2) {
|
|
262
245
|
this.pendingBlobs.set(localId, {
|
|
263
246
|
blob,
|
|
264
|
-
|
|
247
|
+
uploading: false,
|
|
248
|
+
opsent: true,
|
|
265
249
|
handleP: new Deferred(),
|
|
266
250
|
storageId,
|
|
267
251
|
uploadP: undefined,
|
|
@@ -275,11 +259,12 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
275
259
|
}
|
|
276
260
|
this.pendingBlobs.set(localId, {
|
|
277
261
|
blob,
|
|
278
|
-
|
|
262
|
+
uploading: true,
|
|
279
263
|
handleP: new Deferred(),
|
|
280
264
|
uploadP: this.uploadBlob(localId, blob),
|
|
281
265
|
attached,
|
|
282
266
|
acked,
|
|
267
|
+
opsent: true,
|
|
283
268
|
});
|
|
284
269
|
});
|
|
285
270
|
|
|
@@ -289,13 +274,11 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
289
274
|
pendingEntry !== undefined,
|
|
290
275
|
0x725 /* Must have pending blob entry for upcoming op */,
|
|
291
276
|
);
|
|
292
|
-
pendingEntry.opsent = true;
|
|
293
277
|
if (pendingEntry?.uploadTime && pendingEntry?.minTTLInSeconds) {
|
|
294
278
|
const secondsSinceUpload = (Date.now() - pendingEntry.uploadTime) / 1000;
|
|
295
279
|
const expired = pendingEntry.minTTLInSeconds - secondsSinceUpload < 0;
|
|
296
280
|
this.mc.logger.sendTelemetryEvent({
|
|
297
281
|
eventName: "sendBlobAttach",
|
|
298
|
-
entryStatus: pendingEntry.status,
|
|
299
282
|
secondsSinceUpload,
|
|
300
283
|
minTTLInSeconds: pendingEntry.minTTLInSeconds,
|
|
301
284
|
expired,
|
|
@@ -309,27 +292,17 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
309
292
|
{
|
|
310
293
|
localId,
|
|
311
294
|
blobId,
|
|
312
|
-
entryStatus: pendingEntry.status,
|
|
313
295
|
secondsSinceUpload,
|
|
314
296
|
},
|
|
315
297
|
),
|
|
316
298
|
);
|
|
317
299
|
}
|
|
318
300
|
}
|
|
301
|
+
pendingEntry.opsent = true;
|
|
319
302
|
return sendBlobAttachOp(localId, blobId);
|
|
320
303
|
};
|
|
321
304
|
}
|
|
322
305
|
|
|
323
|
-
private get pendingOfflineUploads() {
|
|
324
|
-
return Array.from(this.pendingBlobs.values()).filter(
|
|
325
|
-
(e) => e.status === PendingBlobStatus.OfflinePendingUpload,
|
|
326
|
-
);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
public get hasPendingOfflineUploads(): boolean {
|
|
330
|
-
return this.pendingOfflineUploads.length > 0;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
306
|
public get allBlobsAttached(): boolean {
|
|
334
307
|
for (const [, entry] of this.pendingBlobs) {
|
|
335
308
|
if (entry.attached === false) {
|
|
@@ -349,20 +322,21 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
349
322
|
private createAbortError(pending?: PendingBlob) {
|
|
350
323
|
return new LoggingError("uploadBlob aborted", {
|
|
351
324
|
acked: pending?.acked,
|
|
352
|
-
status: pending?.status,
|
|
353
325
|
uploadTime: pending?.uploadTime,
|
|
354
326
|
});
|
|
355
327
|
}
|
|
356
328
|
/**
|
|
357
329
|
* Upload blobs added while offline. This must be completed before connecting and resubmitting ops.
|
|
358
330
|
*/
|
|
359
|
-
public async
|
|
331
|
+
public async processStashedChanges() {
|
|
360
332
|
this.retryThrottler.cancel();
|
|
361
|
-
const pendingUploads = this.
|
|
333
|
+
const pendingUploads = Array.from(this.pendingBlobs.values())
|
|
334
|
+
.filter((e) => e.uploading === true)
|
|
335
|
+
.map(async (e) => e.uploadP);
|
|
362
336
|
await PerformanceEvent.timedExecAsync(
|
|
363
337
|
this.mc.logger,
|
|
364
338
|
{
|
|
365
|
-
eventName: "
|
|
339
|
+
eventName: "BlobUploadProcessStashedChanges",
|
|
366
340
|
count: pendingUploads.length,
|
|
367
341
|
},
|
|
368
342
|
async () => Promise.all(pendingUploads),
|
|
@@ -370,42 +344,6 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
370
344
|
);
|
|
371
345
|
}
|
|
372
346
|
|
|
373
|
-
/**
|
|
374
|
-
* Transition online blobs waiting for BlobAttach op round-trip since we will not see the op until we are connected
|
|
375
|
-
* again
|
|
376
|
-
*/
|
|
377
|
-
private onDisconnected() {
|
|
378
|
-
for (const [localId, entry] of this.pendingBlobs) {
|
|
379
|
-
if (entry.status === PendingBlobStatus.OnlinePendingOp) {
|
|
380
|
-
// This will submit another BlobAttach op for this blob. This is necessary because the one we sent
|
|
381
|
-
// already didn't have the local ID.
|
|
382
|
-
this.transitionToOffline(localId);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
private async shutdownPendingBlobs(): Promise<void> {
|
|
388
|
-
for (const [localId, entry] of this.pendingBlobs) {
|
|
389
|
-
if (entry.status === PendingBlobStatus.OnlinePendingUpload) {
|
|
390
|
-
this.sendBlobAttachOp(localId, entry.storageId);
|
|
391
|
-
entry.status = PendingBlobStatus.OfflinePendingUpload;
|
|
392
|
-
entry.handleP.resolve(this.getBlobHandle(localId));
|
|
393
|
-
} else if (entry.status === PendingBlobStatus.OnlinePendingOp) {
|
|
394
|
-
entry.status = PendingBlobStatus.OfflinePendingOp;
|
|
395
|
-
entry.handleP.resolve(this.getBlobHandle(localId));
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
return new Promise<void>((resolve) => {
|
|
399
|
-
if (this.allBlobsAttached) {
|
|
400
|
-
resolve();
|
|
401
|
-
} else {
|
|
402
|
-
this.once("allBlobsAttached", () => {
|
|
403
|
-
resolve();
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
|
-
|
|
409
347
|
/**
|
|
410
348
|
* Set of actual storage IDs (i.e., IDs that can be requested from storage). This will be empty if the container is
|
|
411
349
|
* detached or there are no (non-pending) attachment blobs in the document
|
|
@@ -471,10 +409,8 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
471
409
|
const callback = pending
|
|
472
410
|
? () => {
|
|
473
411
|
pending.attached = true;
|
|
412
|
+
this.emit("blobAttached", pending);
|
|
474
413
|
this.deletePendingBlobMaybe(id);
|
|
475
|
-
if (this.allBlobsAttached) {
|
|
476
|
-
this.emit("allBlobsAttached");
|
|
477
|
-
}
|
|
478
414
|
}
|
|
479
415
|
: undefined;
|
|
480
416
|
return new BlobHandle(
|
|
@@ -521,7 +457,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
521
457
|
const localId = uuid();
|
|
522
458
|
const pendingEntry: PendingBlob = {
|
|
523
459
|
blob,
|
|
524
|
-
|
|
460
|
+
uploading: true,
|
|
525
461
|
handleP: new Deferred(),
|
|
526
462
|
uploadP: this.uploadBlob(localId, blob),
|
|
527
463
|
attached: false,
|
|
@@ -589,50 +525,37 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
589
525
|
return;
|
|
590
526
|
}
|
|
591
527
|
assert(
|
|
592
|
-
entry.
|
|
593
|
-
entry.status === PendingBlobStatus.OfflinePendingUpload,
|
|
528
|
+
entry.uploading === true,
|
|
594
529
|
0x386 /* Must have pending blob entry for uploaded blob */,
|
|
595
530
|
);
|
|
596
531
|
entry.storageId = response.id;
|
|
597
532
|
entry.uploadTime = Date.now();
|
|
598
533
|
entry.minTTLInSeconds = response.minTTLInSeconds;
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
} else {
|
|
615
|
-
// If there is already an op for this storage ID, append the local ID to the list. Once any op for
|
|
616
|
-
// this storage ID is ack'd, all pending blobs for it can be resolved since the op will keep the
|
|
617
|
-
// blob alive in storage.
|
|
618
|
-
this.opsInFlight.set(
|
|
619
|
-
response.id,
|
|
620
|
-
(this.opsInFlight.get(response.id) ?? []).concat(localId),
|
|
621
|
-
);
|
|
622
|
-
entry.status = PendingBlobStatus.OnlinePendingOp;
|
|
623
|
-
}
|
|
624
|
-
} else if (entry.status === PendingBlobStatus.OfflinePendingUpload) {
|
|
625
|
-
// We already submitted a BlobAttach op for this blob when it was transitioned to offline flow
|
|
626
|
-
entry.status = PendingBlobStatus.OfflinePendingOp;
|
|
627
|
-
}
|
|
534
|
+
// Send a blob attach op. This serves two purposes:
|
|
535
|
+
// 1. If its a new blob, i.e., it isn't de-duped, the server will keep the blob alive if it sees this op
|
|
536
|
+
// until its storage ID is added to the next summary.
|
|
537
|
+
// 2. It will create a local ID to storage ID mapping in all clients which is needed to retrieve the
|
|
538
|
+
// blob from the server via the storage ID.
|
|
539
|
+
if (!entry.opsent) {
|
|
540
|
+
this.sendBlobAttachOp(localId, response.id);
|
|
541
|
+
}
|
|
542
|
+
if (this.storageIds.has(response.id)) {
|
|
543
|
+
// The blob is de-duped. Set up a local ID to storage ID mapping and return the blob. Since this is
|
|
544
|
+
// an existing blob, we don't have to wait for the op to be ack'd since this step has already
|
|
545
|
+
// happened before and so, the server won't delete it.
|
|
546
|
+
this.setRedirection(localId, response.id);
|
|
547
|
+
entry.handleP.resolve(this.getBlobHandle(localId));
|
|
548
|
+
this.deletePendingBlobMaybe(localId);
|
|
628
549
|
} else {
|
|
629
|
-
//
|
|
630
|
-
this
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
550
|
+
// If there is already an op for this storage ID, append the local ID to the list. Once any op for
|
|
551
|
+
// this storage ID is ack'd, all pending blobs for it can be resolved since the op will keep the
|
|
552
|
+
// blob alive in storage.
|
|
553
|
+
this.opsInFlight.set(
|
|
554
|
+
response.id,
|
|
555
|
+
(this.opsInFlight.get(response.id) ?? []).concat(localId),
|
|
556
|
+
);
|
|
635
557
|
}
|
|
558
|
+
|
|
636
559
|
return response;
|
|
637
560
|
}
|
|
638
561
|
|
|
@@ -644,9 +567,6 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
644
567
|
return;
|
|
645
568
|
}
|
|
646
569
|
if (!this.runtime.connected) {
|
|
647
|
-
if (entry.status === PendingBlobStatus.OnlinePendingUpload) {
|
|
648
|
-
this.transitionToOffline(localId);
|
|
649
|
-
}
|
|
650
570
|
// we are probably not connected to storage but start another upload request in case we are
|
|
651
571
|
entry.uploadP = this.retryThrottler
|
|
652
572
|
.getDelay()
|
|
@@ -658,39 +578,6 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
658
578
|
}
|
|
659
579
|
}
|
|
660
580
|
|
|
661
|
-
private transitionToOffline(localId: string) {
|
|
662
|
-
assert(
|
|
663
|
-
!this.runtime.connected,
|
|
664
|
-
0x388 /* Must only transition to offline flow while runtime is disconnected */,
|
|
665
|
-
);
|
|
666
|
-
const entry = this.pendingBlobs.get(localId);
|
|
667
|
-
assert(!!entry, 0x389 /* No pending blob entry */);
|
|
668
|
-
assert(
|
|
669
|
-
[PendingBlobStatus.OnlinePendingUpload, PendingBlobStatus.OnlinePendingOp].includes(
|
|
670
|
-
entry.status,
|
|
671
|
-
),
|
|
672
|
-
0x38a /* Blob must be in online flow to transition to offline flow */,
|
|
673
|
-
);
|
|
674
|
-
|
|
675
|
-
/**
|
|
676
|
-
* If we haven't already submitted a BlobAttach op for this entry, send it before returning the blob handle.
|
|
677
|
-
* This will make sure that the BlobAttach op is sequenced prior to any ops referencing the handle. Otherwise,
|
|
678
|
-
* an invalid handle could be added to the document.
|
|
679
|
-
* storageId may be undefined but since we are not connected we will have a chance to add it when reSubmit()
|
|
680
|
-
* is called on reconnection.
|
|
681
|
-
*/
|
|
682
|
-
if (entry.status !== PendingBlobStatus.OnlinePendingOp) {
|
|
683
|
-
this.sendBlobAttachOp(localId, entry.storageId);
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
entry.status =
|
|
687
|
-
entry.status === PendingBlobStatus.OnlinePendingUpload
|
|
688
|
-
? PendingBlobStatus.OfflinePendingUpload
|
|
689
|
-
: PendingBlobStatus.OfflinePendingOp;
|
|
690
|
-
|
|
691
|
-
entry.handleP.resolve(this.getBlobHandle(localId));
|
|
692
|
-
}
|
|
693
|
-
|
|
694
581
|
/**
|
|
695
582
|
* Resubmit a BlobAttach op. Used to add storage IDs to ops that were
|
|
696
583
|
* submitted to runtime while disconnected.
|
|
@@ -705,8 +592,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
705
592
|
if (!blobId) {
|
|
706
593
|
// We submitted this op while offline. The blob should have been uploaded by now.
|
|
707
594
|
assert(
|
|
708
|
-
pendingEntry?.
|
|
709
|
-
!!pendingEntry?.storageId,
|
|
595
|
+
pendingEntry?.opsent === true && !!pendingEntry?.storageId,
|
|
710
596
|
0x38d /* blob must be uploaded before resubmitting BlobAttach op */,
|
|
711
597
|
);
|
|
712
598
|
return this.sendBlobAttachOp(localId, pendingEntry?.storageId);
|
|
@@ -750,22 +636,17 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
750
636
|
entry !== undefined,
|
|
751
637
|
0x38f /* local online BlobAttach op with no pending blob entry */,
|
|
752
638
|
);
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
entry.acked = true;
|
|
758
|
-
entry.handleP.resolve(this.getBlobHandle(pendingLocalId));
|
|
759
|
-
this.deletePendingBlobMaybe(pendingLocalId);
|
|
760
|
-
}
|
|
639
|
+
this.setRedirection(pendingLocalId, blobId);
|
|
640
|
+
entry.acked = true;
|
|
641
|
+
entry.handleP.resolve(this.getBlobHandle(pendingLocalId));
|
|
642
|
+
this.deletePendingBlobMaybe(pendingLocalId);
|
|
761
643
|
});
|
|
762
644
|
this.opsInFlight.delete(blobId);
|
|
763
645
|
}
|
|
764
|
-
// offline flow does not resolve the handle (since it was already resolved)
|
|
765
|
-
// but we still need to delete the entry in case is acked and attached.
|
|
766
646
|
const localEntry = this.pendingBlobs.get(localId);
|
|
767
647
|
if (localEntry) {
|
|
768
648
|
localEntry.acked = true;
|
|
649
|
+
localEntry.handleP.resolve(this.getBlobHandle(localId));
|
|
769
650
|
this.deletePendingBlobMaybe(localId);
|
|
770
651
|
}
|
|
771
652
|
}
|
|
@@ -1037,22 +918,61 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
1037
918
|
}
|
|
1038
919
|
}
|
|
1039
920
|
|
|
1040
|
-
public async getPendingBlobs(waitBlobsToAttach?: boolean): Promise<IPendingBlobs> {
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
921
|
+
public async getPendingBlobs(waitBlobsToAttach?: boolean): Promise<IPendingBlobs | undefined> {
|
|
922
|
+
return PerformanceEvent.timedExecAsync(
|
|
923
|
+
this.mc.logger,
|
|
924
|
+
{ eventName: "GetPendingBlobs" },
|
|
925
|
+
async () => {
|
|
926
|
+
if (this.pendingBlobs.size === 0) {
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
const blobs = {};
|
|
930
|
+
const localBlobs = new Set<PendingBlob>();
|
|
931
|
+
while (localBlobs.size < this.pendingBlobs.size) {
|
|
932
|
+
const attachBlobsP: Promise<void>[] = [];
|
|
933
|
+
for (const [id, entry] of this.pendingBlobs) {
|
|
934
|
+
if (!localBlobs.has(entry)) {
|
|
935
|
+
localBlobs.add(entry);
|
|
936
|
+
if (waitBlobsToAttach) {
|
|
937
|
+
if (!entry.opsent) {
|
|
938
|
+
this.sendBlobAttachOp(id, entry.storageId);
|
|
939
|
+
}
|
|
940
|
+
entry.handleP.resolve(this.getBlobHandle(id));
|
|
941
|
+
attachBlobsP.push(
|
|
942
|
+
new Promise<void>((resolve) => {
|
|
943
|
+
const onBlobAttached = (attachedEntry) => {
|
|
944
|
+
if (attachedEntry === entry) {
|
|
945
|
+
this.off("blobAttached", onBlobAttached);
|
|
946
|
+
resolve();
|
|
947
|
+
}
|
|
948
|
+
};
|
|
949
|
+
if (!entry.attached) {
|
|
950
|
+
this.on("blobAttached", onBlobAttached);
|
|
951
|
+
} else {
|
|
952
|
+
resolve();
|
|
953
|
+
}
|
|
954
|
+
}),
|
|
955
|
+
);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
await Promise.all(attachBlobsP);
|
|
960
|
+
}
|
|
961
|
+
// another for is needed to correctly mark attach state
|
|
962
|
+
// future optimization won't add unattached blobs to the list
|
|
963
|
+
for (const [id, entry] of this.pendingBlobs) {
|
|
964
|
+
blobs[id] = {
|
|
965
|
+
blob: bufferToString(entry.blob, "base64"),
|
|
966
|
+
storageId: entry.storageId,
|
|
967
|
+
attached: entry.attached,
|
|
968
|
+
acked: entry.acked,
|
|
969
|
+
minTTLInSeconds: entry.minTTLInSeconds,
|
|
970
|
+
uploadTime: entry.uploadTime,
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
return blobs;
|
|
974
|
+
},
|
|
975
|
+
);
|
|
1056
976
|
}
|
|
1057
977
|
}
|
|
1058
978
|
|
|
@@ -14,7 +14,8 @@ import {
|
|
|
14
14
|
ISequencedDocumentMessage,
|
|
15
15
|
MessageType,
|
|
16
16
|
} from "@fluidframework/protocol-definitions";
|
|
17
|
-
import { assert
|
|
17
|
+
import { assert } from "@fluidframework/core-utils";
|
|
18
|
+
import { performance } from "@fluid-internal/client-utils";
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.
|