@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/lib/blobManager.js
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { v4 as uuid } from "uuid";
|
|
6
6
|
import { createResponseError, generateHandleContextPath, responseToException, SummaryTreeBuilder, } from "@fluidframework/runtime-utils";
|
|
7
|
-
import { assert,
|
|
7
|
+
import { assert, Deferred } from "@fluidframework/core-utils";
|
|
8
|
+
import { bufferToString, stringToBuffer, TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
8
9
|
import { AttachState } from "@fluidframework/container-definitions";
|
|
9
|
-
import {
|
|
10
|
-
import { GenericError } from "@fluidframework/container-utils";
|
|
10
|
+
import { createChildMonitoringContext, GenericError, LoggingError, PerformanceEvent, } from "@fluidframework/telemetry-utils";
|
|
11
11
|
import { TombstoneResponseHeaderKey } from "./containerRuntime";
|
|
12
12
|
import { sendGCUnexpectedUsageEvent, sweepAttachmentBlobsKey, throwOnTombstoneLoadKey } from "./gc";
|
|
13
13
|
import { Throttler, formExponentialFn } from "./throttler";
|
|
@@ -60,15 +60,6 @@ class CancellableThrottler {
|
|
|
60
60
|
this.cancelP = new Deferred();
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
// Note that while offline we "submit" an op before uploading the blob, but we always
|
|
64
|
-
// expect blobs to be uploaded before we actually see the op round-trip
|
|
65
|
-
export var PendingBlobStatus;
|
|
66
|
-
(function (PendingBlobStatus) {
|
|
67
|
-
PendingBlobStatus[PendingBlobStatus["OnlinePendingUpload"] = 0] = "OnlinePendingUpload";
|
|
68
|
-
PendingBlobStatus[PendingBlobStatus["OnlinePendingOp"] = 1] = "OnlinePendingOp";
|
|
69
|
-
PendingBlobStatus[PendingBlobStatus["OfflinePendingUpload"] = 2] = "OfflinePendingUpload";
|
|
70
|
-
PendingBlobStatus[PendingBlobStatus["OfflinePendingOp"] = 3] = "OfflinePendingOp";
|
|
71
|
-
})(PendingBlobStatus || (PendingBlobStatus = {}));
|
|
72
63
|
export class BlobManager extends TypedEventEmitter {
|
|
73
64
|
constructor(routeContext, snapshot, getStorage,
|
|
74
65
|
/**
|
|
@@ -96,9 +87,7 @@ export class BlobManager extends TypedEventEmitter {
|
|
|
96
87
|
this.runtime = runtime;
|
|
97
88
|
this.closeContainer = closeContainer;
|
|
98
89
|
/**
|
|
99
|
-
* Blobs which
|
|
100
|
-
* Until we see the op round-trip, there is a possibility we may need to re-upload the blob, so
|
|
101
|
-
* we must save it. This is true for both the online and offline flow.
|
|
90
|
+
* Blobs which we have not yet seen a BlobAttach op round-trip and not yet attached to a DDS.
|
|
102
91
|
*/
|
|
103
92
|
this.pendingBlobs = new Map();
|
|
104
93
|
/**
|
|
@@ -125,7 +114,6 @@ export class BlobManager extends TypedEventEmitter {
|
|
|
125
114
|
this.mc.config.getBoolean(throwOnTombstoneLoadKey) === true &&
|
|
126
115
|
this.runtime.gcTombstoneEnforcementAllowed &&
|
|
127
116
|
this.runtime.clientDetails.type !== summarizerClientType;
|
|
128
|
-
this.runtime.on("disconnected", () => this.onDisconnected());
|
|
129
117
|
this.redirectTable = this.load(snapshot);
|
|
130
118
|
// Begin uploading stashed blobs from previous container instance
|
|
131
119
|
Object.entries(stashedBlobs).forEach(([localId, entry]) => {
|
|
@@ -139,7 +127,8 @@ export class BlobManager extends TypedEventEmitter {
|
|
|
139
127
|
if (entry.minTTLInSeconds - timeLapseSinceLocalUpload > entry.minTTLInSeconds / 2) {
|
|
140
128
|
this.pendingBlobs.set(localId, {
|
|
141
129
|
blob,
|
|
142
|
-
|
|
130
|
+
uploading: false,
|
|
131
|
+
opsent: true,
|
|
143
132
|
handleP: new Deferred(),
|
|
144
133
|
storageId,
|
|
145
134
|
uploadP: undefined,
|
|
@@ -153,23 +142,22 @@ export class BlobManager extends TypedEventEmitter {
|
|
|
153
142
|
}
|
|
154
143
|
this.pendingBlobs.set(localId, {
|
|
155
144
|
blob,
|
|
156
|
-
|
|
145
|
+
uploading: true,
|
|
157
146
|
handleP: new Deferred(),
|
|
158
147
|
uploadP: this.uploadBlob(localId, blob),
|
|
159
148
|
attached,
|
|
160
149
|
acked,
|
|
150
|
+
opsent: true,
|
|
161
151
|
});
|
|
162
152
|
});
|
|
163
153
|
this.sendBlobAttachOp = (localId, blobId) => {
|
|
164
154
|
const pendingEntry = this.pendingBlobs.get(localId);
|
|
165
155
|
assert(pendingEntry !== undefined, 0x725 /* Must have pending blob entry for upcoming op */);
|
|
166
|
-
pendingEntry.opsent = true;
|
|
167
156
|
if (pendingEntry?.uploadTime && pendingEntry?.minTTLInSeconds) {
|
|
168
157
|
const secondsSinceUpload = (Date.now() - pendingEntry.uploadTime) / 1000;
|
|
169
158
|
const expired = pendingEntry.minTTLInSeconds - secondsSinceUpload < 0;
|
|
170
159
|
this.mc.logger.sendTelemetryEvent({
|
|
171
160
|
eventName: "sendBlobAttach",
|
|
172
|
-
entryStatus: pendingEntry.status,
|
|
173
161
|
secondsSinceUpload,
|
|
174
162
|
minTTLInSeconds: pendingEntry.minTTLInSeconds,
|
|
175
163
|
expired,
|
|
@@ -179,20 +167,14 @@ export class BlobManager extends TypedEventEmitter {
|
|
|
179
167
|
this.closeContainer(new GenericError("Trying to submit a BlobAttach for expired blob", undefined, {
|
|
180
168
|
localId,
|
|
181
169
|
blobId,
|
|
182
|
-
entryStatus: pendingEntry.status,
|
|
183
170
|
secondsSinceUpload,
|
|
184
171
|
}));
|
|
185
172
|
}
|
|
186
173
|
}
|
|
174
|
+
pendingEntry.opsent = true;
|
|
187
175
|
return sendBlobAttachOp(localId, blobId);
|
|
188
176
|
};
|
|
189
177
|
}
|
|
190
|
-
get pendingOfflineUploads() {
|
|
191
|
-
return Array.from(this.pendingBlobs.values()).filter((e) => e.status === PendingBlobStatus.OfflinePendingUpload);
|
|
192
|
-
}
|
|
193
|
-
get hasPendingOfflineUploads() {
|
|
194
|
-
return this.pendingOfflineUploads.length > 0;
|
|
195
|
-
}
|
|
196
178
|
get allBlobsAttached() {
|
|
197
179
|
for (const [, entry] of this.pendingBlobs) {
|
|
198
180
|
if (entry.attached === false) {
|
|
@@ -208,57 +190,22 @@ export class BlobManager extends TypedEventEmitter {
|
|
|
208
190
|
createAbortError(pending) {
|
|
209
191
|
return new LoggingError("uploadBlob aborted", {
|
|
210
192
|
acked: pending?.acked,
|
|
211
|
-
status: pending?.status,
|
|
212
193
|
uploadTime: pending?.uploadTime,
|
|
213
194
|
});
|
|
214
195
|
}
|
|
215
196
|
/**
|
|
216
197
|
* Upload blobs added while offline. This must be completed before connecting and resubmitting ops.
|
|
217
198
|
*/
|
|
218
|
-
async
|
|
199
|
+
async processStashedChanges() {
|
|
219
200
|
this.retryThrottler.cancel();
|
|
220
|
-
const pendingUploads = this.
|
|
201
|
+
const pendingUploads = Array.from(this.pendingBlobs.values())
|
|
202
|
+
.filter((e) => e.uploading === true)
|
|
203
|
+
.map(async (e) => e.uploadP);
|
|
221
204
|
await PerformanceEvent.timedExecAsync(this.mc.logger, {
|
|
222
|
-
eventName: "
|
|
205
|
+
eventName: "BlobUploadProcessStashedChanges",
|
|
223
206
|
count: pendingUploads.length,
|
|
224
207
|
}, async () => Promise.all(pendingUploads), { start: true, end: true });
|
|
225
208
|
}
|
|
226
|
-
/**
|
|
227
|
-
* Transition online blobs waiting for BlobAttach op round-trip since we will not see the op until we are connected
|
|
228
|
-
* again
|
|
229
|
-
*/
|
|
230
|
-
onDisconnected() {
|
|
231
|
-
for (const [localId, entry] of this.pendingBlobs) {
|
|
232
|
-
if (entry.status === PendingBlobStatus.OnlinePendingOp) {
|
|
233
|
-
// This will submit another BlobAttach op for this blob. This is necessary because the one we sent
|
|
234
|
-
// already didn't have the local ID.
|
|
235
|
-
this.transitionToOffline(localId);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
async shutdownPendingBlobs() {
|
|
240
|
-
for (const [localId, entry] of this.pendingBlobs) {
|
|
241
|
-
if (entry.status === PendingBlobStatus.OnlinePendingUpload) {
|
|
242
|
-
this.sendBlobAttachOp(localId, entry.storageId);
|
|
243
|
-
entry.status = PendingBlobStatus.OfflinePendingUpload;
|
|
244
|
-
entry.handleP.resolve(this.getBlobHandle(localId));
|
|
245
|
-
}
|
|
246
|
-
else if (entry.status === PendingBlobStatus.OnlinePendingOp) {
|
|
247
|
-
entry.status = PendingBlobStatus.OfflinePendingOp;
|
|
248
|
-
entry.handleP.resolve(this.getBlobHandle(localId));
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
return new Promise((resolve) => {
|
|
252
|
-
if (this.allBlobsAttached) {
|
|
253
|
-
resolve();
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
this.once("allBlobsAttached", () => {
|
|
257
|
-
resolve();
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
209
|
/**
|
|
263
210
|
* Set of actual storage IDs (i.e., IDs that can be requested from storage). This will be empty if the container is
|
|
264
211
|
* detached or there are no (non-pending) attachment blobs in the document
|
|
@@ -305,10 +252,8 @@ export class BlobManager extends TypedEventEmitter {
|
|
|
305
252
|
const callback = pending
|
|
306
253
|
? () => {
|
|
307
254
|
pending.attached = true;
|
|
255
|
+
this.emit("blobAttached", pending);
|
|
308
256
|
this.deletePendingBlobMaybe(id);
|
|
309
|
-
if (this.allBlobsAttached) {
|
|
310
|
-
this.emit("allBlobsAttached");
|
|
311
|
-
}
|
|
312
257
|
}
|
|
313
258
|
: undefined;
|
|
314
259
|
return new BlobHandle(`${BlobManager.basePath}/${id}`, this.routeContext, async () => this.getBlob(id), callback);
|
|
@@ -338,7 +283,7 @@ export class BlobManager extends TypedEventEmitter {
|
|
|
338
283
|
const localId = uuid();
|
|
339
284
|
const pendingEntry = {
|
|
340
285
|
blob,
|
|
341
|
-
|
|
286
|
+
uploading: true,
|
|
342
287
|
handleP: new Deferred(),
|
|
343
288
|
uploadP: this.uploadBlob(localId, blob),
|
|
344
289
|
attached: false,
|
|
@@ -387,47 +332,31 @@ export class BlobManager extends TypedEventEmitter {
|
|
|
387
332
|
this.deletePendingBlob(localId);
|
|
388
333
|
return;
|
|
389
334
|
}
|
|
390
|
-
assert(entry.
|
|
391
|
-
entry.status === PendingBlobStatus.OfflinePendingUpload, 0x386 /* Must have pending blob entry for uploaded blob */);
|
|
335
|
+
assert(entry.uploading === true, 0x386 /* Must have pending blob entry for uploaded blob */);
|
|
392
336
|
entry.storageId = response.id;
|
|
393
337
|
entry.uploadTime = Date.now();
|
|
394
338
|
entry.minTTLInSeconds = response.minTTLInSeconds;
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
}
|
|
411
|
-
else {
|
|
412
|
-
// If there is already an op for this storage ID, append the local ID to the list. Once any op for
|
|
413
|
-
// this storage ID is ack'd, all pending blobs for it can be resolved since the op will keep the
|
|
414
|
-
// blob alive in storage.
|
|
415
|
-
this.opsInFlight.set(response.id, (this.opsInFlight.get(response.id) ?? []).concat(localId));
|
|
416
|
-
entry.status = PendingBlobStatus.OnlinePendingOp;
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
else if (entry.status === PendingBlobStatus.OfflinePendingUpload) {
|
|
420
|
-
// We already submitted a BlobAttach op for this blob when it was transitioned to offline flow
|
|
421
|
-
entry.status = PendingBlobStatus.OfflinePendingOp;
|
|
422
|
-
}
|
|
339
|
+
// Send a blob attach op. This serves two purposes:
|
|
340
|
+
// 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
|
|
341
|
+
// until its storage ID is added to the next summary.
|
|
342
|
+
// 2. It will create a local ID to storage ID mapping in all clients which is needed to retrieve the
|
|
343
|
+
// blob from the server via the storage ID.
|
|
344
|
+
if (!entry.opsent) {
|
|
345
|
+
this.sendBlobAttachOp(localId, response.id);
|
|
346
|
+
}
|
|
347
|
+
if (this.storageIds.has(response.id)) {
|
|
348
|
+
// The blob is de-duped. Set up a local ID to storage ID mapping and return the blob. Since this is
|
|
349
|
+
// an existing blob, we don't have to wait for the op to be ack'd since this step has already
|
|
350
|
+
// happened before and so, the server won't delete it.
|
|
351
|
+
this.setRedirection(localId, response.id);
|
|
352
|
+
entry.handleP.resolve(this.getBlobHandle(localId));
|
|
353
|
+
this.deletePendingBlobMaybe(localId);
|
|
423
354
|
}
|
|
424
355
|
else {
|
|
425
|
-
//
|
|
426
|
-
this
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
entry.status = PendingBlobStatus.OfflinePendingOp;
|
|
356
|
+
// If there is already an op for this storage ID, append the local ID to the list. Once any op for
|
|
357
|
+
// this storage ID is ack'd, all pending blobs for it can be resolved since the op will keep the
|
|
358
|
+
// blob alive in storage.
|
|
359
|
+
this.opsInFlight.set(response.id, (this.opsInFlight.get(response.id) ?? []).concat(localId));
|
|
431
360
|
}
|
|
432
361
|
return response;
|
|
433
362
|
}
|
|
@@ -439,9 +368,6 @@ export class BlobManager extends TypedEventEmitter {
|
|
|
439
368
|
return;
|
|
440
369
|
}
|
|
441
370
|
if (!this.runtime.connected) {
|
|
442
|
-
if (entry.status === PendingBlobStatus.OnlinePendingUpload) {
|
|
443
|
-
this.transitionToOffline(localId);
|
|
444
|
-
}
|
|
445
371
|
// we are probably not connected to storage but start another upload request in case we are
|
|
446
372
|
entry.uploadP = this.retryThrottler
|
|
447
373
|
.getDelay()
|
|
@@ -453,27 +379,6 @@ export class BlobManager extends TypedEventEmitter {
|
|
|
453
379
|
throw error;
|
|
454
380
|
}
|
|
455
381
|
}
|
|
456
|
-
transitionToOffline(localId) {
|
|
457
|
-
assert(!this.runtime.connected, 0x388 /* Must only transition to offline flow while runtime is disconnected */);
|
|
458
|
-
const entry = this.pendingBlobs.get(localId);
|
|
459
|
-
assert(!!entry, 0x389 /* No pending blob entry */);
|
|
460
|
-
assert([PendingBlobStatus.OnlinePendingUpload, PendingBlobStatus.OnlinePendingOp].includes(entry.status), 0x38a /* Blob must be in online flow to transition to offline flow */);
|
|
461
|
-
/**
|
|
462
|
-
* If we haven't already submitted a BlobAttach op for this entry, send it before returning the blob handle.
|
|
463
|
-
* This will make sure that the BlobAttach op is sequenced prior to any ops referencing the handle. Otherwise,
|
|
464
|
-
* an invalid handle could be added to the document.
|
|
465
|
-
* storageId may be undefined but since we are not connected we will have a chance to add it when reSubmit()
|
|
466
|
-
* is called on reconnection.
|
|
467
|
-
*/
|
|
468
|
-
if (entry.status !== PendingBlobStatus.OnlinePendingOp) {
|
|
469
|
-
this.sendBlobAttachOp(localId, entry.storageId);
|
|
470
|
-
}
|
|
471
|
-
entry.status =
|
|
472
|
-
entry.status === PendingBlobStatus.OnlinePendingUpload
|
|
473
|
-
? PendingBlobStatus.OfflinePendingUpload
|
|
474
|
-
: PendingBlobStatus.OfflinePendingOp;
|
|
475
|
-
entry.handleP.resolve(this.getBlobHandle(localId));
|
|
476
|
-
}
|
|
477
382
|
/**
|
|
478
383
|
* Resubmit a BlobAttach op. Used to add storage IDs to ops that were
|
|
479
384
|
* submitted to runtime while disconnected.
|
|
@@ -486,8 +391,7 @@ export class BlobManager extends TypedEventEmitter {
|
|
|
486
391
|
const pendingEntry = this.pendingBlobs.get(localId);
|
|
487
392
|
if (!blobId) {
|
|
488
393
|
// We submitted this op while offline. The blob should have been uploaded by now.
|
|
489
|
-
assert(pendingEntry?.
|
|
490
|
-
!!pendingEntry?.storageId, 0x38d /* blob must be uploaded before resubmitting BlobAttach op */);
|
|
394
|
+
assert(pendingEntry?.opsent === true && !!pendingEntry?.storageId, 0x38d /* blob must be uploaded before resubmitting BlobAttach op */);
|
|
491
395
|
return this.sendBlobAttachOp(localId, pendingEntry?.storageId);
|
|
492
396
|
}
|
|
493
397
|
return this.sendBlobAttachOp(localId, blobId);
|
|
@@ -522,21 +426,17 @@ export class BlobManager extends TypedEventEmitter {
|
|
|
522
426
|
waitingBlobs.forEach((pendingLocalId) => {
|
|
523
427
|
const entry = this.pendingBlobs.get(pendingLocalId);
|
|
524
428
|
assert(entry !== undefined, 0x38f /* local online BlobAttach op with no pending blob entry */);
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
entry.handleP.resolve(this.getBlobHandle(pendingLocalId));
|
|
530
|
-
this.deletePendingBlobMaybe(pendingLocalId);
|
|
531
|
-
}
|
|
429
|
+
this.setRedirection(pendingLocalId, blobId);
|
|
430
|
+
entry.acked = true;
|
|
431
|
+
entry.handleP.resolve(this.getBlobHandle(pendingLocalId));
|
|
432
|
+
this.deletePendingBlobMaybe(pendingLocalId);
|
|
532
433
|
});
|
|
533
434
|
this.opsInFlight.delete(blobId);
|
|
534
435
|
}
|
|
535
|
-
// offline flow does not resolve the handle (since it was already resolved)
|
|
536
|
-
// but we still need to delete the entry in case is acked and attached.
|
|
537
436
|
const localEntry = this.pendingBlobs.get(localId);
|
|
538
437
|
if (localEntry) {
|
|
539
438
|
localEntry.acked = true;
|
|
439
|
+
localEntry.handleP.resolve(this.getBlobHandle(localId));
|
|
540
440
|
this.deletePendingBlobMaybe(localId);
|
|
541
441
|
}
|
|
542
442
|
}
|
|
@@ -756,21 +656,55 @@ export class BlobManager extends TypedEventEmitter {
|
|
|
756
656
|
}
|
|
757
657
|
}
|
|
758
658
|
async getPendingBlobs(waitBlobsToAttach) {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
659
|
+
return PerformanceEvent.timedExecAsync(this.mc.logger, { eventName: "GetPendingBlobs" }, async () => {
|
|
660
|
+
if (this.pendingBlobs.size === 0) {
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
const blobs = {};
|
|
664
|
+
const localBlobs = new Set();
|
|
665
|
+
while (localBlobs.size < this.pendingBlobs.size) {
|
|
666
|
+
const attachBlobsP = [];
|
|
667
|
+
for (const [id, entry] of this.pendingBlobs) {
|
|
668
|
+
if (!localBlobs.has(entry)) {
|
|
669
|
+
localBlobs.add(entry);
|
|
670
|
+
if (waitBlobsToAttach) {
|
|
671
|
+
if (!entry.opsent) {
|
|
672
|
+
this.sendBlobAttachOp(id, entry.storageId);
|
|
673
|
+
}
|
|
674
|
+
entry.handleP.resolve(this.getBlobHandle(id));
|
|
675
|
+
attachBlobsP.push(new Promise((resolve) => {
|
|
676
|
+
const onBlobAttached = (attachedEntry) => {
|
|
677
|
+
if (attachedEntry === entry) {
|
|
678
|
+
this.off("blobAttached", onBlobAttached);
|
|
679
|
+
resolve();
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
if (!entry.attached) {
|
|
683
|
+
this.on("blobAttached", onBlobAttached);
|
|
684
|
+
}
|
|
685
|
+
else {
|
|
686
|
+
resolve();
|
|
687
|
+
}
|
|
688
|
+
}));
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
await Promise.all(attachBlobsP);
|
|
693
|
+
}
|
|
694
|
+
// another for is needed to correctly mark attach state
|
|
695
|
+
// future optimization won't add unattached blobs to the list
|
|
696
|
+
for (const [id, entry] of this.pendingBlobs) {
|
|
697
|
+
blobs[id] = {
|
|
698
|
+
blob: bufferToString(entry.blob, "base64"),
|
|
699
|
+
storageId: entry.storageId,
|
|
700
|
+
attached: entry.attached,
|
|
701
|
+
acked: entry.acked,
|
|
702
|
+
minTTLInSeconds: entry.minTTLInSeconds,
|
|
703
|
+
uploadTime: entry.uploadTime,
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
return blobs;
|
|
707
|
+
});
|
|
774
708
|
}
|
|
775
709
|
}
|
|
776
710
|
BlobManager.basePath = "_blobs";
|