@fluidframework/container-runtime 2.0.0-internal.3.0.2 → 2.0.0-internal.3.2.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/.eslintrc.js +19 -19
- package/.mocharc.js +2 -2
- package/api-extractor.json +2 -2
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +2 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +15 -2
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +109 -37
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +11 -9
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerHandleContext.d.ts.map +1 -1
- package/dist/containerHandleContext.js +3 -1
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +23 -11
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +225 -132
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +11 -9
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +27 -13
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +95 -56
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +7 -3
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js +3 -1
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/dataStores.d.ts +28 -4
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +122 -44
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +8 -3
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/{garbageCollection.d.ts → gc/garbageCollection.d.ts} +27 -203
- package/dist/gc/garbageCollection.d.ts.map +1 -0
- package/dist/{garbageCollection.js → gc/garbageCollection.js} +210 -400
- package/dist/gc/garbageCollection.js.map +1 -0
- package/dist/gc/gcDefinitions.d.ts +189 -0
- package/dist/gc/gcDefinitions.d.ts.map +1 -0
- package/dist/{garbageCollectionConstants.js → gc/gcDefinitions.js} +27 -2
- package/dist/gc/gcDefinitions.js.map +1 -0
- package/dist/gc/gcHelpers.d.ts +30 -0
- package/dist/gc/gcHelpers.d.ts.map +1 -0
- package/dist/gc/gcHelpers.js +65 -0
- package/dist/gc/gcHelpers.js.map +1 -0
- package/dist/gc/gcSummaryStateTracker.d.ts +86 -0
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -0
- package/dist/gc/gcSummaryStateTracker.js +246 -0
- package/dist/gc/gcSummaryStateTracker.js.map +1 -0
- package/{lib → dist/gc}/gcSweepReadyUsageDetection.d.ts +5 -5
- package/dist/gc/gcSweepReadyUsageDetection.d.ts.map +1 -0
- package/dist/{gcSweepReadyUsageDetection.js → gc/gcSweepReadyUsageDetection.js} +15 -11
- package/dist/gc/gcSweepReadyUsageDetection.js.map +1 -0
- package/dist/gc/gcUnreferencedStateTracker.d.ts +34 -0
- package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -0
- package/dist/gc/gcUnreferencedStateTracker.js +94 -0
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -0
- package/dist/gc/index.d.ts +11 -0
- package/dist/gc/index.d.ts.map +1 -0
- package/dist/gc/index.js +40 -0
- package/dist/gc/index.js.map +1 -0
- package/dist/index.d.ts +2 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +2 -13
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +19 -41
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +4 -0
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +1 -0
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +5 -2
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +1 -1
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +24 -13
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +19 -3
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +78 -45
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/opProperties.d.ts.map +1 -1
- package/dist/opProperties.js +1 -3
- package/dist/opProperties.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 +8 -2
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +21 -13
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +3 -2
- package/dist/scheduleManager.js.map +1 -1
- package/dist/serializedSnapshotStorage.d.ts +2 -2
- package/dist/serializedSnapshotStorage.d.ts.map +1 -1
- package/dist/serializedSnapshotStorage.js +5 -3
- package/dist/serializedSnapshotStorage.js.map +1 -1
- package/dist/summary/index.d.ts +17 -0
- package/dist/summary/index.d.ts.map +1 -0
- package/dist/summary/index.js +47 -0
- package/dist/summary/index.js.map +1 -0
- package/dist/summary/orderedClientElection.d.ts.map +1 -0
- package/dist/{orderedClientElection.js → summary/orderedClientElection.js} +10 -4
- package/dist/summary/orderedClientElection.js.map +1 -0
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -0
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -0
- package/{lib → dist/summary}/runningSummarizer.d.ts +19 -18
- package/dist/summary/runningSummarizer.d.ts.map +1 -0
- package/dist/{runningSummarizer.js → summary/runningSummarizer.js} +191 -76
- package/dist/summary/runningSummarizer.js.map +1 -0
- package/dist/{summarizer.d.ts → summary/summarizer.d.ts} +4 -6
- package/dist/summary/summarizer.d.ts.map +1 -0
- package/dist/{summarizer.js → summary/summarizer.js} +31 -71
- package/dist/summary/summarizer.js.map +1 -0
- package/dist/summary/summarizerClientElection.d.ts.map +1 -0
- package/dist/summary/summarizerClientElection.js.map +1 -0
- package/dist/summary/summarizerHandle.d.ts.map +1 -0
- package/dist/summary/summarizerHandle.js.map +1 -0
- package/{lib → dist/summary}/summarizerHeuristics.d.ts +1 -1
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -0
- package/dist/{summarizerHeuristics.js → summary/summarizerHeuristics.js} +6 -9
- package/dist/summary/summarizerHeuristics.js.map +1 -0
- package/{lib → dist/summary}/summarizerTypes.d.ts +22 -22
- package/dist/summary/summarizerTypes.d.ts.map +1 -0
- package/dist/summary/summarizerTypes.js.map +1 -0
- package/dist/summary/summaryCollection.d.ts.map +1 -0
- package/dist/{summaryCollection.js → summary/summaryCollection.js} +18 -8
- package/dist/summary/summaryCollection.js.map +1 -0
- package/{lib → dist/summary}/summaryFormat.d.ts +1 -40
- package/dist/summary/summaryFormat.d.ts.map +1 -0
- package/dist/{summaryFormat.js → summary/summaryFormat.js} +19 -20
- package/dist/summary/summaryFormat.js.map +1 -0
- package/dist/summary/summaryGenerator.d.ts.map +1 -0
- package/dist/{summaryGenerator.js → summary/summaryGenerator.js} +33 -15
- package/dist/summary/summaryGenerator.js.map +1 -0
- package/dist/{summaryManager.d.ts → summary/summaryManager.d.ts} +1 -1
- package/dist/summary/summaryManager.d.ts.map +1 -0
- package/dist/{summaryManager.js → summary/summaryManager.js} +21 -9
- package/dist/summary/summaryManager.js.map +1 -0
- package/dist/throttler.d.ts +2 -2
- package/dist/throttler.d.ts.map +1 -1
- package/dist/throttler.js +4 -4
- package/dist/throttler.js.map +1 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +2 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +15 -2
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +109 -37
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +11 -9
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerHandleContext.d.ts.map +1 -1
- package/lib/containerHandleContext.js +3 -1
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +23 -11
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +201 -108
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +11 -9
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +27 -13
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +84 -45
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +7 -3
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts.map +1 -1
- package/lib/dataStoreRegistry.js +3 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/dataStores.d.ts +28 -4
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +120 -42
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +9 -4
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/{garbageCollection.d.ts → gc/garbageCollection.d.ts} +27 -203
- package/lib/gc/garbageCollection.d.ts.map +1 -0
- package/lib/{garbageCollection.js → gc/garbageCollection.js} +190 -379
- package/lib/gc/garbageCollection.js.map +1 -0
- package/lib/gc/gcDefinitions.d.ts +189 -0
- package/lib/gc/gcDefinitions.d.ts.map +1 -0
- package/lib/{garbageCollectionConstants.js → gc/gcDefinitions.js} +26 -1
- package/lib/gc/gcDefinitions.js.map +1 -0
- package/lib/gc/gcHelpers.d.ts +30 -0
- package/lib/gc/gcHelpers.d.ts.map +1 -0
- package/lib/gc/gcHelpers.js +58 -0
- package/lib/gc/gcHelpers.js.map +1 -0
- package/lib/gc/gcSummaryStateTracker.d.ts +86 -0
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -0
- package/lib/gc/gcSummaryStateTracker.js +242 -0
- package/lib/gc/gcSummaryStateTracker.js.map +1 -0
- package/{dist → lib/gc}/gcSweepReadyUsageDetection.d.ts +5 -5
- package/lib/gc/gcSweepReadyUsageDetection.d.ts.map +1 -0
- package/lib/{gcSweepReadyUsageDetection.js → gc/gcSweepReadyUsageDetection.js} +15 -11
- package/lib/gc/gcSweepReadyUsageDetection.js.map +1 -0
- package/lib/gc/gcUnreferencedStateTracker.d.ts +34 -0
- package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -0
- package/lib/gc/gcUnreferencedStateTracker.js +90 -0
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -0
- package/lib/gc/index.d.ts +11 -0
- package/lib/gc/index.d.ts.map +1 -0
- package/lib/gc/index.js +11 -0
- package/lib/gc/index.js.map +1 -0
- package/lib/index.d.ts +2 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -4
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +2 -13
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +19 -41
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +4 -0
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +1 -0
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +5 -2
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +1 -1
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +25 -14
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +19 -3
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +79 -46
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/opProperties.d.ts.map +1 -1
- package/lib/opProperties.js +1 -3
- package/lib/opProperties.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 +8 -2
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +21 -13
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +3 -2
- package/lib/scheduleManager.js.map +1 -1
- package/lib/serializedSnapshotStorage.d.ts +2 -2
- package/lib/serializedSnapshotStorage.d.ts.map +1 -1
- package/lib/serializedSnapshotStorage.js +5 -3
- package/lib/serializedSnapshotStorage.js.map +1 -1
- package/lib/summary/index.d.ts +17 -0
- package/lib/summary/index.d.ts.map +1 -0
- package/lib/summary/index.js +16 -0
- package/lib/summary/index.js.map +1 -0
- package/lib/summary/orderedClientElection.d.ts.map +1 -0
- package/lib/{orderedClientElection.js → summary/orderedClientElection.js} +10 -4
- package/lib/summary/orderedClientElection.js.map +1 -0
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -0
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -0
- package/{dist → lib/summary}/runningSummarizer.d.ts +19 -18
- package/lib/summary/runningSummarizer.d.ts.map +1 -0
- package/lib/{runningSummarizer.js → summary/runningSummarizer.js} +193 -78
- package/lib/summary/runningSummarizer.js.map +1 -0
- package/lib/{summarizer.d.ts → summary/summarizer.d.ts} +4 -6
- package/lib/summary/summarizer.d.ts.map +1 -0
- package/lib/{summarizer.js → summary/summarizer.js} +33 -73
- package/lib/summary/summarizer.js.map +1 -0
- package/lib/summary/summarizerClientElection.d.ts.map +1 -0
- package/lib/summary/summarizerClientElection.js.map +1 -0
- package/lib/summary/summarizerHandle.d.ts.map +1 -0
- package/lib/summary/summarizerHandle.js.map +1 -0
- package/{dist → lib/summary}/summarizerHeuristics.d.ts +1 -1
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -0
- package/lib/{summarizerHeuristics.js → summary/summarizerHeuristics.js} +6 -9
- package/lib/summary/summarizerHeuristics.js.map +1 -0
- package/{dist → lib/summary}/summarizerTypes.d.ts +22 -22
- package/lib/summary/summarizerTypes.d.ts.map +1 -0
- package/lib/summary/summarizerTypes.js.map +1 -0
- package/lib/summary/summaryCollection.d.ts.map +1 -0
- package/lib/{summaryCollection.js → summary/summaryCollection.js} +18 -8
- package/lib/summary/summaryCollection.js.map +1 -0
- package/{dist → lib/summary}/summaryFormat.d.ts +1 -40
- package/lib/summary/summaryFormat.d.ts.map +1 -0
- package/lib/{summaryFormat.js → summary/summaryFormat.js} +20 -20
- package/lib/summary/summaryFormat.js.map +1 -0
- package/lib/summary/summaryGenerator.d.ts.map +1 -0
- package/lib/{summaryGenerator.js → summary/summaryGenerator.js} +33 -15
- package/lib/summary/summaryGenerator.js.map +1 -0
- package/lib/{summaryManager.d.ts → summary/summaryManager.d.ts} +1 -1
- package/lib/summary/summaryManager.d.ts.map +1 -0
- package/lib/{summaryManager.js → summary/summaryManager.js} +21 -9
- package/lib/summary/summaryManager.js.map +1 -0
- package/lib/throttler.d.ts +2 -2
- package/lib/throttler.d.ts.map +1 -1
- package/lib/throttler.js +4 -4
- package/lib/throttler.js.map +1 -1
- package/package.json +60 -51
- package/prettier.config.cjs +1 -1
- package/src/batchTracker.ts +54 -49
- package/src/blobManager.ts +825 -674
- package/src/connectionTelemetry.ts +280 -249
- package/src/containerHandleContext.ts +27 -29
- package/src/containerRuntime.ts +3249 -2978
- package/src/dataStore.ts +172 -159
- package/src/dataStoreContext.ts +1141 -1057
- package/src/dataStoreContexts.ts +178 -161
- package/src/dataStoreRegistry.ts +25 -20
- package/src/dataStores.ts +880 -731
- package/src/deltaScheduler.ts +158 -150
- package/{garbageCollection.md → src/gc/garbageCollection.md} +16 -3
- package/src/gc/garbageCollection.ts +1506 -0
- package/src/gc/gcDefinitions.ts +244 -0
- package/src/gc/gcHelpers.ts +86 -0
- package/src/gc/gcSummaryStateTracker.ts +339 -0
- package/src/gc/gcSweepReadyUsageDetection.ts +145 -0
- package/src/gc/gcUnreferencedStateTracker.ts +114 -0
- package/src/gc/index.ts +40 -0
- package/src/index.ts +67 -70
- package/src/opLifecycle/README.md +152 -0
- package/src/opLifecycle/batchManager.ts +101 -144
- package/src/opLifecycle/definitions.ts +33 -29
- package/src/opLifecycle/index.ts +5 -5
- package/src/opLifecycle/opCompressor.ts +55 -53
- package/src/opLifecycle/opDecompressor.ts +100 -81
- package/src/opLifecycle/opSplitter.ts +233 -188
- package/src/opLifecycle/outbox.ts +251 -195
- package/src/opLifecycle/remoteMessageProcessor.ts +62 -62
- package/src/opProperties.ts +11 -9
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +396 -338
- package/src/scheduleManager.ts +299 -269
- package/src/serializedSnapshotStorage.ts +126 -112
- package/src/summary/index.ts +99 -0
- package/src/summary/orderedClientElection.ts +564 -0
- package/src/summary/runWhileConnectedCoordinator.ts +113 -0
- package/src/summary/runningSummarizer.ts +788 -0
- package/src/summary/summarizer.ts +386 -0
- package/src/summary/summarizerClientElection.ts +139 -0
- package/src/{summarizerHandle.ts → summary/summarizerHandle.ts} +11 -9
- package/src/summary/summarizerHeuristics.ts +219 -0
- package/src/summary/summarizerTypes.ts +521 -0
- package/src/summary/summaryCollection.ts +450 -0
- package/src/summary/summaryFormat.ts +226 -0
- package/src/summary/summaryGenerator.ts +505 -0
- package/src/summary/summaryManager.ts +423 -0
- package/src/throttler.ts +131 -122
- package/tsconfig.esnext.json +6 -6
- package/tsconfig.json +9 -13
- package/dist/garbageCollection.d.ts.map +0 -1
- package/dist/garbageCollection.js.map +0 -1
- package/dist/garbageCollectionConstants.d.ts +0 -25
- package/dist/garbageCollectionConstants.d.ts.map +0 -1
- package/dist/garbageCollectionConstants.js.map +0 -1
- package/dist/garbageCollectionTombstoneUtils.d.ts +0 -14
- package/dist/garbageCollectionTombstoneUtils.d.ts.map +0 -1
- package/dist/garbageCollectionTombstoneUtils.js +0 -23
- package/dist/garbageCollectionTombstoneUtils.js.map +0 -1
- package/dist/gcSweepReadyUsageDetection.d.ts.map +0 -1
- package/dist/gcSweepReadyUsageDetection.js.map +0 -1
- package/dist/orderedClientElection.d.ts.map +0 -1
- package/dist/orderedClientElection.js.map +0 -1
- package/dist/runWhileConnectedCoordinator.d.ts.map +0 -1
- package/dist/runWhileConnectedCoordinator.js.map +0 -1
- package/dist/runningSummarizer.d.ts.map +0 -1
- package/dist/runningSummarizer.js.map +0 -1
- package/dist/summarizer.d.ts.map +0 -1
- package/dist/summarizer.js.map +0 -1
- package/dist/summarizerClientElection.d.ts.map +0 -1
- package/dist/summarizerClientElection.js.map +0 -1
- package/dist/summarizerHandle.d.ts.map +0 -1
- package/dist/summarizerHandle.js.map +0 -1
- package/dist/summarizerHeuristics.d.ts.map +0 -1
- package/dist/summarizerHeuristics.js.map +0 -1
- package/dist/summarizerTypes.d.ts.map +0 -1
- package/dist/summarizerTypes.js.map +0 -1
- package/dist/summaryCollection.d.ts.map +0 -1
- package/dist/summaryCollection.js.map +0 -1
- package/dist/summaryFormat.d.ts.map +0 -1
- package/dist/summaryFormat.js.map +0 -1
- package/dist/summaryGenerator.d.ts.map +0 -1
- package/dist/summaryGenerator.js.map +0 -1
- package/dist/summaryManager.d.ts.map +0 -1
- package/dist/summaryManager.js.map +0 -1
- package/lib/garbageCollection.d.ts.map +0 -1
- package/lib/garbageCollection.js.map +0 -1
- package/lib/garbageCollectionConstants.d.ts +0 -25
- package/lib/garbageCollectionConstants.d.ts.map +0 -1
- package/lib/garbageCollectionConstants.js.map +0 -1
- package/lib/garbageCollectionTombstoneUtils.d.ts +0 -14
- package/lib/garbageCollectionTombstoneUtils.d.ts.map +0 -1
- package/lib/garbageCollectionTombstoneUtils.js +0 -19
- package/lib/garbageCollectionTombstoneUtils.js.map +0 -1
- package/lib/gcSweepReadyUsageDetection.d.ts.map +0 -1
- package/lib/gcSweepReadyUsageDetection.js.map +0 -1
- package/lib/orderedClientElection.d.ts.map +0 -1
- package/lib/orderedClientElection.js.map +0 -1
- package/lib/runWhileConnectedCoordinator.d.ts.map +0 -1
- package/lib/runWhileConnectedCoordinator.js.map +0 -1
- package/lib/runningSummarizer.d.ts.map +0 -1
- package/lib/runningSummarizer.js.map +0 -1
- package/lib/summarizer.d.ts.map +0 -1
- package/lib/summarizer.js.map +0 -1
- package/lib/summarizerClientElection.d.ts.map +0 -1
- package/lib/summarizerClientElection.js.map +0 -1
- package/lib/summarizerHandle.d.ts.map +0 -1
- package/lib/summarizerHandle.js.map +0 -1
- package/lib/summarizerHeuristics.d.ts.map +0 -1
- package/lib/summarizerHeuristics.js.map +0 -1
- package/lib/summarizerTypes.d.ts.map +0 -1
- package/lib/summarizerTypes.js.map +0 -1
- package/lib/summaryCollection.d.ts.map +0 -1
- package/lib/summaryCollection.js.map +0 -1
- package/lib/summaryFormat.d.ts.map +0 -1
- package/lib/summaryFormat.js.map +0 -1
- package/lib/summaryGenerator.d.ts.map +0 -1
- package/lib/summaryGenerator.js.map +0 -1
- package/lib/summaryManager.d.ts.map +0 -1
- package/lib/summaryManager.js.map +0 -1
- package/src/garbageCollection.ts +0 -1800
- package/src/garbageCollectionConstants.ts +0 -41
- package/src/garbageCollectionTombstoneUtils.ts +0 -28
- package/src/gcSweepReadyUsageDetection.ts +0 -139
- package/src/orderedClientElection.ts +0 -532
- package/src/runWhileConnectedCoordinator.ts +0 -106
- package/src/runningSummarizer.ts +0 -610
- package/src/summarizer.ts +0 -421
- package/src/summarizerClientElection.ts +0 -132
- package/src/summarizerHeuristics.ts +0 -222
- package/src/summarizerTypes.ts +0 -507
- package/src/summaryCollection.ts +0 -421
- package/src/summaryFormat.ts +0 -256
- package/src/summaryGenerator.ts +0 -450
- package/src/summaryManager.ts +0 -394
- /package/dist/{orderedClientElection.d.ts → summary/orderedClientElection.d.ts} +0 -0
- /package/dist/{runWhileConnectedCoordinator.d.ts → summary/runWhileConnectedCoordinator.d.ts} +0 -0
- /package/dist/{runWhileConnectedCoordinator.js → summary/runWhileConnectedCoordinator.js} +0 -0
- /package/dist/{summarizerClientElection.d.ts → summary/summarizerClientElection.d.ts} +0 -0
- /package/dist/{summarizerClientElection.js → summary/summarizerClientElection.js} +0 -0
- /package/dist/{summarizerHandle.d.ts → summary/summarizerHandle.d.ts} +0 -0
- /package/dist/{summarizerHandle.js → summary/summarizerHandle.js} +0 -0
- /package/dist/{summarizerTypes.js → summary/summarizerTypes.js} +0 -0
- /package/dist/{summaryCollection.d.ts → summary/summaryCollection.d.ts} +0 -0
- /package/dist/{summaryGenerator.d.ts → summary/summaryGenerator.d.ts} +0 -0
- /package/lib/{orderedClientElection.d.ts → summary/orderedClientElection.d.ts} +0 -0
- /package/lib/{runWhileConnectedCoordinator.d.ts → summary/runWhileConnectedCoordinator.d.ts} +0 -0
- /package/lib/{runWhileConnectedCoordinator.js → summary/runWhileConnectedCoordinator.js} +0 -0
- /package/lib/{summarizerClientElection.d.ts → summary/summarizerClientElection.d.ts} +0 -0
- /package/lib/{summarizerClientElection.js → summary/summarizerClientElection.js} +0 -0
- /package/lib/{summarizerHandle.d.ts → summary/summarizerHandle.d.ts} +0 -0
- /package/lib/{summarizerHandle.js → summary/summarizerHandle.js} +0 -0
- /package/lib/{summarizerTypes.js → summary/summarizerTypes.js} +0 -0
- /package/lib/{summaryCollection.d.ts → summary/summaryCollection.d.ts} +0 -0
- /package/lib/{summaryGenerator.d.ts → summary/summaryGenerator.d.ts} +0 -0
package/dist/blobManager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blobManager.js","sourceRoot":"","sources":["../src/blobManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAAkC;AAIlC,iEAKuC;AACvC,+DAAmH;AAEnH,iFAAoE;AACpE,qEAA8H;AAM9H,2CAAuE;AACvE,yEAAkE;AAClE,6EAAuE;AACvE,uFAAyE;AAEzE;;;;;;GAMG;AACH,MAAa,UAAU;IAWnB,YACoB,IAAY,EACZ,YAAiC,EAC1C,GAAuB;QAFd,SAAI,GAAJ,IAAI,CAAQ;QACZ,iBAAY,GAAZ,YAAY,CAAqB;QAC1C,QAAG,GAAH,GAAG,CAAoB;QAb1B,aAAQ,GAAY,KAAK,CAAC;QAe9B,IAAI,CAAC,YAAY,GAAG,IAAA,yCAAyB,EAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3E,CAAC;IAdD,IAAW,YAAY,KAAmB,OAAO,IAAI,CAAC,CAAC,CAAC;IAExD,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAYM,WAAW;QACd,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACzB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GAAG,EAAE,CAAC;QACjB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,YAAY,EAAE;YAC1C,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAA,6BAAc,EAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC;SAC/D;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;;AAjmBL,kCAkmBC;AAjmB0B,oBAAQ,GAAG,QAAQ,CAAC;AACnB,iCAAqB,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from \"uuid\";\nimport { IFluidHandle, IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { ICreateBlobResponse, ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n createResponseError,\n generateHandleContextPath,\n responseToException,\n SummaryTreeBuilder,\n} from \"@fluidframework/runtime-utils\";\nimport { assert, bufferToString, Deferred, stringToBuffer, TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport { IContainerRuntime, IContainerRuntimeEvents } from \"@fluidframework/container-runtime-definitions\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { ChildLogger, loggerToMonitoringContext, MonitoringContext, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport {\n IGarbageCollectionData,\n ISummaryTreeWithStats,\n ITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { Throttler, formExponentialFn, IThrottler } from \"./throttler\";\nimport { summarizerClientType } from \"./summarizerClientElection\";\nimport { throwOnTombstoneLoadKey } from \"./garbageCollectionConstants\";\nimport { sendGCTombstoneEvent } from \"./garbageCollectionTombstoneUtils\";\n\n/**\n * This class represents blob (long string)\n * This object is used only when creating (writing) new blob and serialization purposes.\n * De-serialization process goes through FluidObjectHandle and request flow:\n * DataObject.request() recognizes requests in the form of `/blobs/<id>`\n * and loads blob.\n */\nexport class BlobHandle implements IFluidHandle<ArrayBufferLike> {\n private attached: boolean = false;\n\n public get IFluidHandle(): IFluidHandle { return this; }\n\n public get isAttached(): boolean {\n return this.attached;\n }\n\n public readonly absolutePath: string;\n\n constructor(\n public readonly path: string,\n public readonly routeContext: IFluidHandleContext,\n public get: () => Promise<any>,\n ) {\n this.absolutePath = generateHandleContextPath(path, this.routeContext);\n }\n\n public attachGraph() {\n this.attached = true;\n }\n\n public bind(handle: IFluidHandle) {\n throw new Error(\"Cannot bind to blob handle\");\n }\n}\n\nclass CancellableThrottler {\n constructor(private readonly throttler: IThrottler) { }\n private cancelP = new Deferred<void>();\n\n public async getDelay(): Promise<void> {\n return Promise.race([\n this.cancelP.promise,\n new Promise<void>((resolve) => setTimeout(resolve, this.throttler.getDelay())),\n ]);\n }\n\n public cancel() {\n this.cancelP.resolve();\n this.cancelP = new Deferred<void>();\n }\n}\n\n/**\n * Information from a snapshot needed to load BlobManager\n */\nexport interface IBlobManagerLoadInfo {\n ids?: string[];\n redirectTable?: [string, string][];\n}\n\n// Restrict the IContainerRuntime interface to the subset required by BlobManager. This helps to make\n// the contract explicit and reduces the amount of mocking required for tests.\nexport type IBlobManagerRuntime =\n Pick<IContainerRuntime, \"attachState\" | \"connected\" | \"logger\" | \"clientDetails\"> & TypedEventEmitter<IContainerRuntimeEvents>;\n\n// Note that while offline we \"submit\" an op before uploading the blob, but we always\n// expect blobs to be uploaded before we actually see the op round-trip\nenum PendingBlobStatus {\n OnlinePendingUpload,\n OnlinePendingOp,\n OfflinePendingUpload,\n OfflinePendingOp,\n}\n\ntype ICreateBlobResponseWithTTL = ICreateBlobResponse & Partial<Record<\"minTTLInSeconds\", number>>;\n\ninterface PendingBlob {\n blob: ArrayBufferLike;\n status: PendingBlobStatus;\n storageId?: string;\n handleP: Deferred<IFluidHandle<ArrayBufferLike>>;\n uploadP: Promise<ICreateBlobResponse>;\n localUploadTime?: number;\n serverUploadTime?: number;\n minTTLInSeconds?: number;\n}\n\nexport interface IPendingBlobs { [id: string]: { blob: string; }; }\n\nexport interface IBlobManagerEvents {\n (event: \"noPendingBlobs\", listener: () => void);\n}\n\nexport class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {\n public static readonly basePath = \"_blobs\";\n private static readonly redirectTableBlobName = \".redirectTable\";\n private readonly mc: MonitoringContext;\n\n /**\n * Map of local IDs to storage IDs. Contains identity entries (id → id) for storage IDs. All requested IDs should\n * be a key in this map. Blobs created while the container is detached are stored in IDetachedBlobStorage which\n * gives local IDs; the storage IDs are filled in at attach time.\n * Note: It contains mappings from all clients, i.e., from remote clients as well. local ID comes from the client\n * that uploaded the blob but its mapping to storage ID is needed in all clients in order to retrieve the blob.\n */\n private readonly redirectTable: Map<string, string | undefined>;\n\n /**\n * Blobs which have not been uploaded or for which we have not yet seen a BlobAttach op round-trip.\n * Until we see the op round-trip, there is a possibility we may need to re-upload the blob, so\n * we must save it. This is true for both the online and offline flow.\n */\n private readonly pendingBlobs: Map<string, PendingBlob> = new Map();\n\n /**\n * Track ops in flight for online flow. This is used for optimizations where if we receive an ack for a storage ID,\n * we can resolve all pending blobs with the same storage ID even though they may have different local IDs. That's\n * because we know that the server will not delete the blob corresponding to that storage ID.\n */\n private readonly opsInFlight: Map<string, string[]> = new Map();\n\n private readonly retryThrottler = new CancellableThrottler(new Throttler(\n 60 * 1000, // 60 sec delay window\n 30 * 1000, // 30 sec max delay\n // throttling function increases exponentially (0ms, 40ms, 80ms, 160ms, etc)\n formExponentialFn({ coefficient: 20, initialDelay: 0 }),\n ));\n\n /** If true, throw an error when a tombstone attachment blob is retrieved. */\n private readonly throwOnTombstoneLoad: boolean;\n /**\n * This stores IDs of tombstoned blobs.\n * Tombstone is a temporary feature that imitates a blob getting swept by garbage collection.\n */\n private readonly tombstonedBlobs: Set<string> = new Set();\n\n constructor(\n private readonly routeContext: IFluidHandleContext,\n snapshot: IBlobManagerLoadInfo,\n private readonly getStorage: () => IDocumentStorageService,\n /**\n * Submit a BlobAttach op. When a blob is uploaded, there is a short grace period before which the blob is\n * deleted. The BlobAttach op notifies the server that blob is in use. The server will then not delete the\n * the blob as long as it is listed as referenced in future summaries. The summarizing client will know to\n * include the storage ID in the summary when it sees the op.\n *\n * The op will also include a local ID to inform all clients of the relation to the storage ID, without\n * knowledge of which they cannot request the blob from storage. It's important that this op is sequenced\n * before any ops that reference the local ID, otherwise, an invalid handle could be added to the document.\n */\n private readonly sendBlobAttachOp: (localId: string, storageId?: string) => void,\n // To be called when a blob node is requested. blobPath is the path of the blob's node in GC's graph. It's\n // of the format `/<BlobManager.basePath>/<blobId>`.\n private readonly blobRequested: (blobPath: string) => void,\n private readonly addedBlobReference: (fromNodePath: string, toNodePath: string) => void,\n private readonly runtime: IBlobManagerRuntime,\n stashedBlobs: IPendingBlobs = {},\n private readonly getCurrentReferenceTimestampMs: () => number | undefined,\n ) {\n super();\n this.mc = loggerToMonitoringContext(ChildLogger.create(this.runtime.logger, \"BlobManager\"));\n // Read the feature flag that tells whether to throw when a tombstone blob is requested.\n this.throwOnTombstoneLoad =\n this.mc.config.getBoolean(throwOnTombstoneLoadKey) === true &&\n this.runtime.clientDetails.type !== summarizerClientType;\n\n this.runtime.on(\"disconnected\", () => this.onDisconnected());\n this.redirectTable = this.load(snapshot);\n\n // Begin uploading stashed blobs from previous container instance\n Object.entries(stashedBlobs).forEach(([localId, entry]) => {\n const blob = stringToBuffer(entry.blob, \"base64\");\n this.pendingBlobs.set(localId, {\n blob,\n status: PendingBlobStatus.OfflinePendingUpload,\n handleP: new Deferred(),\n uploadP: this.uploadBlob(localId, blob),\n });\n });\n }\n\n private get pendingOfflineUploads() {\n return Array.from(this.pendingBlobs.values())\n .filter((e) => e.status === PendingBlobStatus.OfflinePendingUpload);\n }\n\n public get hasPendingOfflineUploads(): boolean {\n return this.pendingOfflineUploads.length > 0;\n }\n\n public get hasPendingBlobs(): boolean {\n return (this.runtime.attachState !== AttachState.Attached && this.redirectTable.size > 0)\n || this.pendingBlobs.size > 0;\n }\n\n /**\n * Upload blobs added while offline. This must be completed before connecting and resubmitting ops.\n */\n public async onConnected() {\n this.retryThrottler.cancel();\n const pendingUploads = this.pendingOfflineUploads.map(async (e) => e.uploadP);\n await PerformanceEvent.timedExecAsync(this.mc.logger, {\n eventName: \"BlobUploadOnConnected\",\n count: pendingUploads.length,\n }, async () => Promise.all(pendingUploads),\n { start: true, end: true },\n );\n }\n\n /**\n * Transition online blobs waiting for BlobAttach op round-trip since we will not see the op until we are connected\n * again\n */\n private onDisconnected() {\n for (const [localId, entry] of this.pendingBlobs) {\n if (entry.status === PendingBlobStatus.OnlinePendingOp) {\n // This will submit another BlobAttach op for this blob. This is necessary because the one we sent\n // already didn't have the local ID.\n this.transitionToOffline(localId);\n }\n }\n }\n\n /**\n * For a blobId, returns its path in GC's graph. The node path is of the format `/<BlobManager.basePath>/<blobId>`\n * This path must match the path of the blob handle returned by the createBlob API because blobs are marked\n * referenced by storing these handles in a referenced DDS.\n */\n private getBlobGCNodePath(blobId: string) {\n return `/${BlobManager.basePath}/${blobId}`;\n }\n\n /**\n * Set of actual storage IDs (i.e., IDs that can be requested from storage). This will be empty if the container is\n * detached or there are no (non-pending) attachment blobs in the document\n */\n private get storageIds(): Set<string> {\n const ids = new Set<string | undefined>(this.redirectTable.values());\n\n // If we are detached, we will not have storage IDs, only undefined\n const undefinedValueInTable = ids.delete(undefined);\n\n // For a detached container, entries are inserted into the redirect table with an undefined storage ID.\n // For an attached container, entries are inserted w/storage ID after the BlobAttach op round-trips.\n assert(!undefinedValueInTable || this.runtime.attachState === AttachState.Detached && ids.size === 0,\n 0x382 /* 'redirectTable' must contain only undefined while detached / defined values while attached */);\n\n return ids as Set<string>;\n }\n\n public async getBlob(blobId: string): Promise<ArrayBufferLike> {\n const request = { url: blobId };\n if (this.tombstonedBlobs.has(blobId) ) {\n const error = responseToException(createResponseError(404, \"Blob was deleted\", request), request);\n sendGCTombstoneEvent(\n this.mc,\n {\n eventName: \"GC_Tombstone_Blob_Requested\",\n category: this.throwOnTombstoneLoad ? \"error\" : \"generic\",\n isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,\n },\n [BlobManager.basePath],\n error,\n );\n if (this.throwOnTombstoneLoad) {\n throw error;\n }\n }\n\n const pending = this.pendingBlobs.get(blobId);\n if (pending) {\n return pending.blob;\n }\n let storageId: string;\n if (this.runtime.attachState === AttachState.Detached) {\n assert(this.redirectTable.has(blobId), 0x383 /* requesting unknown blobs */);\n\n // Blobs created while the container is detached are stored in IDetachedBlobStorage.\n // The 'IDocumentStorageService.readBlob()' call below will retrieve these via localId.\n storageId = blobId;\n } else {\n const attachedStorageId = this.redirectTable.get(blobId);\n assert(!!attachedStorageId, 0x11f /* \"requesting unknown blobs\" */);\n storageId = attachedStorageId;\n }\n\n // Let runtime know that the corresponding GC node was requested.\n this.blobRequested(this.getBlobGCNodePath(blobId));\n\n return PerformanceEvent.timedExecAsync(\n this.mc.logger,\n { eventName: \"AttachmentReadBlob\", id: storageId },\n async () => {\n return this.getStorage().readBlob(storageId);\n },\n { end: true, cancel: \"error\" },\n );\n }\n\n private getBlobHandle(id: string): IFluidHandle<ArrayBufferLike> {\n assert(this.redirectTable.has(id) || this.pendingBlobs.has(id),\n 0x384 /* requesting handle for unknown blob */);\n return new BlobHandle(\n `${BlobManager.basePath}/${id}`,\n this.routeContext,\n async () => this.getBlob(id),\n );\n }\n\n private async createBlobDetached(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n // Blobs created while the container is detached are stored in IDetachedBlobStorage.\n // The 'IDocumentStorageService.createBlob()' call below will respond with a localId.\n const response = await this.getStorage().createBlob(blob);\n this.setRedirection(response.id, undefined);\n return this.getBlobHandle(response.id);\n }\n\n public async createBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n if (this.runtime.attachState === AttachState.Detached) {\n return this.createBlobDetached(blob);\n }\n if (this.runtime.attachState === AttachState.Attaching) {\n // blob upload is not supported in \"Attaching\" state\n this.mc.logger.sendTelemetryEvent({ eventName: \"CreateBlobWhileAttaching\" });\n await new Promise<void>((resolve) => this.runtime.once(\"attached\", resolve));\n }\n assert(this.runtime.attachState === AttachState.Attached,\n 0x385 /* For clarity and paranoid defense against adding future attachment states */);\n\n // Create a local ID for the blob. After uploading it to storage and before returning it, a local ID to\n // storage ID mapping is created.\n const localId = uuid();\n const pendingEntry: PendingBlob = {\n blob,\n status: PendingBlobStatus.OnlinePendingUpload,\n handleP: new Deferred(),\n uploadP: this.uploadBlob(localId, blob),\n };\n this.pendingBlobs.set(localId, pendingEntry);\n\n return pendingEntry.handleP.promise;\n }\n\n private async uploadBlob(localId: string, blob: ArrayBufferLike): Promise<ICreateBlobResponse> {\n return PerformanceEvent.timedExecAsync(\n this.mc.logger,\n { eventName: \"createBlob\" },\n async () => this.getStorage().createBlob(blob),\n { end: true, cancel: this.runtime.connected ? \"error\" : \"generic\" },\n ).then(\n (response) => this.onUploadResolve(localId, response),\n async (err) => this.onUploadReject(localId, err),\n );\n }\n\n /**\n * Set up a mapping in the redirect table from fromId to toId. Also, notify the runtime that a reference is added\n * which is required for GC.\n */\n private setRedirection(fromId: string, toId: string | undefined) {\n this.redirectTable.set(fromId, toId);\n // Notify runtime of a reference added if toId is not undefined. It can be undefined when a blob is uploaded in\n // detached mode. In this case, the entry will be updated when the blob is updated.\n if (toId !== undefined) {\n this.addedBlobReference(this.getBlobGCNodePath(fromId), this.getBlobGCNodePath(toId));\n }\n }\n\n private deleteAndEmitsIfEmpty(id: string) {\n if (this.pendingBlobs.has(id)) {\n this.pendingBlobs.delete(id);\n if (!this.hasPendingBlobs) {\n this.emit(\"noPendingBlobs\");\n }\n }\n }\n\n private onUploadResolve(localId: string, response: ICreateBlobResponseWithTTL) {\n const entry = this.pendingBlobs.get(localId);\n assert(entry?.status === PendingBlobStatus.OnlinePendingUpload ||\n entry?.status === PendingBlobStatus.OfflinePendingUpload,\n 0x386 /* Must have pending blob entry for uploaded blob */);\n entry.storageId = response.id;\n entry.localUploadTime = Date.now();\n entry.minTTLInSeconds = response.minTTLInSeconds;\n entry.serverUploadTime = this.getCurrentReferenceTimestampMs();\n if (this.runtime.connected) {\n if (entry.status === PendingBlobStatus.OnlinePendingUpload) {\n // Send a blob attach op. This serves two purposes:\n // 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\n // until its storage ID is added to the next summary.\n // 2. It will create a local ID to storage ID mapping in all clients which is needed to retrieve the\n // blob from the server via the storage ID.\n this.logTimeInfo(entry, \"sendBlobAttachResolveTTL\");\n this.sendBlobAttachOp(localId, response.id);\n if (this.storageIds.has(response.id)) {\n // The blob is de-duped. Set up a local ID to storage ID mapping and return the blob. Since this is\n // an existing blob, we don't have to wait for the op to be ack'd since this step has already\n // happened before and so, the server won't delete it.\n this.setRedirection(localId, response.id);\n entry.handleP.resolve(this.getBlobHandle(localId));\n this.deleteAndEmitsIfEmpty(localId);\n } else {\n // If there is already an op for this storage ID, append the local ID to the list. Once any op for\n // this storage ID is ack'd, all pending blobs for it can be resolved since the op will keep the\n // blob alive in storage.\n this.opsInFlight.set(response.id, (this.opsInFlight.get(response.id) ?? []).concat(localId));\n entry.status = PendingBlobStatus.OnlinePendingOp;\n }\n } else if (entry.status === PendingBlobStatus.OfflinePendingUpload) {\n // We already submitted a BlobAttach op for this blob when it was transitioned to offline flow\n entry.status = PendingBlobStatus.OfflinePendingOp;\n }\n } else {\n // connected to storage but not ordering service?\n this.mc.logger.sendTelemetryEvent({ eventName: \"BlobUploadSuccessWhileDisconnected\" });\n if (entry.status === PendingBlobStatus.OnlinePendingUpload) {\n this.transitionToOffline(localId);\n }\n entry.status = PendingBlobStatus.OfflinePendingOp;\n }\n return response;\n }\n\n private async onUploadReject(localId: string, error) {\n const entry = this.pendingBlobs.get(localId);\n assert(!!entry, 0x387 /* Must have pending blob entry for blob which failed to upload */);\n if (!this.runtime.connected) {\n if (entry.status === PendingBlobStatus.OnlinePendingUpload) {\n this.transitionToOffline(localId);\n }\n // we are probably not connected to storage but start another upload request in case we are\n entry.uploadP = this.retryThrottler.getDelay().then(async () => this.uploadBlob(localId, entry.blob));\n return entry.uploadP;\n } else {\n entry.handleP.reject(error);\n throw error;\n }\n }\n\n private transitionToOffline(localId: string) {\n assert(!this.runtime.connected, 0x388 /* Must only transition to offline flow while runtime is disconnected */);\n const entry = this.pendingBlobs.get(localId);\n assert(!!entry, 0x389 /* No pending blob entry */);\n assert([PendingBlobStatus.OnlinePendingUpload, PendingBlobStatus.OnlinePendingOp].includes(entry.status),\n 0x38a /* Blob must be in online flow to transition to offline flow */);\n\n /**\n * If we haven't already submitted a BlobAttach op for this entry, send it before returning the blob handle.\n * This will make sure that the BlobAttach op is sequenced prior to any ops referencing the handle. Otherwise,\n * an invalid handle could be added to the document.\n * storageId may be undefined but since we are not connected we will have a chance to add it when reSubmit()\n * is called on reconnection.\n */\n if (entry.status !== PendingBlobStatus.OnlinePendingOp) {\n this.logTimeInfo(entry, \"sendBlobAttachTransitionOfflineTTL\");\n this.sendBlobAttachOp(localId, entry.storageId);\n }\n\n entry.status = entry.status === PendingBlobStatus.OnlinePendingUpload\n ? PendingBlobStatus.OfflinePendingUpload\n : PendingBlobStatus.OfflinePendingOp;\n\n entry.handleP.resolve(this.getBlobHandle(localId));\n }\n\n /**\n * Resubmit a BlobAttach op. Used to add storage IDs to ops that were\n * submitted to runtime while disconnected.\n * @param metadata - op metadata containing storage and/or local IDs\n */\n public reSubmit(metadata: Record<string, unknown> | undefined) {\n assert(!!metadata, 0x38b /* Resubmitted ops must have metadata */);\n const { localId, blobId }: { localId?: string; blobId?: string } = metadata;\n assert(localId !== undefined, 0x50d /* local ID not available on reSubmit */);\n const pendingEntry = this.pendingBlobs.get(localId);\n if (pendingEntry) {\n this.logTimeInfo(pendingEntry, \"sendBlobAttachResubmitTTL\");\n }\n if (!blobId) {\n // We submitted this op while offline. The blob should have been uploaded by now.\n assert(pendingEntry?.status === PendingBlobStatus.OfflinePendingOp &&\n !!pendingEntry?.storageId, 0x38d /* blob must be uploaded before resubmitting BlobAttach op */);\n return this.sendBlobAttachOp(localId, pendingEntry.storageId);\n }\n return this.sendBlobAttachOp(localId, blobId);\n }\n\n private logTimeInfo(pendingEntry: PendingBlob, eventName: string) {\n let timeLapseSinceLocalUpload: number = 0;\n let timeLapseSinceServerUpload: number = 0;\n let expiredUsingLocalTime;\n let expiredUsingServerTime;\n if(pendingEntry.localUploadTime){\n timeLapseSinceLocalUpload = (Date.now() - pendingEntry.localUploadTime) / 1000;\n expiredUsingLocalTime = (pendingEntry.minTTLInSeconds?? 0) - timeLapseSinceLocalUpload < 0 ? true : false;\n }\n if(pendingEntry.serverUploadTime){\n timeLapseSinceServerUpload = (Date.now() - pendingEntry.serverUploadTime) / 1000;\n expiredUsingServerTime = (pendingEntry.minTTLInSeconds?? 0) - timeLapseSinceServerUpload < 0 ? true : false;\n }\n this.mc.logger.sendTelemetryEvent({\n eventName,\n entryStatus: pendingEntry.status,\n timeLapseSinceLocalUpload,\n timeLapseSinceServerUpload,\n minTTLInSeconds: pendingEntry.minTTLInSeconds,\n expiredUsingLocalTime,\n expiredUsingServerTime,\n });\n\n }\n\n public processBlobAttachOp(message: ISequencedDocumentMessage, local: boolean) {\n const localId = message.metadata?.localId;\n const blobId = message.metadata?.blobId;\n assert(blobId !== undefined, 0x12a /* \"Missing blob id on metadata\" */);\n\n // Set up a mapping from local ID to storage ID. This is crucial since without this the blob cannot be\n // requested from the server.\n // Note: The check for undefined is needed for back-compat when localId was not part of the BlobAttach op that\n // was sent when online.\n if (localId !== undefined) {\n this.setRedirection(localId, blobId);\n }\n // set identity (id -> id) entry\n this.setRedirection(blobId, blobId);\n\n if (local) {\n assert(localId !== undefined, 0x50e /* local ID not present in blob attach message */);\n const waitingBlobs = this.opsInFlight.get(blobId);\n if (waitingBlobs !== undefined) {\n // For each op corresponding to this storage ID that we are waiting for, resolve the pending blob.\n // This is safe because the server will keep the blob alive and the op containing the local ID to\n // storage ID is already in flight and any op containing this local ID will be sequenced after that.\n waitingBlobs.forEach((pendingLocalId) => {\n const pendingBlobEntry = this.pendingBlobs.get(pendingLocalId);\n assert(\n pendingBlobEntry !== undefined,\n 0x38f, /* local online BlobAttach op with no pending blob entry */\n );\n\n // It's possible we transitioned to offline flow while waiting for this op.\n if (pendingBlobEntry.status === PendingBlobStatus.OnlinePendingOp) {\n this.setRedirection(pendingLocalId, blobId);\n pendingBlobEntry.handleP.resolve(this.getBlobHandle(pendingLocalId));\n this.deleteAndEmitsIfEmpty(pendingLocalId);\n }\n });\n this.opsInFlight.delete(blobId);\n }\n // For blobs that were transitioned to offline flow while waiting for this op, the entry should be deleted.\n this.deleteAndEmitsIfEmpty(localId);\n }\n }\n\n /**\n * Reads blobs needed to load BlobManager from storage.\n * @param blobsTree - Tree containing IDs of previously attached blobs. We\n * look for the IDs in the blob entries of the tree since the both the r11s\n * and SPO drivers replace the attachment types returned in snapshot() with blobs.\n */\n public static async load(\n blobsTree: ISnapshotTree | undefined,\n tryFetchBlob: (id: string) => Promise<[string, string][]>,\n ): Promise<IBlobManagerLoadInfo> {\n if (!blobsTree) {\n return {};\n }\n let redirectTable;\n const tableId = blobsTree.blobs[this.redirectTableBlobName];\n if (tableId) {\n redirectTable = await tryFetchBlob(tableId);\n }\n const ids = Object.entries(blobsTree.blobs)\n .filter(([k, _]) => k !== this.redirectTableBlobName).map(([_, v]) => v);\n return { ids, redirectTable };\n }\n\n /**\n * Load a set of previously attached blob IDs and redirect table from a previous snapshot.\n */\n private load(snapshot: IBlobManagerLoadInfo): Map<string, string | undefined> {\n this.mc.logger.sendTelemetryEvent({\n eventName: \"AttachmentBlobsLoaded\",\n count: snapshot.ids?.length ?? 0,\n redirectTable: snapshot.redirectTable?.length,\n });\n const table = new Map<string, string | undefined>(snapshot.redirectTable);\n if (snapshot.ids) {\n const detached = this.runtime.attachState === AttachState.Detached;\n // If we are detached, we don't have storage IDs yet, so set to undefined\n // Otherwise, set identity (id -> id) entries\n snapshot.ids.forEach((entry) => table.set(entry, detached ? undefined : entry));\n }\n return table;\n }\n\n /**\n * Generates data used for garbage collection. Each blob uploaded represents a node in the GC graph as it can be\n * individually referenced by storing its handle in a referenced DDS. Returns the list of blob ids as GC nodes.\n * @param fullGC - true to bypass optimizations and force full generation of GC data. BlobManager doesn't care\n * about this for now because the data is a simple list of blob ids.\n */\n public getGCData(fullGC: boolean = false): IGarbageCollectionData {\n const gcData: IGarbageCollectionData = { gcNodes: {} };\n for (const [localId, storageId] of this.redirectTable) {\n assert(!!storageId, 0x390 /* Must be attached to get GC data */);\n gcData.gcNodes[this.getBlobGCNodePath(localId)] = [this.getBlobGCNodePath(storageId)];\n }\n return gcData;\n }\n\n /**\n * This is called to update blobs whose routes are unused. The unused blobs are deleted.\n * @param unusedRoutes - The routes of the blob nodes that are unused.\n */\n public updateUnusedRoutes(unusedRoutes: string[]): void {\n // The routes or blob node paths are in the same format as returned in getGCData -\n // `/<BlobManager.basePath>/<blobId>`.\n for (const route of unusedRoutes) {\n const pathParts = route.split(\"/\");\n assert(\n pathParts.length === 3 && pathParts[1] === BlobManager.basePath,\n 0x2d5 /* \"Invalid blob node id in unused routes.\" */,\n );\n const blobId = pathParts[2];\n this.redirectTable.delete(blobId);\n }\n }\n\n /**\n * This is called to update blobs whose routes are tombstones. Tombstoned blobs enable testing scenarios with\n * accessing deleted content without actually deleting content from summaries.\n * @param tombstonedRoutes - The routes of blob nodes that are tombstones.\n */\n public updateTombstonedRoutes(tombstonedRoutes: string[]) {\n const tombstonedBlobsSet: Set<string> = new Set();\n // The routes or blob node paths are in the same format as returned in getGCData -\n // `/<BlobManager.basePath>/<blobId>`.\n for (const route of tombstonedRoutes) {\n const pathParts = route.split(\"/\");\n assert(\n pathParts.length === 3 && pathParts[1] === BlobManager.basePath,\n 0x50f /* Invalid blob node id in tombstoned routes. */,\n );\n tombstonedBlobsSet.add(pathParts[2]);\n }\n\n // Remove blobs from the tombstone list that were tombstoned but aren't anymore as per the tombstoneRoutes.\n for (const blobId of this.tombstonedBlobs) {\n if (!tombstonedBlobsSet.has(blobId)) {\n this.tombstonedBlobs.delete(blobId);\n }\n }\n\n // Mark blobs that are now tombstoned by adding them to the tombstone list.\n for (const blobId of tombstonedBlobsSet) {\n this.tombstonedBlobs.add(blobId);\n }\n }\n\n public summarize(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n // if storageIds is empty, it means we are detached and have only local IDs, or that there are no blobs attached\n const blobIds = this.storageIds.size > 0 ? Array.from(this.storageIds) : Array.from(this.redirectTable.keys());\n const builder = new SummaryTreeBuilder();\n blobIds.forEach((blobId) => {\n builder.addAttachment(blobId);\n });\n\n // Any non-identity entries in the table need to be saved in the summary\n if (this.redirectTable.size > blobIds.length) {\n builder.addBlob(\n BlobManager.redirectTableBlobName,\n // filter out identity entries\n JSON.stringify(Array.from(this.redirectTable.entries())\n .filter(([localId, storageId]) => localId !== storageId)),\n );\n }\n\n return builder.getSummaryTree();\n }\n\n public setRedirectTable(table: Map<string, string>) {\n assert(this.runtime.attachState === AttachState.Detached,\n 0x252 /* \"redirect table can only be set in detached container\" */);\n assert(this.redirectTable.size === table.size,\n 0x391 /* Redirect table size must match BlobManager's local ID count */);\n for (const [localId, storageId] of table) {\n assert(this.redirectTable.has(localId), 0x254 /* \"unrecognized id in redirect table\" */);\n this.setRedirection(localId, storageId);\n // set identity (id -> id) entry\n this.setRedirection(storageId, storageId);\n }\n }\n\n public getPendingBlobs(): IPendingBlobs {\n const blobs = {};\n for (const [key, entry] of this.pendingBlobs) {\n blobs[key] = { blob: bufferToString(entry.blob, \"base64\") };\n }\n return blobs;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"blobManager.js","sourceRoot":"","sources":["../src/blobManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAAkC;AAQlC,iEAKuC;AACvC,+DAMsC;AAKtC,iFAAoE;AACpE,qEAKyC;AAMzC,yDAAkF;AACl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BuB,oBAAQ,GAAG,QAAQ,CAAC;AACnB,iCAAqB,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from \"uuid\";\nimport { IFluidHandle, IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n\tICreateBlobResponse,\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n\tcreateResponseError,\n\tgenerateHandleContextPath,\n\tresponseToException,\n\tSummaryTreeBuilder,\n} from \"@fluidframework/runtime-utils\";\nimport {\n\tassert,\n\tbufferToString,\n\tDeferred,\n\tstringToBuffer,\n\tTypedEventEmitter,\n} from \"@fluidframework/common-utils\";\nimport {\n\tIContainerRuntime,\n\tIContainerRuntimeEvents,\n} from \"@fluidframework/container-runtime-definitions\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport {\n\tChildLogger,\n\tloggerToMonitoringContext,\n\tMonitoringContext,\n\tPerformanceEvent,\n} from \"@fluidframework/telemetry-utils\";\nimport {\n\tIGarbageCollectionData,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { ContainerRuntime, TombstoneResponseHeaderKey } from \"./containerRuntime\";\nimport { sendGCUnexpectedUsageEvent, sweepAttachmentBlobsKey, throwOnTombstoneLoadKey } from \"./gc\";\nimport { Throttler, formExponentialFn, IThrottler } from \"./throttler\";\nimport { summarizerClientType } from \"./summary\";\n\n/**\n * This class represents blob (long string)\n * This object is used only when creating (writing) new blob and serialization purposes.\n * De-serialization process goes through FluidObjectHandle and request flow:\n * DataObject.request() recognizes requests in the form of `/blobs/<id>`\n * and loads blob.\n */\nexport class BlobHandle implements IFluidHandle<ArrayBufferLike> {\n\tprivate attached: boolean = false;\n\n\tpublic get IFluidHandle(): IFluidHandle {\n\t\treturn this;\n\t}\n\n\tpublic get isAttached(): boolean {\n\t\treturn this.attached;\n\t}\n\n\tpublic readonly absolutePath: string;\n\n\tconstructor(\n\t\tpublic readonly path: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t\tpublic get: () => Promise<any>,\n\t) {\n\t\tthis.absolutePath = generateHandleContextPath(path, this.routeContext);\n\t}\n\n\tpublic attachGraph() {\n\t\tthis.attached = true;\n\t}\n\n\tpublic bind(handle: IFluidHandle) {\n\t\tthrow new Error(\"Cannot bind to blob handle\");\n\t}\n}\n\nclass CancellableThrottler {\n\tconstructor(private readonly throttler: IThrottler) {}\n\tprivate cancelP = new Deferred<void>();\n\n\tpublic async getDelay(): Promise<void> {\n\t\treturn Promise.race([\n\t\t\tthis.cancelP.promise,\n\t\t\tnew Promise<void>((resolve) => setTimeout(resolve, this.throttler.getDelay())),\n\t\t]);\n\t}\n\n\tpublic cancel() {\n\t\tthis.cancelP.resolve();\n\t\tthis.cancelP = new Deferred<void>();\n\t}\n}\n\n/**\n * Information from a snapshot needed to load BlobManager\n */\nexport interface IBlobManagerLoadInfo {\n\tids?: string[];\n\tredirectTable?: [string, string][];\n}\n\n// Restrict the IContainerRuntime interface to the subset required by BlobManager. This helps to make\n// the contract explicit and reduces the amount of mocking required for tests.\nexport type IBlobManagerRuntime = Pick<\n\tIContainerRuntime,\n\t\"attachState\" | \"connected\" | \"logger\" | \"clientDetails\"\n> &\n\tPick<ContainerRuntime, \"gcTombstoneEnforcementAllowed\"> &\n\tTypedEventEmitter<IContainerRuntimeEvents>;\n\n// Note that while offline we \"submit\" an op before uploading the blob, but we always\n// expect blobs to be uploaded before we actually see the op round-trip\nenum PendingBlobStatus {\n\tOnlinePendingUpload,\n\tOnlinePendingOp,\n\tOfflinePendingUpload,\n\tOfflinePendingOp,\n}\n\ntype ICreateBlobResponseWithTTL = ICreateBlobResponse & Partial<Record<\"minTTLInSeconds\", number>>;\n\ninterface PendingBlob {\n\tblob: ArrayBufferLike;\n\tstatus: PendingBlobStatus;\n\tstorageId?: string;\n\thandleP: Deferred<IFluidHandle<ArrayBufferLike>>;\n\tuploadP: Promise<ICreateBlobResponse>;\n\tlocalUploadTime?: number;\n\tserverUploadTime?: number;\n\tminTTLInSeconds?: number;\n}\n\nexport interface IPendingBlobs {\n\t[id: string]: { blob: string };\n}\n\nexport interface IBlobManagerEvents {\n\t(event: \"noPendingBlobs\", listener: () => void);\n}\n\nexport class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {\n\tpublic static readonly basePath = \"_blobs\";\n\tprivate static readonly redirectTableBlobName = \".redirectTable\";\n\tprivate readonly mc: MonitoringContext;\n\n\t/**\n\t * Map of local IDs to storage IDs. Contains identity entries (id → id) for storage IDs. All requested IDs should\n\t * be a key in this map. Blobs created while the container is detached are stored in IDetachedBlobStorage which\n\t * gives local IDs; the storage IDs are filled in at attach time.\n\t * Note: It contains mappings from all clients, i.e., from remote clients as well. local ID comes from the client\n\t * that uploaded the blob but its mapping to storage ID is needed in all clients in order to retrieve the blob.\n\t */\n\tprivate readonly redirectTable: Map<string, string | undefined>;\n\n\t/**\n\t * Blobs which have not been uploaded or for which we have not yet seen a BlobAttach op round-trip.\n\t * Until we see the op round-trip, there is a possibility we may need to re-upload the blob, so\n\t * we must save it. This is true for both the online and offline flow.\n\t */\n\tprivate readonly pendingBlobs: Map<string, PendingBlob> = new Map();\n\n\t/**\n\t * Track ops in flight for online flow. This is used for optimizations where if we receive an ack for a storage ID,\n\t * we can resolve all pending blobs with the same storage ID even though they may have different local IDs. That's\n\t * because we know that the server will not delete the blob corresponding to that storage ID.\n\t */\n\tprivate readonly opsInFlight: Map<string, string[]> = new Map();\n\n\tprivate readonly retryThrottler = new CancellableThrottler(\n\t\tnew Throttler(\n\t\t\t60 * 1000, // 60 sec delay window\n\t\t\t30 * 1000, // 30 sec max delay\n\t\t\t// throttling function increases exponentially (0ms, 40ms, 80ms, 160ms, etc)\n\t\t\tformExponentialFn({ coefficient: 20, initialDelay: 0 }),\n\t\t),\n\t);\n\n\t/** If true, throw an error when a tombstone attachment blob is retrieved. */\n\tprivate readonly throwOnTombstoneLoad: boolean;\n\t/**\n\t * This stores IDs of tombstoned blobs.\n\t * Tombstone is a temporary feature that imitates a blob getting swept by garbage collection.\n\t */\n\tprivate readonly tombstonedBlobs: Set<string> = new Set();\n\n\tconstructor(\n\t\tprivate readonly routeContext: IFluidHandleContext,\n\t\tsnapshot: IBlobManagerLoadInfo,\n\t\tprivate readonly getStorage: () => IDocumentStorageService,\n\t\t/**\n\t\t * Submit a BlobAttach op. When a blob is uploaded, there is a short grace period before which the blob is\n\t\t * deleted. The BlobAttach op notifies the server that blob is in use. The server will then not delete the\n\t\t * the blob as long as it is listed as referenced in future summaries. The summarizing client will know to\n\t\t * include the storage ID in the summary when it sees the op.\n\t\t *\n\t\t * The op will also include a local ID to inform all clients of the relation to the storage ID, without\n\t\t * knowledge of which they cannot request the blob from storage. It's important that this op is sequenced\n\t\t * before any ops that reference the local ID, otherwise, an invalid handle could be added to the document.\n\t\t */\n\t\tprivate readonly sendBlobAttachOp: (localId: string, storageId?: string) => void,\n\t\t// Called when a blob node is requested. blobPath is the path of the blob's node in GC's graph.\n\t\t// blobPath's format - `/<BlobManager.basePath>/<blobId>`.\n\t\tprivate readonly blobRequested: (blobPath: string) => void,\n\t\t// Called when a reference is added to a blob. For instance, when creating a localId / storageId to storageId\n\t\t// mapping in the redirect table.\n\t\t// Node path formats - `/<BlobManager.basePath>/<blobId>`.\n\t\tprivate readonly addedBlobReference: (fromNodePath: string, toNodePath: string) => void,\n\t\t// Called to check if a blob has been deleted by GC.\n\t\t// blobPath's format - `/<BlobManager.basePath>/<blobId>`.\n\t\tprivate readonly isBlobDeleted: (blobPath: string) => boolean,\n\t\tprivate readonly runtime: IBlobManagerRuntime,\n\t\tstashedBlobs: IPendingBlobs = {},\n\t\tprivate readonly getCurrentReferenceTimestampMs: () => number | undefined,\n\t) {\n\t\tsuper();\n\t\tthis.mc = loggerToMonitoringContext(ChildLogger.create(this.runtime.logger, \"BlobManager\"));\n\t\t// Read the feature flag that tells whether to throw when a tombstone blob is requested.\n\t\tthis.throwOnTombstoneLoad =\n\t\t\tthis.mc.config.getBoolean(throwOnTombstoneLoadKey) === true &&\n\t\t\tthis.runtime.gcTombstoneEnforcementAllowed &&\n\t\t\tthis.runtime.clientDetails.type !== summarizerClientType;\n\n\t\tthis.runtime.on(\"disconnected\", () => this.onDisconnected());\n\t\tthis.redirectTable = this.load(snapshot);\n\n\t\t// Begin uploading stashed blobs from previous container instance\n\t\tObject.entries(stashedBlobs).forEach(([localId, entry]) => {\n\t\t\tconst blob = stringToBuffer(entry.blob, \"base64\");\n\t\t\tthis.pendingBlobs.set(localId, {\n\t\t\t\tblob,\n\t\t\t\tstatus: PendingBlobStatus.OfflinePendingUpload,\n\t\t\t\thandleP: new Deferred(),\n\t\t\t\tuploadP: this.uploadBlob(localId, blob),\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate get pendingOfflineUploads() {\n\t\treturn Array.from(this.pendingBlobs.values()).filter(\n\t\t\t(e) => e.status === PendingBlobStatus.OfflinePendingUpload,\n\t\t);\n\t}\n\n\tpublic get hasPendingOfflineUploads(): boolean {\n\t\treturn this.pendingOfflineUploads.length > 0;\n\t}\n\n\tpublic get hasPendingBlobs(): boolean {\n\t\treturn (\n\t\t\t(this.runtime.attachState !== AttachState.Attached && this.redirectTable.size > 0) ||\n\t\t\tthis.pendingBlobs.size > 0\n\t\t);\n\t}\n\n\t/**\n\t * Upload blobs added while offline. This must be completed before connecting and resubmitting ops.\n\t */\n\tpublic async onConnected() {\n\t\tthis.retryThrottler.cancel();\n\t\tconst pendingUploads = this.pendingOfflineUploads.map(async (e) => e.uploadP);\n\t\tawait PerformanceEvent.timedExecAsync(\n\t\t\tthis.mc.logger,\n\t\t\t{\n\t\t\t\teventName: \"BlobUploadOnConnected\",\n\t\t\t\tcount: pendingUploads.length,\n\t\t\t},\n\t\t\tasync () => Promise.all(pendingUploads),\n\t\t\t{ start: true, end: true },\n\t\t);\n\t}\n\n\t/**\n\t * Transition online blobs waiting for BlobAttach op round-trip since we will not see the op until we are connected\n\t * again\n\t */\n\tprivate onDisconnected() {\n\t\tfor (const [localId, entry] of this.pendingBlobs) {\n\t\t\tif (entry.status === PendingBlobStatus.OnlinePendingOp) {\n\t\t\t\t// This will submit another BlobAttach op for this blob. This is necessary because the one we sent\n\t\t\t\t// already didn't have the local ID.\n\t\t\t\tthis.transitionToOffline(localId);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * For a blobId, returns its path in GC's graph. The node path is of the format `/<BlobManager.basePath>/<blobId>`\n\t * This path must match the path of the blob handle returned by the createBlob API because blobs are marked\n\t * referenced by storing these handles in a referenced DDS.\n\t */\n\tprivate getBlobGCNodePath(blobId: string) {\n\t\treturn `/${BlobManager.basePath}/${blobId}`;\n\t}\n\n\t/**\n\t * Set of actual storage IDs (i.e., IDs that can be requested from storage). This will be empty if the container is\n\t * detached or there are no (non-pending) attachment blobs in the document\n\t */\n\tprivate get storageIds(): Set<string> {\n\t\tconst ids = new Set<string | undefined>(this.redirectTable.values());\n\n\t\t// If we are detached, we will not have storage IDs, only undefined\n\t\tconst undefinedValueInTable = ids.delete(undefined);\n\n\t\t// For a detached container, entries are inserted into the redirect table with an undefined storage ID.\n\t\t// For an attached container, entries are inserted w/storage ID after the BlobAttach op round-trips.\n\t\tassert(\n\t\t\t!undefinedValueInTable ||\n\t\t\t\t(this.runtime.attachState === AttachState.Detached && ids.size === 0),\n\t\t\t0x382 /* 'redirectTable' must contain only undefined while detached / defined values while attached */,\n\t\t);\n\n\t\treturn ids as Set<string>;\n\t}\n\n\tpublic async getBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\t// Verify that the blob is valid, i.e., it has not been garbage collected. If it is, this will throw an error,\n\t\t// failing the call.\n\t\tthis.verifyBlobValidity(blobId);\n\n\t\tconst pending = this.pendingBlobs.get(blobId);\n\t\tif (pending) {\n\t\t\treturn pending.blob;\n\t\t}\n\t\tlet storageId: string;\n\t\tif (this.runtime.attachState === AttachState.Detached) {\n\t\t\tassert(this.redirectTable.has(blobId), 0x383 /* requesting unknown blobs */);\n\n\t\t\t// Blobs created while the container is detached are stored in IDetachedBlobStorage.\n\t\t\t// The 'IDocumentStorageService.readBlob()' call below will retrieve these via localId.\n\t\t\tstorageId = blobId;\n\t\t} else {\n\t\t\tconst attachedStorageId = this.redirectTable.get(blobId);\n\t\t\tassert(!!attachedStorageId, 0x11f /* \"requesting unknown blobs\" */);\n\t\t\tstorageId = attachedStorageId;\n\t\t}\n\n\t\t// Let runtime know that the corresponding GC node was requested.\n\t\tthis.blobRequested(this.getBlobGCNodePath(blobId));\n\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tthis.mc.logger,\n\t\t\t{ eventName: \"AttachmentReadBlob\", id: storageId },\n\t\t\tasync () => {\n\t\t\t\treturn this.getStorage().readBlob(storageId);\n\t\t\t},\n\t\t\t{ end: true, cancel: \"error\" },\n\t\t);\n\t}\n\n\tprivate getBlobHandle(id: string): IFluidHandle<ArrayBufferLike> {\n\t\tassert(\n\t\t\tthis.redirectTable.has(id) || this.pendingBlobs.has(id),\n\t\t\t0x384 /* requesting handle for unknown blob */,\n\t\t);\n\t\treturn new BlobHandle(`${BlobManager.basePath}/${id}`, this.routeContext, async () =>\n\t\t\tthis.getBlob(id),\n\t\t);\n\t}\n\n\tprivate async createBlobDetached(\n\t\tblob: ArrayBufferLike,\n\t): Promise<IFluidHandle<ArrayBufferLike>> {\n\t\t// Blobs created while the container is detached are stored in IDetachedBlobStorage.\n\t\t// The 'IDocumentStorageService.createBlob()' call below will respond with a localId.\n\t\tconst response = await this.getStorage().createBlob(blob);\n\t\tthis.setRedirection(response.id, undefined);\n\t\treturn this.getBlobHandle(response.id);\n\t}\n\n\tpublic async createBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n\t\tif (this.runtime.attachState === AttachState.Detached) {\n\t\t\treturn this.createBlobDetached(blob);\n\t\t}\n\t\tif (this.runtime.attachState === AttachState.Attaching) {\n\t\t\t// blob upload is not supported in \"Attaching\" state\n\t\t\tthis.mc.logger.sendTelemetryEvent({ eventName: \"CreateBlobWhileAttaching\" });\n\t\t\tawait new Promise<void>((resolve) => this.runtime.once(\"attached\", resolve));\n\t\t}\n\t\tassert(\n\t\t\tthis.runtime.attachState === AttachState.Attached,\n\t\t\t0x385 /* For clarity and paranoid defense against adding future attachment states */,\n\t\t);\n\n\t\t// Create a local ID for the blob. After uploading it to storage and before returning it, a local ID to\n\t\t// storage ID mapping is created.\n\t\tconst localId = uuid();\n\t\tconst pendingEntry: PendingBlob = {\n\t\t\tblob,\n\t\t\tstatus: PendingBlobStatus.OnlinePendingUpload,\n\t\t\thandleP: new Deferred(),\n\t\t\tuploadP: this.uploadBlob(localId, blob),\n\t\t};\n\t\tthis.pendingBlobs.set(localId, pendingEntry);\n\n\t\treturn pendingEntry.handleP.promise;\n\t}\n\n\tprivate async uploadBlob(localId: string, blob: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tthis.mc.logger,\n\t\t\t{ eventName: \"createBlob\" },\n\t\t\tasync () => this.getStorage().createBlob(blob),\n\t\t\t{ end: true, cancel: this.runtime.connected ? \"error\" : \"generic\" },\n\t\t).then(\n\t\t\t(response) => this.onUploadResolve(localId, response),\n\t\t\tasync (err) => this.onUploadReject(localId, err),\n\t\t);\n\t}\n\n\t/**\n\t * Set up a mapping in the redirect table from fromId to toId. Also, notify the runtime that a reference is added\n\t * which is required for GC.\n\t */\n\tprivate setRedirection(fromId: string, toId: string | undefined) {\n\t\tthis.redirectTable.set(fromId, toId);\n\t\t// Notify runtime of a reference added if toId is not undefined. It can be undefined when a blob is uploaded in\n\t\t// detached mode. In this case, the entry will be updated when the blob is updated.\n\t\tif (toId !== undefined) {\n\t\t\tthis.addedBlobReference(this.getBlobGCNodePath(fromId), this.getBlobGCNodePath(toId));\n\t\t}\n\t}\n\n\tprivate deleteAndEmitsIfEmpty(id: string) {\n\t\tif (this.pendingBlobs.has(id)) {\n\t\t\tthis.pendingBlobs.delete(id);\n\t\t\tif (!this.hasPendingBlobs) {\n\t\t\t\tthis.emit(\"noPendingBlobs\");\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onUploadResolve(localId: string, response: ICreateBlobResponseWithTTL) {\n\t\tconst entry = this.pendingBlobs.get(localId);\n\t\tassert(\n\t\t\tentry?.status === PendingBlobStatus.OnlinePendingUpload ||\n\t\t\t\tentry?.status === PendingBlobStatus.OfflinePendingUpload,\n\t\t\t0x386 /* Must have pending blob entry for uploaded blob */,\n\t\t);\n\t\tentry.storageId = response.id;\n\t\tentry.localUploadTime = Date.now();\n\t\tentry.minTTLInSeconds = response.minTTLInSeconds;\n\t\tentry.serverUploadTime = this.getCurrentReferenceTimestampMs();\n\t\tif (this.runtime.connected) {\n\t\t\tif (entry.status === PendingBlobStatus.OnlinePendingUpload) {\n\t\t\t\t// Send a blob attach op. This serves two purposes:\n\t\t\t\t// 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\n\t\t\t\t// until its storage ID is added to the next summary.\n\t\t\t\t// 2. It will create a local ID to storage ID mapping in all clients which is needed to retrieve the\n\t\t\t\t// blob from the server via the storage ID.\n\t\t\t\tthis.logTimeInfo(entry, \"sendBlobAttachResolveTTL\");\n\t\t\t\tthis.sendBlobAttachOp(localId, response.id);\n\t\t\t\tif (this.storageIds.has(response.id)) {\n\t\t\t\t\t// The blob is de-duped. Set up a local ID to storage ID mapping and return the blob. Since this is\n\t\t\t\t\t// an existing blob, we don't have to wait for the op to be ack'd since this step has already\n\t\t\t\t\t// happened before and so, the server won't delete it.\n\t\t\t\t\tthis.setRedirection(localId, response.id);\n\t\t\t\t\tentry.handleP.resolve(this.getBlobHandle(localId));\n\t\t\t\t\tthis.deleteAndEmitsIfEmpty(localId);\n\t\t\t\t} else {\n\t\t\t\t\t// If there is already an op for this storage ID, append the local ID to the list. Once any op for\n\t\t\t\t\t// this storage ID is ack'd, all pending blobs for it can be resolved since the op will keep the\n\t\t\t\t\t// blob alive in storage.\n\t\t\t\t\tthis.opsInFlight.set(\n\t\t\t\t\t\tresponse.id,\n\t\t\t\t\t\t(this.opsInFlight.get(response.id) ?? []).concat(localId),\n\t\t\t\t\t);\n\t\t\t\t\tentry.status = PendingBlobStatus.OnlinePendingOp;\n\t\t\t\t}\n\t\t\t} else if (entry.status === PendingBlobStatus.OfflinePendingUpload) {\n\t\t\t\t// We already submitted a BlobAttach op for this blob when it was transitioned to offline flow\n\t\t\t\tentry.status = PendingBlobStatus.OfflinePendingOp;\n\t\t\t}\n\t\t} else {\n\t\t\t// connected to storage but not ordering service?\n\t\t\tthis.mc.logger.sendTelemetryEvent({ eventName: \"BlobUploadSuccessWhileDisconnected\" });\n\t\t\tif (entry.status === PendingBlobStatus.OnlinePendingUpload) {\n\t\t\t\tthis.transitionToOffline(localId);\n\t\t\t}\n\t\t\tentry.status = PendingBlobStatus.OfflinePendingOp;\n\t\t}\n\t\treturn response;\n\t}\n\n\tprivate async onUploadReject(localId: string, error) {\n\t\tconst entry = this.pendingBlobs.get(localId);\n\t\tassert(!!entry, 0x387 /* Must have pending blob entry for blob which failed to upload */);\n\t\tif (!this.runtime.connected) {\n\t\t\tif (entry.status === PendingBlobStatus.OnlinePendingUpload) {\n\t\t\t\tthis.transitionToOffline(localId);\n\t\t\t}\n\t\t\t// we are probably not connected to storage but start another upload request in case we are\n\t\t\tentry.uploadP = this.retryThrottler\n\t\t\t\t.getDelay()\n\t\t\t\t.then(async () => this.uploadBlob(localId, entry.blob));\n\t\t\treturn entry.uploadP;\n\t\t} else {\n\t\t\tentry.handleP.reject(error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tprivate transitionToOffline(localId: string) {\n\t\tassert(\n\t\t\t!this.runtime.connected,\n\t\t\t0x388 /* Must only transition to offline flow while runtime is disconnected */,\n\t\t);\n\t\tconst entry = this.pendingBlobs.get(localId);\n\t\tassert(!!entry, 0x389 /* No pending blob entry */);\n\t\tassert(\n\t\t\t[PendingBlobStatus.OnlinePendingUpload, PendingBlobStatus.OnlinePendingOp].includes(\n\t\t\t\tentry.status,\n\t\t\t),\n\t\t\t0x38a /* Blob must be in online flow to transition to offline flow */,\n\t\t);\n\n\t\t/**\n\t\t * If we haven't already submitted a BlobAttach op for this entry, send it before returning the blob handle.\n\t\t * This will make sure that the BlobAttach op is sequenced prior to any ops referencing the handle. Otherwise,\n\t\t * an invalid handle could be added to the document.\n\t\t * storageId may be undefined but since we are not connected we will have a chance to add it when reSubmit()\n\t\t * is called on reconnection.\n\t\t */\n\t\tif (entry.status !== PendingBlobStatus.OnlinePendingOp) {\n\t\t\tthis.logTimeInfo(entry, \"sendBlobAttachTransitionOfflineTTL\");\n\t\t\tthis.sendBlobAttachOp(localId, entry.storageId);\n\t\t}\n\n\t\tentry.status =\n\t\t\tentry.status === PendingBlobStatus.OnlinePendingUpload\n\t\t\t\t? PendingBlobStatus.OfflinePendingUpload\n\t\t\t\t: PendingBlobStatus.OfflinePendingOp;\n\n\t\tentry.handleP.resolve(this.getBlobHandle(localId));\n\t}\n\n\t/**\n\t * Resubmit a BlobAttach op. Used to add storage IDs to ops that were\n\t * submitted to runtime while disconnected.\n\t * @param metadata - op metadata containing storage and/or local IDs\n\t */\n\tpublic reSubmit(metadata: Record<string, unknown> | undefined) {\n\t\tassert(!!metadata, 0x38b /* Resubmitted ops must have metadata */);\n\t\tconst { localId, blobId }: { localId?: string; blobId?: string } = metadata;\n\t\tassert(localId !== undefined, 0x50d /* local ID not available on reSubmit */);\n\t\tconst pendingEntry = this.pendingBlobs.get(localId);\n\t\tif (pendingEntry) {\n\t\t\tthis.logTimeInfo(pendingEntry, \"sendBlobAttachResubmitTTL\");\n\t\t}\n\t\tif (!blobId) {\n\t\t\t// We submitted this op while offline. The blob should have been uploaded by now.\n\t\t\tassert(\n\t\t\t\tpendingEntry?.status === PendingBlobStatus.OfflinePendingOp &&\n\t\t\t\t\t!!pendingEntry?.storageId,\n\t\t\t\t0x38d /* blob must be uploaded before resubmitting BlobAttach op */,\n\t\t\t);\n\t\t\treturn this.sendBlobAttachOp(localId, pendingEntry.storageId);\n\t\t}\n\t\treturn this.sendBlobAttachOp(localId, blobId);\n\t}\n\n\tprivate logTimeInfo(pendingEntry: PendingBlob, eventName: string) {\n\t\tlet timeLapseSinceLocalUpload: number = 0;\n\t\tlet timeLapseSinceServerUpload: number = 0;\n\t\tlet expiredUsingLocalTime;\n\t\tlet expiredUsingServerTime;\n\t\tif (pendingEntry.localUploadTime) {\n\t\t\ttimeLapseSinceLocalUpload = (Date.now() - pendingEntry.localUploadTime) / 1000;\n\t\t\texpiredUsingLocalTime =\n\t\t\t\t(pendingEntry.minTTLInSeconds ?? 0) - timeLapseSinceLocalUpload < 0 ? true : false;\n\t\t}\n\t\tif (pendingEntry.serverUploadTime) {\n\t\t\ttimeLapseSinceServerUpload = (Date.now() - pendingEntry.serverUploadTime) / 1000;\n\t\t\texpiredUsingServerTime =\n\t\t\t\t(pendingEntry.minTTLInSeconds ?? 0) - timeLapseSinceServerUpload < 0 ? true : false;\n\t\t}\n\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\teventName,\n\t\t\tentryStatus: pendingEntry.status,\n\t\t\ttimeLapseSinceLocalUpload,\n\t\t\ttimeLapseSinceServerUpload,\n\t\t\tminTTLInSeconds: pendingEntry.minTTLInSeconds,\n\t\t\texpiredUsingLocalTime,\n\t\t\texpiredUsingServerTime,\n\t\t});\n\t}\n\n\tpublic processBlobAttachOp(message: ISequencedDocumentMessage, local: boolean) {\n\t\tconst localId = message.metadata?.localId;\n\t\tconst blobId = message.metadata?.blobId;\n\t\tassert(blobId !== undefined, 0x12a /* \"Missing blob id on metadata\" */);\n\n\t\t// Set up a mapping from local ID to storage ID. This is crucial since without this the blob cannot be\n\t\t// requested from the server.\n\t\t// Note: The check for undefined is needed for back-compat when localId was not part of the BlobAttach op that\n\t\t// was sent when online.\n\t\tif (localId !== undefined) {\n\t\t\tthis.setRedirection(localId, blobId);\n\t\t}\n\t\t// set identity (id -> id) entry\n\t\tthis.setRedirection(blobId, blobId);\n\n\t\tif (local) {\n\t\t\tassert(localId !== undefined, 0x50e /* local ID not present in blob attach message */);\n\t\t\tconst waitingBlobs = this.opsInFlight.get(blobId);\n\t\t\tif (waitingBlobs !== undefined) {\n\t\t\t\t// For each op corresponding to this storage ID that we are waiting for, resolve the pending blob.\n\t\t\t\t// This is safe because the server will keep the blob alive and the op containing the local ID to\n\t\t\t\t// storage ID is already in flight and any op containing this local ID will be sequenced after that.\n\t\t\t\twaitingBlobs.forEach((pendingLocalId) => {\n\t\t\t\t\tconst pendingBlobEntry = this.pendingBlobs.get(pendingLocalId);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tpendingBlobEntry !== undefined,\n\t\t\t\t\t\t0x38f /* local online BlobAttach op with no pending blob entry */,\n\t\t\t\t\t);\n\n\t\t\t\t\t// It's possible we transitioned to offline flow while waiting for this op.\n\t\t\t\t\tif (pendingBlobEntry.status === PendingBlobStatus.OnlinePendingOp) {\n\t\t\t\t\t\tthis.setRedirection(pendingLocalId, blobId);\n\t\t\t\t\t\tpendingBlobEntry.handleP.resolve(this.getBlobHandle(pendingLocalId));\n\t\t\t\t\t\tthis.deleteAndEmitsIfEmpty(pendingLocalId);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis.opsInFlight.delete(blobId);\n\t\t\t}\n\t\t\t// For blobs that were transitioned to offline flow while waiting for this op, the entry should be deleted.\n\t\t\tthis.deleteAndEmitsIfEmpty(localId);\n\t\t}\n\t}\n\n\t/**\n\t * Reads blobs needed to load BlobManager from storage.\n\t * @param blobsTree - Tree containing IDs of previously attached blobs. We\n\t * look for the IDs in the blob entries of the tree since the both the r11s\n\t * and SPO drivers replace the attachment types returned in snapshot() with blobs.\n\t */\n\tpublic static async load(\n\t\tblobsTree: ISnapshotTree | undefined,\n\t\ttryFetchBlob: (id: string) => Promise<[string, string][]>,\n\t): Promise<IBlobManagerLoadInfo> {\n\t\tif (!blobsTree) {\n\t\t\treturn {};\n\t\t}\n\t\tlet redirectTable;\n\t\tconst tableId = blobsTree.blobs[this.redirectTableBlobName];\n\t\tif (tableId) {\n\t\t\tredirectTable = await tryFetchBlob(tableId);\n\t\t}\n\t\tconst ids = Object.entries(blobsTree.blobs)\n\t\t\t.filter(([k, _]) => k !== this.redirectTableBlobName)\n\t\t\t.map(([_, v]) => v);\n\t\treturn { ids, redirectTable };\n\t}\n\n\t/**\n\t * Load a set of previously attached blob IDs and redirect table from a previous snapshot.\n\t */\n\tprivate load(snapshot: IBlobManagerLoadInfo): Map<string, string | undefined> {\n\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\teventName: \"AttachmentBlobsLoaded\",\n\t\t\tcount: snapshot.ids?.length ?? 0,\n\t\t\tredirectTable: snapshot.redirectTable?.length,\n\t\t});\n\t\tconst table = new Map<string, string | undefined>(snapshot.redirectTable);\n\t\tif (snapshot.ids) {\n\t\t\tconst detached = this.runtime.attachState === AttachState.Detached;\n\t\t\t// If we are detached, we don't have storage IDs yet, so set to undefined\n\t\t\t// Otherwise, set identity (id -> id) entries\n\t\t\tsnapshot.ids.forEach((entry) => table.set(entry, detached ? undefined : entry));\n\t\t}\n\t\treturn table;\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. Each blob uploaded represents a node in the GC graph as it can be\n\t * individually referenced by storing its handle in a referenced DDS. Returns the list of blob ids as GC nodes.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data. BlobManager doesn't care\n\t * about this for now because the data is a simple list of blob ids.\n\t */\n\tpublic getGCData(fullGC: boolean = false): IGarbageCollectionData {\n\t\tconst gcData: IGarbageCollectionData = { gcNodes: {} };\n\t\tfor (const [localId, storageId] of this.redirectTable) {\n\t\t\tassert(!!storageId, 0x390 /* Must be attached to get GC data */);\n\t\t\tgcData.gcNodes[this.getBlobGCNodePath(localId)] = [this.getBlobGCNodePath(storageId)];\n\t\t}\n\t\treturn gcData;\n\t}\n\n\t/**\n\t * This is called to update blobs whose routes are unused. The unused blobs are deleted.\n\t * @param unusedRoutes - The routes of the blob nodes that are unused.\n\t */\n\tpublic updateUnusedRoutes(unusedRoutes: string[]): void {\n\t\t// The routes or blob node paths are in the same format as returned in getGCData -\n\t\t// `/<BlobManager.basePath>/<blobId>`.\n\t\tfor (const route of unusedRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\tassert(\n\t\t\t\tpathParts.length === 3 && pathParts[1] === BlobManager.basePath,\n\t\t\t\t0x2d5 /* \"Invalid blob node id in unused routes.\" */,\n\t\t\t);\n\t\t\tconst blobId = pathParts[2];\n\t\t\tthis.redirectTable.delete(blobId);\n\t\t}\n\t}\n\n\t/**\n\t * Delete attachment blobs that are sweep ready.\n\t * @param sweepReadyBlobRoutes - The routes of blobs that are sweep ready and should be deleted.\n\t * @returns - The routes of blobs that were deleted.\n\t */\n\tpublic deleteSweepReadyNodes(sweepReadyBlobRoutes: string[]): string[] {\n\t\t// If sweep for attachment blobs is not enabled, return empty list indicating nothing is deleted.\n\t\tif (this.mc.config.getBoolean(sweepAttachmentBlobsKey) !== true) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// The routes or blob node paths are in the same format as returned in getGCData -\n\t\t// `/<BlobManager.basePath>/<blobId>`.\n\t\tfor (const route of sweepReadyBlobRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\tassert(\n\t\t\t\tpathParts.length === 3 && pathParts[1] === BlobManager.basePath,\n\t\t\t\t0x586 /* Invalid blob node id in deleted routes. */,\n\t\t\t);\n\t\t\tconst blobId = pathParts[2];\n\t\t\tif (!this.redirectTable.has(blobId)) {\n\t\t\t\tthis.mc.logger.sendErrorEvent({\n\t\t\t\t\teventName: \"DeletedAttachmentBlobNotFound\",\n\t\t\t\t\tblobId,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.redirectTable.delete(blobId);\n\t\t}\n\t\treturn Array.from(sweepReadyBlobRoutes);\n\t}\n\n\t/**\n\t * This is called to update blobs whose routes are tombstones. Tombstoned blobs enable testing scenarios with\n\t * accessing deleted content without actually deleting content from summaries.\n\t * @param tombstonedRoutes - The routes of blob nodes that are tombstones.\n\t */\n\tpublic updateTombstonedRoutes(tombstonedRoutes: string[]) {\n\t\tconst tombstonedBlobsSet: Set<string> = new Set();\n\t\t// The routes or blob node paths are in the same format as returned in getGCData -\n\t\t// `/<BlobManager.basePath>/<blobId>`.\n\t\tfor (const route of tombstonedRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\tassert(\n\t\t\t\tpathParts.length === 3 && pathParts[1] === BlobManager.basePath,\n\t\t\t\t0x50f /* Invalid blob node id in tombstoned routes. */,\n\t\t\t);\n\t\t\ttombstonedBlobsSet.add(pathParts[2]);\n\t\t}\n\n\t\t// Remove blobs from the tombstone list that were tombstoned but aren't anymore as per the tombstoneRoutes.\n\t\tfor (const blobId of this.tombstonedBlobs) {\n\t\t\tif (!tombstonedBlobsSet.has(blobId)) {\n\t\t\t\tthis.tombstonedBlobs.delete(blobId);\n\t\t\t}\n\t\t}\n\n\t\t// Mark blobs that are now tombstoned by adding them to the tombstone list.\n\t\tfor (const blobId of tombstonedBlobsSet) {\n\t\t\tthis.tombstonedBlobs.add(blobId);\n\t\t}\n\t}\n\n\t/**\n\t * Verifies that the blob with given id is valid, i.e., it has not been garbage collected. If the blob is GC'd,\n\t * log an error and throw if necessary.\n\t */\n\tprivate verifyBlobValidity(blobId: string) {\n\t\t/**\n\t\t * A blob can be in one of the following states:\n\t\t * 1. \"deleted\" - It has been deleted by garbage collection sweep phase.\n\t\t * 2. \"tombstoned\" - It is ready for deletion but sweep phase isn't enabled and tombstone feature is enabled.\n\t\t * 3. \"valid\" - It has not been deleted or tombstoned.\n\t\t */\n\t\tlet state: \"valid\" | \"tombstoned\" | \"deleted\" = \"valid\";\n\t\tif (this.isBlobDeleted(this.getBlobGCNodePath(blobId))) {\n\t\t\tstate = \"deleted\";\n\t\t} else if (this.tombstonedBlobs.has(blobId)) {\n\t\t\tstate = \"tombstoned\";\n\t\t}\n\n\t\tif (state === \"valid\") {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the blob is deleted or throw on tombstone load is enabled, throw an error which will fail any attempt\n\t\t// to load the blob.\n\t\tconst shouldFail = state === \"deleted\" || this.throwOnTombstoneLoad;\n\t\tconst request = { url: blobId };\n\t\tconst error = responseToException(\n\t\t\tcreateResponseError(\n\t\t\t\t404,\n\t\t\t\t\"Blob was deleted\",\n\t\t\t\trequest,\n\t\t\t\tstate === \"tombstoned\" ? { [TombstoneResponseHeaderKey]: true } : undefined,\n\t\t\t),\n\t\t\trequest,\n\t\t);\n\t\tsendGCUnexpectedUsageEvent(\n\t\t\tthis.mc,\n\t\t\t{\n\t\t\t\teventName:\n\t\t\t\t\tstate === \"tombstoned\"\n\t\t\t\t\t\t? \"GC_Tombstone_Blob_Requested\"\n\t\t\t\t\t\t: \"GC_Deleted_Blob_Requested\",\n\t\t\t\tcategory: shouldFail ? \"error\" : \"generic\",\n\t\t\t\tgcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,\n\t\t\t},\n\t\t\t[BlobManager.basePath],\n\t\t\terror,\n\t\t);\n\t\tif (shouldFail) {\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic summarize(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\t// if storageIds is empty, it means we are detached and have only local IDs, or that there are no blobs attached\n\t\tconst blobIds =\n\t\t\tthis.storageIds.size > 0\n\t\t\t\t? Array.from(this.storageIds)\n\t\t\t\t: Array.from(this.redirectTable.keys());\n\t\tconst builder = new SummaryTreeBuilder();\n\t\tblobIds.forEach((blobId) => {\n\t\t\tbuilder.addAttachment(blobId);\n\t\t});\n\n\t\t// Any non-identity entries in the table need to be saved in the summary\n\t\tif (this.redirectTable.size > blobIds.length) {\n\t\t\tbuilder.addBlob(\n\t\t\t\tBlobManager.redirectTableBlobName,\n\t\t\t\t// filter out identity entries\n\t\t\t\tJSON.stringify(\n\t\t\t\t\tArray.from(this.redirectTable.entries()).filter(\n\t\t\t\t\t\t([localId, storageId]) => localId !== storageId,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn builder.getSummaryTree();\n\t}\n\n\tpublic setRedirectTable(table: Map<string, string>) {\n\t\tassert(\n\t\t\tthis.runtime.attachState === AttachState.Detached,\n\t\t\t0x252 /* \"redirect table can only be set in detached container\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.redirectTable.size === table.size,\n\t\t\t0x391 /* Redirect table size must match BlobManager's local ID count */,\n\t\t);\n\t\tfor (const [localId, storageId] of table) {\n\t\t\tassert(\n\t\t\t\tthis.redirectTable.has(localId),\n\t\t\t\t0x254 /* \"unrecognized id in redirect table\" */,\n\t\t\t);\n\t\t\tthis.setRedirection(localId, storageId);\n\t\t\t// set identity (id -> id) entry\n\t\t\tthis.setRedirection(storageId, storageId);\n\t\t}\n\t}\n\n\tpublic getPendingBlobs(): IPendingBlobs {\n\t\tconst blobs = {};\n\t\tfor (const [key, entry] of this.pendingBlobs) {\n\t\t\tblobs[key] = { blob: bufferToString(entry.blob, \"base64\") };\n\t\t}\n\t\treturn blobs;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectionTelemetry.d.ts","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,
|
|
1
|
+
{"version":3,"file":"connectionTelemetry.d.ts","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EACN,gBAAgB,EAChB,yBAAyB,EAEzB,MAAM,sCAAsC,CAAC;AAG9C;;GAEG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAgRrC,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,4BAA4B,EAAE,MAAM,GAAG,SAAS,CAAC;CACjD;AAED,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,YAAY,EAAE,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,EACxE,MAAM,EAAE,gBAAgB,QAGxB"}
|
|
@@ -59,8 +59,9 @@ class OpPerfTelemetry {
|
|
|
59
59
|
this.opProcessingTimes.outboundPushEventTime = Date.now();
|
|
60
60
|
(0, common_utils_1.assert)(this.opPerfData.durationOutboundBatching === undefined, 0x2ca /* "durationOutboundBatching should be undefined" */);
|
|
61
61
|
(0, common_utils_1.assert)(this.opProcessingTimes.submitOpEventTime !== undefined, 0x2cb /* "submitOpEventTime should be undefined" */);
|
|
62
|
-
this.opPerfData.durationOutboundBatching =
|
|
63
|
-
|
|
62
|
+
this.opPerfData.durationOutboundBatching =
|
|
63
|
+
this.opProcessingTimes.outboundPushEventTime -
|
|
64
|
+
this.opProcessingTimes.submitOpEventTime;
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
});
|
|
@@ -70,8 +71,9 @@ class OpPerfTelemetry {
|
|
|
70
71
|
this.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber &&
|
|
71
72
|
this.opProcessingTimes.outboundPushEventTime !== undefined) {
|
|
72
73
|
this.opProcessingTimes.inboundPushEventTime = Date.now();
|
|
73
|
-
this.opPerfData.durationNetwork =
|
|
74
|
-
|
|
74
|
+
this.opPerfData.durationNetwork =
|
|
75
|
+
this.opProcessingTimes.inboundPushEventTime -
|
|
76
|
+
this.opProcessingTimes.outboundPushEventTime;
|
|
75
77
|
this.opProcessingTimes.outboundPushEventTime = undefined;
|
|
76
78
|
this.opPerfData.lengthInboundQueue = this.deltaManager.inbound.length;
|
|
77
79
|
}
|
|
@@ -99,9 +101,9 @@ class OpPerfTelemetry {
|
|
|
99
101
|
duration: common_utils_1.performance.now() - this.connectionStartTime,
|
|
100
102
|
ops: this.gap,
|
|
101
103
|
// track time to connect only for first connection.
|
|
102
|
-
timeToConnect: this.firstConnection
|
|
103
|
-
telemetry_utils_1.TelemetryLogger.formatTick(this.connectionStartTime - this.bootTime)
|
|
104
|
-
undefined,
|
|
104
|
+
timeToConnect: this.firstConnection
|
|
105
|
+
? telemetry_utils_1.TelemetryLogger.formatTick(this.connectionStartTime - this.bootTime)
|
|
106
|
+
: undefined,
|
|
105
107
|
firstConnection: this.firstConnection,
|
|
106
108
|
});
|
|
107
109
|
}
|
|
@@ -152,8 +154,8 @@ class OpPerfTelemetry {
|
|
|
152
154
|
(0, common_utils_1.assert)(this.opProcessingTimes.submitOpEventTime !== undefined, 0x120 /* "Undefined latency statistics (op send time)" */);
|
|
153
155
|
const currentTime = Date.now();
|
|
154
156
|
if (this.opProcessingTimes.inboundPushEventTime !== undefined) {
|
|
155
|
-
this.opPerfData.durationInboundToProcessing =
|
|
156
|
-
- this.opProcessingTimes.inboundPushEventTime;
|
|
157
|
+
this.opPerfData.durationInboundToProcessing =
|
|
158
|
+
currentTime - this.opProcessingTimes.inboundPushEventTime;
|
|
157
159
|
}
|
|
158
160
|
const duration = currentTime - this.opProcessingTimes.submitOpEventTime;
|
|
159
161
|
// One of the core expectations for Fluid service is to be fast.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectionTelemetry.js","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,qEAA+E;AAE/E,+EAI8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,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;AACxD,CAAC;AALD,sDAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { ChildLogger, TelemetryLogger } from \"@fluidframework/telemetry-utils\";\nimport { IDeltaManager } from \"@fluidframework/container-definitions\";\nimport {\n IDocumentMessage,\n ISequencedDocumentMessage,\n MessageType,\n} from \"@fluidframework/protocol-definitions\";\nimport { assert, performance } from \"@fluidframework/common-utils\";\n\n/**\n * We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.\n */\nexport const latencyThreshold = 5000;\n\n// Phases in OpPerfTelemetry:\n// 1.\tOp is added to DeltaManager (DM) buffer.\n// 2.\tOp is sent to service (op leaves outbound queue).\n// \t - Note: We do not know for sure when op is sent, we only track when it is added to outbound queue.\n// If outbound queue is paused, time queue is paused is counted as network time.\n// 3.\tOp received from service back (pushed to inbound queue).\n// 4.\tOp is processed.\ninterface IOpPerfTelemetryProperties {\n /** Measure time between (1) and (2) - Measure time outbound op is sitting in queue due to active batch */\n durationOutboundBatching: number; // was durationOutboundQueue in previous versions\n /** Measure time between (2) and (3) - Track how long it took for op to be acked by service */\n durationNetwork: number; // was durationInboundQueue\n /** Measure time between (3) and (4) - Time between DM's inbound \"push\" event until DM's \"op\" event */\n durationInboundToProcessing: number;\n /** Length of the DeltaManager's inbound queue at the time of the DM's inbound \"push\" event (3) */\n lengthInboundQueue: number;\n}\n\n/**\n * Timings collected at various moments during the op processing.\n */\n interface IOpPerfTimings {\n /** Starting time for (1) */\n submitOpEventTime: number;\n /** Starting time for (2) */\n outboundPushEventTime: number;\n /** Starting time for (3) */\n inboundPushEventTime: number;\n}\n\nclass OpPerfTelemetry {\n private pongCount: number = 0;\n private pingLatency: number | undefined;\n\n // Collab window tracking. This is timestamp of %1000 message.\n private sequenceNumberForMsnTracking: number | undefined;\n private msnTrackingTimestamp: number = 0;\n // To track round trip time for every %500 client message.\n private clientSequenceNumberForLatencyStatistics: number | undefined;\n\n private opProcessingTimes: Partial<IOpPerfTimings> = {};\n\n // Performance Data to be reported for ops round trips and processing.\n private opPerfData: Partial<IOpPerfTelemetryProperties> = {};\n\n private firstConnection = true;\n private connectionOpSeqNumber: number | undefined;\n private readonly bootTime = performance.now();\n private connectionStartTime = 0;\n private gap = 0;\n\n private readonly logger: ITelemetryLogger;\n\n public constructor(\n private clientId: string | undefined,\n private readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n logger: ITelemetryLogger) {\n this.logger = ChildLogger.create(logger, \"OpPerf\");\n\n this.deltaManager.on(\"pong\", (latency) => this.recordPingTime(latency));\n this.deltaManager.on(\"submitOp\", (message) => this.beforeOpSubmit(message));\n\n this.deltaManager.on(\"op\", (message) => this.afterProcessingOp(message));\n\n this.deltaManager.on(\"connect\", (details, opsBehind) => {\n this.clientId = details.clientId;\n if (opsBehind !== undefined) {\n this.connectionOpSeqNumber = this.deltaManager.lastKnownSeqNumber;\n this.gap = opsBehind;\n this.connectionStartTime = performance.now();\n\n // We might be already up-today. If so, report it right away.\n if (this.gap <= 0) {\n this.reportGettingUpToDate();\n }\n }\n });\n this.deltaManager.on(\"disconnect\", () => {\n this.sequenceNumberForMsnTracking = undefined;\n this.clientSequenceNumberForLatencyStatistics = undefined;\n this.opProcessingTimes = {};\n this.opPerfData = {};\n this.connectionOpSeqNumber = undefined;\n this.firstConnection = false;\n this.pongCount = 0;\n });\n\n this.deltaManager.outbound.on(\"push\", (messages) => {\n for (const msg of messages) {\n if (msg.type === MessageType.Operation &&\n this.clientSequenceNumberForLatencyStatistics === msg.clientSequenceNumber) {\n assert(this.opProcessingTimes.outboundPushEventTime === undefined,\n 0x2c8 /* \"outboundPushEventTime should be undefined\" */);\n assert(this.opPerfData.durationNetwork === undefined,\n 0x2c9 /* \"durationNetwork should be undefined\" */);\n this.opProcessingTimes.outboundPushEventTime = Date.now();\n\n assert(this.opPerfData.durationOutboundBatching === undefined,\n 0x2ca /* \"durationOutboundBatching should be undefined\" */);\n\n assert(this.opProcessingTimes.submitOpEventTime !== undefined,\n 0x2cb /* \"submitOpEventTime should be undefined\" */);\n\n this.opPerfData.durationOutboundBatching = this.opProcessingTimes.outboundPushEventTime\n - this.opProcessingTimes.submitOpEventTime;\n }\n }\n });\n\n this.deltaManager.inbound.on(\"push\", (message: ISequencedDocumentMessage) => {\n if (this.clientId === message.clientId &&\n message.type === MessageType.Operation &&\n this.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber &&\n this.opProcessingTimes.outboundPushEventTime !== undefined) {\n this.opProcessingTimes.inboundPushEventTime = Date.now();\n this.opPerfData.durationNetwork = this.opProcessingTimes.inboundPushEventTime\n - this.opProcessingTimes.outboundPushEventTime;\n this.opProcessingTimes.outboundPushEventTime = undefined;\n this.opPerfData.lengthInboundQueue = this.deltaManager.inbound.length;\n }\n });\n\n this.deltaManager.inbound.on(\"idle\", (count: number, duration: number) => {\n // Do not want to log zero for sure.\n // We are more interested in aggregates, so logging only if we are processing some number of ops\n // Cut-off is arbitrary - can be increased or decreased based on amount of data collected and questions we\n // want to get answered\n // back-compat: Once 0.36 loader version saturates (count & duration args were added there),\n // we can remove typeof check.\n if (typeof count === \"number\" && count >= 100) {\n this.logger.sendPerformanceEvent({\n eventName: \"GetDeltas_OpProcessing\",\n count,\n duration,\n });\n }\n });\n }\n\n private reportGettingUpToDate() {\n this.connectionOpSeqNumber = undefined;\n this.logger.sendPerformanceEvent({\n eventName: \"ConnectionSpeed\",\n duration: performance.now() - this.connectionStartTime,\n ops: this.gap,\n // track time to connect only for first connection.\n timeToConnect: this.firstConnection ?\n TelemetryLogger.formatTick(this.connectionStartTime - this.bootTime) :\n undefined,\n firstConnection: this.firstConnection,\n });\n }\n\n private recordPingTime(latency: number) {\n this.pingLatency = latency;\n // logging one in every 1000 pongs, including the first time, if it is a \"write\" client.\n if (this.pongCount % 100 === 0 && this.deltaManager.active) {\n this.logger.sendPerformanceEvent({\n eventName: \"DeltaLatency\",\n duration: latency,\n });\n }\n this.pongCount++;\n }\n\n private beforeOpSubmit(message: IDocumentMessage) {\n // start with first client op and measure latency every 500 client ops\n if (this.clientSequenceNumberForLatencyStatistics === undefined &&\n message.clientSequenceNumber % 500 === 1) {\n assert(this.opProcessingTimes.outboundPushEventTime === undefined,\n 0x2cc /* \"OpTimeSittingInboundQueue should be undefined\" */);\n assert(this.opPerfData.durationNetwork === undefined,\n 0x2cd /* \"durationNetwork should be undefined\" */);\n this.opProcessingTimes.submitOpEventTime = Date.now();\n this.clientSequenceNumberForLatencyStatistics = message.clientSequenceNumber;\n }\n }\n\n private afterProcessingOp(message: ISequencedDocumentMessage) {\n const sequenceNumber = message.sequenceNumber;\n\n if (sequenceNumber === this.connectionOpSeqNumber) {\n this.reportGettingUpToDate();\n }\n\n // Record collab window max size after every 1000th op.\n if (this.sequenceNumberForMsnTracking === undefined && sequenceNumber % 1000 === 0) {\n this.sequenceNumberForMsnTracking = sequenceNumber;\n this.msnTrackingTimestamp = message.timestamp;\n }\n if (this.sequenceNumberForMsnTracking !== undefined &&\n message.minimumSequenceNumber >= this.sequenceNumberForMsnTracking) {\n assert(this.msnTrackingTimestamp !== undefined,\n 0x2ce /* \"msnTrackingTimestamp should not be undefined\" */);\n this.logger.sendPerformanceEvent({\n eventName: \"MsnStatistics\",\n sequenceNumber,\n msnDistance: sequenceNumber - this.sequenceNumberForMsnTracking,\n duration: message.timestamp - this.msnTrackingTimestamp,\n });\n this.sequenceNumberForMsnTracking = undefined;\n }\n\n if (this.clientId === message.clientId &&\n this.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber) {\n assert(this.opProcessingTimes.submitOpEventTime !== undefined,\n 0x120 /* \"Undefined latency statistics (op send time)\" */);\n const currentTime = Date.now();\n\n if (this.opProcessingTimes.inboundPushEventTime !== undefined) {\n this.opPerfData.durationInboundToProcessing = currentTime\n - this.opProcessingTimes.inboundPushEventTime;\n }\n\n const duration = currentTime - this.opProcessingTimes.submitOpEventTime;\n\n // One of the core expectations for Fluid service is to be fast.\n // When it's not the case, we want to learn about it and be able to investigate, so\n // raise awareness.\n // This also helps identify cases where it's due to client behavior (sending too many ops)\n // that results in overwhelming ordering service and thus starting to see long latencies.\n // The threshold could be adjusted, but ideally it stays workload-agnostic, as service\n // performance impacts all workloads relying on service.\n const category = duration > latencyThreshold ? \"error\" : \"performance\";\n\n this.logger.sendPerformanceEvent({\n eventName: \"OpRoundtripTime\",\n sequenceNumber,\n referenceSequenceNumber: message.referenceSequenceNumber,\n duration,\n category,\n pingLatency: this.pingLatency,\n msnDistance: this.deltaManager.lastSequenceNumber - this.deltaManager.minimumSequenceNumber,\n ...this.opPerfData,\n });\n this.clientSequenceNumberForLatencyStatistics = undefined;\n this.opPerfData = {};\n }\n }\n}\nexport interface IPerfSignalReport {\n /**\n * Identifier for the signal being submitted in order to\n * allow collection of data around the roundtrip of signal messages.\n */\n signalSequenceNumber: number;\n /**\n * Number of signals that were expected but not received.\n */\n signalsLost: number;\n\n /**\n * Timestamp before submitting the signal we will trace.\n */\n signalTimestamp: number;\n\n /**\n * Expected Signal Sequence to be received.\n */\n trackingSignalSequenceNumber: number | undefined;\n}\n\nexport function ReportOpPerfTelemetry(\n clientId: string | undefined,\n deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n logger: ITelemetryLogger) {\n new OpPerfTelemetry(clientId, deltaManager, logger);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"connectionTelemetry.js","sourceRoot":"","sources":["../src/connectionTelemetry.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,qEAA+E;AAE/E,+EAI8C;AAC9C,+DAAmE;AAEnE;;GAEG;AACU,QAAA,gBAAgB,GAAG,IAAI,CAAC;AAgCrC,MAAM,eAAe;IAuBpB,YACS,QAA4B,EACnB,YAAwE,EACzF,MAAwB;QAFhB,aAAQ,GAAR,QAAQ,CAAoB;QACnB,iBAAY,GA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,CAAC;YACF,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAE/B,IAAI,IAAI,CAAC,iBAAiB,CAAC,oBAAoB,KAAK,SAAS,EAAE;gBAC9D,IAAI,CAAC,UAAU,CAAC,2BAA2B;oBAC1C,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,oBAAoB,CAAC;aAC3D;YAED,MAAM,QAAQ,GAAG,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC;YAExE,gEAAgE;YAChE,mFAAmF;YACnF,mBAAmB;YACnB,0FAA0F;YAC1F,yFAAyF;YACzF,uFAAuF;YACvF,wDAAwD;YACxD,MAAM,QAAQ,GAAG,QAAQ,GAAG,wBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC;YAEvE,IAAI,CAAC,MAAM,CAAC,oBAAoB,iBAC/B,SAAS,EAAE,iBAAiB,EAC5B,cAAc,EACd,uBAAuB,EAAE,OAAO,CAAC,uBAAuB,EACxD,QAAQ;gBACR,QAAQ,EACR,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,WAAW,EACV,IAAI,CAAC,YAAY,CAAC,kBAAkB,GAAG,IAAI,CAAC,YAAY,CAAC,qBAAqB,IAC5E,IAAI,CAAC,UAAU,EACjB,CAAC;YACH,IAAI,CAAC,wCAAwC,GAAG,SAAS,CAAC;YAC1D,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;SACrB;IACF,CAAC;CACD;AAuBD,SAAgB,qBAAqB,CACpC,QAA4B,EAC5B,YAAwE,EACxE,MAAwB;IAExB,IAAI,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC;AAND,sDAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { ChildLogger, TelemetryLogger } from \"@fluidframework/telemetry-utils\";\nimport { IDeltaManager } from \"@fluidframework/container-definitions\";\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tMessageType,\n} from \"@fluidframework/protocol-definitions\";\nimport { assert, performance } from \"@fluidframework/common-utils\";\n\n/**\n * We report various latency-related errors when waiting for op roundtrip takes longer than that amout of time.\n */\nexport const latencyThreshold = 5000;\n\n// Phases in OpPerfTelemetry:\n// 1.\tOp is added to DeltaManager (DM) buffer.\n// 2.\tOp is sent to service (op leaves outbound queue).\n// \t - Note: We do not know for sure when op is sent, we only track when it is added to outbound queue.\n// If outbound queue is paused, time queue is paused is counted as network time.\n// 3.\tOp received from service back (pushed to inbound queue).\n// 4.\tOp is processed.\ninterface IOpPerfTelemetryProperties {\n\t/** Measure time between (1) and (2) - Measure time outbound op is sitting in queue due to active batch */\n\tdurationOutboundBatching: number; // was durationOutboundQueue in previous versions\n\t/** Measure time between (2) and (3) - Track how long it took for op to be acked by service */\n\tdurationNetwork: number; // was durationInboundQueue\n\t/** Measure time between (3) and (4) - Time between DM's inbound \"push\" event until DM's \"op\" event */\n\tdurationInboundToProcessing: number;\n\t/** Length of the DeltaManager's inbound queue at the time of the DM's inbound \"push\" event (3) */\n\tlengthInboundQueue: number;\n}\n\n/**\n * Timings collected at various moments during the op processing.\n */\ninterface IOpPerfTimings {\n\t/** Starting time for (1) */\n\tsubmitOpEventTime: number;\n\t/** Starting time for (2) */\n\toutboundPushEventTime: number;\n\t/** Starting time for (3) */\n\tinboundPushEventTime: number;\n}\n\nclass OpPerfTelemetry {\n\tprivate pongCount: number = 0;\n\tprivate pingLatency: number | undefined;\n\n\t// Collab window tracking. This is timestamp of %1000 message.\n\tprivate sequenceNumberForMsnTracking: number | undefined;\n\tprivate msnTrackingTimestamp: number = 0;\n\t// To track round trip time for every %500 client message.\n\tprivate clientSequenceNumberForLatencyStatistics: number | undefined;\n\n\tprivate opProcessingTimes: Partial<IOpPerfTimings> = {};\n\n\t// Performance Data to be reported for ops round trips and processing.\n\tprivate opPerfData: Partial<IOpPerfTelemetryProperties> = {};\n\n\tprivate firstConnection = true;\n\tprivate connectionOpSeqNumber: number | undefined;\n\tprivate readonly bootTime = performance.now();\n\tprivate connectionStartTime = 0;\n\tprivate gap = 0;\n\n\tprivate readonly logger: ITelemetryLogger;\n\n\tpublic constructor(\n\t\tprivate clientId: string | undefined,\n\t\tprivate readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t\tlogger: ITelemetryLogger,\n\t) {\n\t\tthis.logger = ChildLogger.create(logger, \"OpPerf\");\n\n\t\tthis.deltaManager.on(\"pong\", (latency) => this.recordPingTime(latency));\n\t\tthis.deltaManager.on(\"submitOp\", (message) => this.beforeOpSubmit(message));\n\n\t\tthis.deltaManager.on(\"op\", (message) => this.afterProcessingOp(message));\n\n\t\tthis.deltaManager.on(\"connect\", (details, opsBehind) => {\n\t\t\tthis.clientId = details.clientId;\n\t\t\tif (opsBehind !== undefined) {\n\t\t\t\tthis.connectionOpSeqNumber = this.deltaManager.lastKnownSeqNumber;\n\t\t\t\tthis.gap = opsBehind;\n\t\t\t\tthis.connectionStartTime = performance.now();\n\n\t\t\t\t// We might be already up-today. If so, report it right away.\n\t\t\t\tif (this.gap <= 0) {\n\t\t\t\t\tthis.reportGettingUpToDate();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.deltaManager.on(\"disconnect\", () => {\n\t\t\tthis.sequenceNumberForMsnTracking = undefined;\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = undefined;\n\t\t\tthis.opProcessingTimes = {};\n\t\t\tthis.opPerfData = {};\n\t\t\tthis.connectionOpSeqNumber = undefined;\n\t\t\tthis.firstConnection = false;\n\t\t\tthis.pongCount = 0;\n\t\t});\n\n\t\tthis.deltaManager.outbound.on(\"push\", (messages) => {\n\t\t\tfor (const msg of messages) {\n\t\t\t\tif (\n\t\t\t\t\tmsg.type === MessageType.Operation &&\n\t\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === msg.clientSequenceNumber\n\t\t\t\t) {\n\t\t\t\t\tassert(\n\t\t\t\t\t\tthis.opProcessingTimes.outboundPushEventTime === undefined,\n\t\t\t\t\t\t0x2c8 /* \"outboundPushEventTime should be undefined\" */,\n\t\t\t\t\t);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tthis.opPerfData.durationNetwork === undefined,\n\t\t\t\t\t\t0x2c9 /* \"durationNetwork should be undefined\" */,\n\t\t\t\t\t);\n\t\t\t\t\tthis.opProcessingTimes.outboundPushEventTime = Date.now();\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tthis.opPerfData.durationOutboundBatching === undefined,\n\t\t\t\t\t\t0x2ca /* \"durationOutboundBatching should be undefined\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tthis.opProcessingTimes.submitOpEventTime !== undefined,\n\t\t\t\t\t\t0x2cb /* \"submitOpEventTime should be undefined\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tthis.opPerfData.durationOutboundBatching =\n\t\t\t\t\t\tthis.opProcessingTimes.outboundPushEventTime -\n\t\t\t\t\t\tthis.opProcessingTimes.submitOpEventTime;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tthis.deltaManager.inbound.on(\"push\", (message: ISequencedDocumentMessage) => {\n\t\t\tif (\n\t\t\t\tthis.clientId === message.clientId &&\n\t\t\t\tmessage.type === MessageType.Operation &&\n\t\t\t\tthis.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber &&\n\t\t\t\tthis.opProcessingTimes.outboundPushEventTime !== undefined\n\t\t\t) {\n\t\t\t\tthis.opProcessingTimes.inboundPushEventTime = Date.now();\n\t\t\t\tthis.opPerfData.durationNetwork =\n\t\t\t\t\tthis.opProcessingTimes.inboundPushEventTime -\n\t\t\t\t\tthis.opProcessingTimes.outboundPushEventTime;\n\t\t\t\tthis.opProcessingTimes.outboundPushEventTime = undefined;\n\t\t\t\tthis.opPerfData.lengthInboundQueue = this.deltaManager.inbound.length;\n\t\t\t}\n\t\t});\n\n\t\tthis.deltaManager.inbound.on(\"idle\", (count: number, duration: number) => {\n\t\t\t// Do not want to log zero for sure.\n\t\t\t// We are more interested in aggregates, so logging only if we are processing some number of ops\n\t\t\t// Cut-off is arbitrary - can be increased or decreased based on amount of data collected and questions we\n\t\t\t// want to get answered\n\t\t\t// back-compat: Once 0.36 loader version saturates (count & duration args were added there),\n\t\t\t// we can remove typeof check.\n\t\t\tif (typeof count === \"number\" && count >= 100) {\n\t\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\t\teventName: \"GetDeltas_OpProcessing\",\n\t\t\t\t\tcount,\n\t\t\t\t\tduration,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate reportGettingUpToDate() {\n\t\tthis.connectionOpSeqNumber = undefined;\n\t\tthis.logger.sendPerformanceEvent({\n\t\t\teventName: \"ConnectionSpeed\",\n\t\t\tduration: performance.now() - this.connectionStartTime,\n\t\t\tops: this.gap,\n\t\t\t// track time to connect only for first connection.\n\t\t\ttimeToConnect: this.firstConnection\n\t\t\t\t? TelemetryLogger.formatTick(this.connectionStartTime - this.bootTime)\n\t\t\t\t: undefined,\n\t\t\tfirstConnection: this.firstConnection,\n\t\t});\n\t}\n\n\tprivate recordPingTime(latency: number) {\n\t\tthis.pingLatency = latency;\n\t\t// logging one in every 1000 pongs, including the first time, if it is a \"write\" client.\n\t\tif (this.pongCount % 100 === 0 && this.deltaManager.active) {\n\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\teventName: \"DeltaLatency\",\n\t\t\t\tduration: latency,\n\t\t\t});\n\t\t}\n\t\tthis.pongCount++;\n\t}\n\n\tprivate beforeOpSubmit(message: IDocumentMessage) {\n\t\t// start with first client op and measure latency every 500 client ops\n\t\tif (\n\t\t\tthis.clientSequenceNumberForLatencyStatistics === undefined &&\n\t\t\tmessage.clientSequenceNumber % 500 === 1\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.opProcessingTimes.outboundPushEventTime === undefined,\n\t\t\t\t0x2cc /* \"OpTimeSittingInboundQueue should be undefined\" */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tthis.opPerfData.durationNetwork === undefined,\n\t\t\t\t0x2cd /* \"durationNetwork should be undefined\" */,\n\t\t\t);\n\t\t\tthis.opProcessingTimes.submitOpEventTime = Date.now();\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = message.clientSequenceNumber;\n\t\t}\n\t}\n\n\tprivate afterProcessingOp(message: ISequencedDocumentMessage) {\n\t\tconst sequenceNumber = message.sequenceNumber;\n\n\t\tif (sequenceNumber === this.connectionOpSeqNumber) {\n\t\t\tthis.reportGettingUpToDate();\n\t\t}\n\n\t\t// Record collab window max size after every 1000th op.\n\t\tif (this.sequenceNumberForMsnTracking === undefined && sequenceNumber % 1000 === 0) {\n\t\t\tthis.sequenceNumberForMsnTracking = sequenceNumber;\n\t\t\tthis.msnTrackingTimestamp = message.timestamp;\n\t\t}\n\t\tif (\n\t\t\tthis.sequenceNumberForMsnTracking !== undefined &&\n\t\t\tmessage.minimumSequenceNumber >= this.sequenceNumberForMsnTracking\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.msnTrackingTimestamp !== undefined,\n\t\t\t\t0x2ce /* \"msnTrackingTimestamp should not be undefined\" */,\n\t\t\t);\n\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\teventName: \"MsnStatistics\",\n\t\t\t\tsequenceNumber,\n\t\t\t\tmsnDistance: sequenceNumber - this.sequenceNumberForMsnTracking,\n\t\t\t\tduration: message.timestamp - this.msnTrackingTimestamp,\n\t\t\t});\n\t\t\tthis.sequenceNumberForMsnTracking = undefined;\n\t\t}\n\n\t\tif (\n\t\t\tthis.clientId === message.clientId &&\n\t\t\tthis.clientSequenceNumberForLatencyStatistics === message.clientSequenceNumber\n\t\t) {\n\t\t\tassert(\n\t\t\t\tthis.opProcessingTimes.submitOpEventTime !== undefined,\n\t\t\t\t0x120 /* \"Undefined latency statistics (op send time)\" */,\n\t\t\t);\n\t\t\tconst currentTime = Date.now();\n\n\t\t\tif (this.opProcessingTimes.inboundPushEventTime !== undefined) {\n\t\t\t\tthis.opPerfData.durationInboundToProcessing =\n\t\t\t\t\tcurrentTime - this.opProcessingTimes.inboundPushEventTime;\n\t\t\t}\n\n\t\t\tconst duration = currentTime - this.opProcessingTimes.submitOpEventTime;\n\n\t\t\t// One of the core expectations for Fluid service is to be fast.\n\t\t\t// When it's not the case, we want to learn about it and be able to investigate, so\n\t\t\t// raise awareness.\n\t\t\t// This also helps identify cases where it's due to client behavior (sending too many ops)\n\t\t\t// that results in overwhelming ordering service and thus starting to see long latencies.\n\t\t\t// The threshold could be adjusted, but ideally it stays workload-agnostic, as service\n\t\t\t// performance impacts all workloads relying on service.\n\t\t\tconst category = duration > latencyThreshold ? \"error\" : \"performance\";\n\n\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\teventName: \"OpRoundtripTime\",\n\t\t\t\tsequenceNumber,\n\t\t\t\treferenceSequenceNumber: message.referenceSequenceNumber,\n\t\t\t\tduration,\n\t\t\t\tcategory,\n\t\t\t\tpingLatency: this.pingLatency,\n\t\t\t\tmsnDistance:\n\t\t\t\t\tthis.deltaManager.lastSequenceNumber - this.deltaManager.minimumSequenceNumber,\n\t\t\t\t...this.opPerfData,\n\t\t\t});\n\t\t\tthis.clientSequenceNumberForLatencyStatistics = undefined;\n\t\t\tthis.opPerfData = {};\n\t\t}\n\t}\n}\nexport interface IPerfSignalReport {\n\t/**\n\t * Identifier for the signal being submitted in order to\n\t * allow collection of data around the roundtrip of signal messages.\n\t */\n\tsignalSequenceNumber: number;\n\t/**\n\t * Number of signals that were expected but not received.\n\t */\n\tsignalsLost: number;\n\n\t/**\n\t * Timestamp before submitting the signal we will trace.\n\t */\n\tsignalTimestamp: number;\n\n\t/**\n\t * Expected Signal Sequence to be received.\n\t */\n\ttrackingSignalSequenceNumber: number | undefined;\n}\n\nexport function ReportOpPerfTelemetry(\n\tclientId: string | undefined,\n\tdeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\tlogger: ITelemetryLogger,\n) {\n\tnew OpPerfTelemetry(clientId, deltaManager, logger);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerHandleContext.d.ts","sourceRoot":"","sources":["../src/containerHandleContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"containerHandleContext.d.ts","sourceRoot":"","sources":["../src/containerHandleContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAG3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,qBAAa,2BAA4B,YAAW,mBAAmB;aAarD,IAAI,EAAE,MAAM;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO;aACR,YAAY,CAAC;IAd9B,IAAW,mBAAmB,SAE7B;IACD,SAAgB,YAAY,EAAE,MAAM,CAAC;IAErC;;;;;OAKG;gBAEc,IAAI,EAAE,MAAM,EACX,OAAO,EAAE,gBAAgB,EAC1B,YAAY,CAAC,iCAAqB;IAK5C,WAAW,IAAI,IAAI;IAI1B,IAAW,UAAU,YAEpB;IAEY,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;CAGjE"}
|
|
@@ -20,7 +20,9 @@ class ContainerFluidHandleContext {
|
|
|
20
20
|
this.routeContext = routeContext;
|
|
21
21
|
this.absolutePath = (0, runtime_utils_1.generateHandleContextPath)(path, this.routeContext);
|
|
22
22
|
}
|
|
23
|
-
get IFluidHandleContext() {
|
|
23
|
+
get IFluidHandleContext() {
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
24
26
|
attachGraph() {
|
|
25
27
|
throw new Error("can't attach container runtime form within container!");
|
|
26
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerHandleContext.js","sourceRoot":"","sources":["../src/containerHandleContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"containerHandleContext.js","sourceRoot":"","sources":["../src/containerHandleContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,iFAAoE;AACpE,iEAA0E;AAG1E,MAAa,2BAA2B;IAMvC;;;;;OAKG;IACH,YACiB,IAAY,EACX,OAAyB,EAC1B,YAAkC;QAFlC,SAAI,GAAJ,IAAI,CAAQ;QACX,YAAO,GAAP,OAAO,CAAkB;QAC1B,iBAAY,GAAZ,YAAY,CAAsB;QAElD,IAAI,CAAC,YAAY,GAAG,IAAA,yCAAyB,EAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACxE,CAAC;IAjBD,IAAW,mBAAmB;QAC7B,OAAO,IAAI,CAAC;IACb,CAAC;IAiBM,WAAW;QACjB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC1E,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,KAAK,mCAAW,CAAC,QAAQ,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,OAAiB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;CACD;AA/BD,kEA+BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandleContext, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { generateHandleContextPath } from \"@fluidframework/runtime-utils\";\nimport { ContainerRuntime } from \"./containerRuntime\";\n\nexport class ContainerFluidHandleContext implements IFluidHandleContext {\n\tpublic get IFluidHandleContext() {\n\t\treturn this;\n\t}\n\tpublic readonly absolutePath: string;\n\n\t/**\n\t * Creates a new ContainerFluidHandleContext.\n\t * @param path - The path to this handle relative to the routeContext.\n\t * @param runtime - The IRuntime object this context represents.\n\t * @param routeContext - The parent IFluidHandleContext that has a route to this handle.\n\t */\n\tconstructor(\n\t\tpublic readonly path: string,\n\t\tprivate readonly runtime: ContainerRuntime,\n\t\tpublic readonly routeContext?: IFluidHandleContext,\n\t) {\n\t\tthis.absolutePath = generateHandleContextPath(path, this.routeContext);\n\t}\n\n\tpublic attachGraph(): void {\n\t\tthrow new Error(\"can't attach container runtime form within container!\");\n\t}\n\n\tpublic get isAttached() {\n\t\treturn this.runtime.attachState !== AttachState.Detached;\n\t}\n\n\tpublic async resolveHandle(request: IRequest): Promise<IResponse> {\n\t\treturn this.runtime.resolveHandle(request);\n\t}\n}\n"]}
|
|
@@ -11,10 +11,8 @@ import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
|
11
11
|
import { IClientDetails, IDocumentMessage, IQuorumClients, ISequencedDocumentMessage, ISignalMessage, ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
12
12
|
import { FlushMode, IFluidDataStoreContextDetached, IFluidDataStoreRegistry, IGarbageCollectionData, NamedFluidDataStoreRegistryEntries, ISummaryTreeWithStats, IDataStore, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
13
13
|
import { IBlobManagerLoadInfo } from "./blobManager";
|
|
14
|
-
import { IContainerRuntimeMetadata } from "./
|
|
15
|
-
import {
|
|
16
|
-
import { SubmitSummaryResult, ISubmitSummaryOptions, ISummarizer, ISummarizerInternalsProvider, ISummarizerRuntime, IRefreshSummaryAckOptions } from "./summarizerTypes";
|
|
17
|
-
import { GCNodeType, IGarbageCollectionRuntime, IGCStats } from "./garbageCollection";
|
|
14
|
+
import { IContainerRuntimeMetadata, ISerializedElection, SubmitSummaryResult, ISubmitSummaryOptions, ISummarizer, ISummarizerInternalsProvider, ISummarizerRuntime, IRefreshSummaryAckOptions } from "./summary";
|
|
15
|
+
import { GCNodeType, IGarbageCollectionRuntime, IGCStats } from "./gc";
|
|
18
16
|
export declare enum ContainerMessageType {
|
|
19
17
|
FluidDataStoreOp = "component",
|
|
20
18
|
Attach = "attach",
|
|
@@ -253,11 +251,6 @@ export interface IRootSummaryTreeWithStats extends ISummaryTreeWithStats {
|
|
|
253
251
|
export declare enum RuntimeHeaders {
|
|
254
252
|
/** True to wait for a data store to be created and loaded before returning it. */
|
|
255
253
|
wait = "wait",
|
|
256
|
-
/**
|
|
257
|
-
* True if the request is from an external app. Used for GC to handle scenarios where a data store
|
|
258
|
-
* is deleted and requested via an external app.
|
|
259
|
-
*/
|
|
260
|
-
externalRequest = "externalRequest",
|
|
261
254
|
/** True if the request is coming from an IFluidHandle. */
|
|
262
255
|
viaHandle = "viaHandle"
|
|
263
256
|
}
|
|
@@ -270,7 +263,6 @@ export declare const TombstoneResponseHeaderKey = "isTombstoned";
|
|
|
270
263
|
*/
|
|
271
264
|
export interface RuntimeHeaderData {
|
|
272
265
|
wait?: boolean;
|
|
273
|
-
externalRequest?: boolean;
|
|
274
266
|
viaHandle?: boolean;
|
|
275
267
|
allowTombstone?: boolean;
|
|
276
268
|
}
|
|
@@ -387,7 +379,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
387
379
|
private readonly defaultMaxConsecutiveReconnects;
|
|
388
380
|
private _orderSequentiallyCalls;
|
|
389
381
|
private readonly _flushMode;
|
|
390
|
-
private
|
|
382
|
+
private flushTaskExists;
|
|
391
383
|
private _connected;
|
|
392
384
|
private readonly savedOps;
|
|
393
385
|
private baseSnapshotBlobs?;
|
|
@@ -422,6 +414,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
422
414
|
private dirtyContainer;
|
|
423
415
|
private emitDirtyDocumentEvent;
|
|
424
416
|
private readonly enableOpReentryCheck;
|
|
417
|
+
private readonly disableAttachReorder;
|
|
425
418
|
private readonly defaultTelemetrySignalSampleCount;
|
|
426
419
|
private _perfSignalData;
|
|
427
420
|
/**
|
|
@@ -454,6 +447,10 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
454
447
|
* a summary is generated.
|
|
455
448
|
*/
|
|
456
449
|
private nextSummaryNumber;
|
|
450
|
+
/**
|
|
451
|
+
* If false, loading or using a Tombstoned object should merely log, not fail
|
|
452
|
+
*/
|
|
453
|
+
readonly gcTombstoneEnforcementAllowed: boolean;
|
|
457
454
|
/**
|
|
458
455
|
* @internal
|
|
459
456
|
*/
|
|
@@ -463,6 +460,9 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
463
460
|
*/
|
|
464
461
|
private initializeBaseState;
|
|
465
462
|
dispose(error?: Error): void;
|
|
463
|
+
/**
|
|
464
|
+
* @deprecated 2.0.0-internal.3.2.0 ContainerRuntime is not an IFluidTokenProvider. Token providers should be accessed using normal provider patterns.
|
|
465
|
+
*/
|
|
466
466
|
get IFluidTokenProvider(): IFluidTokenProvider | undefined;
|
|
467
467
|
/**
|
|
468
468
|
* Notifies this object about the request made to the container.
|
|
@@ -581,6 +581,16 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
581
581
|
* @param unusedRoutes - Data store and attachment blob routes that are unused in this Container.
|
|
582
582
|
*/
|
|
583
583
|
updateUnusedRoutes(unusedRoutes: string[]): void;
|
|
584
|
+
/**
|
|
585
|
+
* @deprecated - Replaced by deleteSweepReadyNodes.
|
|
586
|
+
*/
|
|
587
|
+
deleteUnusedNodes(unusedRoutes: string[]): string[];
|
|
588
|
+
/**
|
|
589
|
+
* After GC has run and identified nodes that are sweep ready, this is called to delete the sweep ready nodes.
|
|
590
|
+
* @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.
|
|
591
|
+
* @returns - The routes of nodes that were deleted.
|
|
592
|
+
*/
|
|
593
|
+
deleteSweepReadyNodes(sweepReadyRoutes: string[]): string[];
|
|
584
594
|
/**
|
|
585
595
|
* This is called to update objects that are tombstones.
|
|
586
596
|
* @param tombstonedRoutes - Data store and attachment blob routes that are tombstones in this Container.
|
|
@@ -645,6 +655,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
645
655
|
submitDataStoreAliasOp(contents: any, localOpMetadata: unknown): void;
|
|
646
656
|
uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;
|
|
647
657
|
private submit;
|
|
658
|
+
private scheduleFlush;
|
|
648
659
|
private submitSummaryMessage;
|
|
649
660
|
/**
|
|
650
661
|
* Throw an error if the runtime is closed. Methods that are expected to potentially
|
|
@@ -671,6 +682,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
671
682
|
*/
|
|
672
683
|
private refreshLatestSummaryAckFromServer;
|
|
673
684
|
private fetchLatestSnapshotFromStorage;
|
|
685
|
+
private fetchSnapshotFromStorage;
|
|
674
686
|
notifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;
|
|
675
687
|
private initializeBaseSnapshotBlobs;
|
|
676
688
|
getPendingLocalState(): unknown;
|