@fluidframework/container-runtime 2.0.0-internal.3.1.0 → 2.0.0-internal.3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blobManager.d.ts +6 -0
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +31 -6
- package/dist/blobManager.js.map +1 -1
- package/dist/containerRuntime.d.ts +17 -15
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +158 -121
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +21 -12
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +76 -50
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +9 -10
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +42 -49
- package/dist/dataStores.js.map +1 -1
- package/dist/{garbageCollection.d.ts → gc/garbageCollection.d.ts} +5 -200
- package/dist/gc/garbageCollection.d.ts.map +1 -0
- package/dist/{garbageCollection.js → gc/garbageCollection.js} +77 -353
- 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} +24 -2
- package/dist/gc/gcDefinitions.js.map +1 -0
- package/{lib/garbageCollectionHelpers.d.ts → dist/gc/gcHelpers.d.ts} +5 -1
- package/dist/gc/gcHelpers.d.ts.map +1 -0
- package/dist/{garbageCollectionHelpers.js → gc/gcHelpers.js} +27 -7
- 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/dist/gc/gcSweepReadyUsageDetection.d.ts.map +1 -0
- package/dist/{gcSweepReadyUsageDetection.js → gc/gcSweepReadyUsageDetection.js} +2 -2
- 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 +7 -36
- 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/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +1 -0
- package/dist/opLifecycle/opCompressor.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 +20 -12
- 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 +59 -28
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts +1 -2
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +14 -9
- package/dist/pendingStateManager.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/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} +158 -56
- package/dist/summary/runningSummarizer.js.map +1 -0
- package/dist/{summarizer.d.ts → summary/summarizer.d.ts} +2 -4
- package/dist/summary/summarizer.d.ts.map +1 -0
- package/dist/{summarizer.js → summary/summarizer.js} +1 -61
- 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/dist/{summarizerHeuristics.d.ts → summary/summarizerHeuristics.d.ts} +1 -1
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -0
- package/dist/summary/summarizerHeuristics.js.map +1 -0
- package/{lib → dist/summary}/summarizerTypes.d.ts +1 -1
- 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/summary/summaryCollection.js.map +1 -0
- package/{lib → dist/summary}/summaryFormat.d.ts +1 -43
- package/dist/summary/summaryFormat.d.ts.map +1 -0
- package/dist/{summaryFormat.js → summary/summaryFormat.js} +1 -10
- package/dist/summary/summaryFormat.js.map +1 -0
- package/dist/summary/summaryGenerator.d.ts.map +1 -0
- package/dist/{summaryGenerator.js → summary/summaryGenerator.js} +1 -2
- 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/summary/summaryManager.js.map +1 -0
- package/lib/blobManager.d.ts +6 -0
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +28 -3
- package/lib/blobManager.js.map +1 -1
- package/lib/containerRuntime.d.ts +17 -15
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +127 -90
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +21 -12
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +64 -38
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts +9 -10
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +33 -40
- package/lib/dataStores.js.map +1 -1
- package/lib/{garbageCollection.d.ts → gc/garbageCollection.d.ts} +5 -200
- package/lib/gc/garbageCollection.d.ts.map +1 -0
- package/lib/{garbageCollection.js → gc/garbageCollection.js} +44 -319
- 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} +23 -1
- package/lib/gc/gcDefinitions.js.map +1 -0
- package/{dist/garbageCollectionHelpers.d.ts → lib/gc/gcHelpers.d.ts} +5 -1
- package/lib/gc/gcHelpers.d.ts.map +1 -0
- package/lib/{garbageCollectionHelpers.js → gc/gcHelpers.js} +20 -2
- 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/lib/gc/gcSweepReadyUsageDetection.d.ts.map +1 -0
- package/lib/{gcSweepReadyUsageDetection.js → gc/gcSweepReadyUsageDetection.js} +1 -1
- 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 +7 -36
- 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/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +1 -0
- package/lib/opLifecycle/opCompressor.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 +20 -12
- 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 +60 -29
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts +1 -2
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +14 -9
- package/lib/pendingStateManager.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/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} +159 -57
- package/lib/summary/runningSummarizer.js.map +1 -0
- package/lib/{summarizer.d.ts → summary/summarizer.d.ts} +2 -4
- package/lib/summary/summarizer.d.ts.map +1 -0
- package/lib/{summarizer.js → summary/summarizer.js} +3 -63
- 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/lib/{summarizerHeuristics.d.ts → summary/summarizerHeuristics.d.ts} +1 -1
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -0
- package/lib/summary/summarizerHeuristics.js.map +1 -0
- package/{dist → lib/summary}/summarizerTypes.d.ts +1 -1
- 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/summary/summaryCollection.js.map +1 -0
- package/{dist → lib/summary}/summaryFormat.d.ts +1 -43
- package/lib/summary/summaryFormat.d.ts.map +1 -0
- package/lib/{summaryFormat.js → summary/summaryFormat.js} +0 -8
- package/lib/summary/summaryFormat.js.map +1 -0
- package/lib/summary/summaryGenerator.d.ts.map +1 -0
- package/lib/{summaryGenerator.js → summary/summaryGenerator.js} +1 -2
- 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/summary/summaryManager.js.map +1 -0
- package/package.json +125 -122
- package/src/blobManager.ts +33 -3
- package/src/containerRuntime.ts +178 -106
- package/src/dataStoreContext.ts +90 -49
- package/src/dataStores.ts +44 -51
- package/{garbageCollection.md → src/gc/garbageCollection.md} +2 -2
- package/src/{garbageCollection.ts → gc/garbageCollection.ts} +90 -560
- package/src/gc/gcDefinitions.ts +244 -0
- package/src/{garbageCollectionHelpers.ts → gc/gcHelpers.ts} +26 -1
- package/src/gc/gcSummaryStateTracker.ts +339 -0
- package/src/{gcSweepReadyUsageDetection.ts → gc/gcSweepReadyUsageDetection.ts} +1 -1
- package/src/gc/gcUnreferencedStateTracker.ts +114 -0
- package/src/gc/index.ts +40 -0
- package/src/index.ts +10 -14
- package/src/opLifecycle/batchManager.ts +7 -54
- package/src/opLifecycle/definitions.ts +4 -0
- package/src/opLifecycle/opCompressor.ts +1 -0
- package/src/opLifecycle/opSplitter.ts +33 -14
- package/src/opLifecycle/outbox.ts +84 -38
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +26 -14
- package/src/summary/index.ts +99 -0
- package/src/{runningSummarizer.ts → summary/runningSummarizer.ts} +279 -139
- package/src/{summarizer.ts → summary/summarizer.ts} +5 -76
- package/src/{summarizerHeuristics.ts → summary/summarizerHeuristics.ts} +1 -1
- package/src/{summarizerTypes.ts → summary/summarizerTypes.ts} +1 -1
- package/src/{summaryFormat.ts → summary/summaryFormat.ts} +1 -53
- package/src/{summaryGenerator.ts → summary/summaryGenerator.ts} +9 -9
- package/src/{summaryManager.ts → summary/summaryManager.ts} +1 -1
- package/dist/garbageCollection.d.ts.map +0 -1
- package/dist/garbageCollection.js.map +0 -1
- package/dist/garbageCollectionConstants.d.ts +0 -26
- package/dist/garbageCollectionConstants.d.ts.map +0 -1
- package/dist/garbageCollectionConstants.js.map +0 -1
- package/dist/garbageCollectionHelpers.d.ts.map +0 -1
- package/dist/garbageCollectionHelpers.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 -26
- package/lib/garbageCollectionConstants.d.ts.map +0 -1
- package/lib/garbageCollectionConstants.js.map +0 -1
- package/lib/garbageCollectionHelpers.d.ts.map +0 -1
- package/lib/garbageCollectionHelpers.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/garbageCollectionConstants.ts +0 -44
- /package/dist/{gcSweepReadyUsageDetection.d.ts → gc/gcSweepReadyUsageDetection.d.ts} +0 -0
- /package/dist/{orderedClientElection.d.ts → summary/orderedClientElection.d.ts} +0 -0
- /package/dist/{orderedClientElection.js → summary/orderedClientElection.js} +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/{summarizerHeuristics.js → summary/summarizerHeuristics.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/{summaryCollection.js → summary/summaryCollection.js} +0 -0
- /package/dist/{summaryGenerator.d.ts → summary/summaryGenerator.d.ts} +0 -0
- /package/dist/{summaryManager.js → summary/summaryManager.js} +0 -0
- /package/lib/{gcSweepReadyUsageDetection.d.ts → gc/gcSweepReadyUsageDetection.d.ts} +0 -0
- /package/lib/{orderedClientElection.d.ts → summary/orderedClientElection.d.ts} +0 -0
- /package/lib/{orderedClientElection.js → summary/orderedClientElection.js} +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/{summarizerHeuristics.js → summary/summarizerHeuristics.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/{summaryCollection.js → summary/summaryCollection.js} +0 -0
- /package/lib/{summaryGenerator.d.ts → summary/summaryGenerator.d.ts} +0 -0
- /package/lib/{summaryManager.js → summary/summaryManager.js} +0 -0
- /package/src/{orderedClientElection.ts → summary/orderedClientElection.ts} +0 -0
- /package/src/{runWhileConnectedCoordinator.ts → summary/runWhileConnectedCoordinator.ts} +0 -0
- /package/src/{summarizerClientElection.ts → summary/summarizerClientElection.ts} +0 -0
- /package/src/{summarizerHandle.ts → summary/summarizerHandle.ts} +0 -0
- /package/src/{summaryCollection.ts → summary/summaryCollection.ts} +0 -0
package/dist/containerRuntime.js
CHANGED
|
@@ -14,27 +14,19 @@ const garbage_collector_1 = require("@fluidframework/garbage-collector");
|
|
|
14
14
|
const uuid_1 = require("uuid");
|
|
15
15
|
const containerHandleContext_1 = require("./containerHandleContext");
|
|
16
16
|
const dataStoreRegistry_1 = require("./dataStoreRegistry");
|
|
17
|
-
const summarizer_1 = require("./summarizer");
|
|
18
|
-
const summaryManager_1 = require("./summaryManager");
|
|
19
17
|
const connectionTelemetry_1 = require("./connectionTelemetry");
|
|
20
18
|
const pendingStateManager_1 = require("./pendingStateManager");
|
|
21
19
|
const packageVersion_1 = require("./packageVersion");
|
|
22
20
|
const blobManager_1 = require("./blobManager");
|
|
23
21
|
const dataStores_1 = require("./dataStores");
|
|
24
|
-
const
|
|
25
|
-
const summaryCollection_1 = require("./summaryCollection");
|
|
26
|
-
const orderedClientElection_1 = require("./orderedClientElection");
|
|
27
|
-
const summarizerClientElection_1 = require("./summarizerClientElection");
|
|
22
|
+
const summary_1 = require("./summary");
|
|
28
23
|
const throttler_1 = require("./throttler");
|
|
29
|
-
const
|
|
30
|
-
const garbageCollection_1 = require("./garbageCollection");
|
|
24
|
+
const gc_1 = require("./gc");
|
|
31
25
|
const dataStore_1 = require("./dataStore");
|
|
32
26
|
const batchTracker_1 = require("./batchTracker");
|
|
33
27
|
const serializedSnapshotStorage_1 = require("./serializedSnapshotStorage");
|
|
34
28
|
const scheduleManager_1 = require("./scheduleManager");
|
|
35
29
|
const opLifecycle_1 = require("./opLifecycle");
|
|
36
|
-
const garbageCollectionHelpers_1 = require("./garbageCollectionHelpers");
|
|
37
|
-
const garbageCollectionConstants_1 = require("./garbageCollectionConstants");
|
|
38
30
|
var ContainerMessageType;
|
|
39
31
|
(function (ContainerMessageType) {
|
|
40
32
|
// An op to be delivered to store
|
|
@@ -71,11 +63,6 @@ var RuntimeHeaders;
|
|
|
71
63
|
(function (RuntimeHeaders) {
|
|
72
64
|
/** True to wait for a data store to be created and loaded before returning it. */
|
|
73
65
|
RuntimeHeaders["wait"] = "wait";
|
|
74
|
-
/**
|
|
75
|
-
* True if the request is from an external app. Used for GC to handle scenarios where a data store
|
|
76
|
-
* is deleted and requested via an external app.
|
|
77
|
-
*/
|
|
78
|
-
RuntimeHeaders["externalRequest"] = "externalRequest";
|
|
79
66
|
/** True if the request is coming from an IFluidHandle. */
|
|
80
67
|
RuntimeHeaders["viaHandle"] = "viaHandle";
|
|
81
68
|
})(RuntimeHeaders = exports.RuntimeHeaders || (exports.RuntimeHeaders = {}));
|
|
@@ -86,7 +73,6 @@ exports.TombstoneResponseHeaderKey = "isTombstoned";
|
|
|
86
73
|
/** Default values for Runtime Headers */
|
|
87
74
|
exports.defaultRuntimeHeaderData = {
|
|
88
75
|
wait: true,
|
|
89
|
-
externalRequest: false,
|
|
90
76
|
viaHandle: false,
|
|
91
77
|
allowTombstone: false,
|
|
92
78
|
};
|
|
@@ -153,7 +139,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
153
139
|
* @internal
|
|
154
140
|
*/
|
|
155
141
|
constructor(context, registry, metadata, electedSummarizerData, chunks, dataStoreAliasMap, runtimeOptions, containerScope, logger, existing, blobManagerSnapshot, _storage, requestHandler, summaryConfiguration) {
|
|
156
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
142
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
157
143
|
if (summaryConfiguration === void 0) { summaryConfiguration = Object.assign(Object.assign({}, exports.DefaultSummaryConfiguration), (_a = runtimeOptions.summaryOptions) === null || _a === void 0 ? void 0 : _a.summaryConfigOverrides); }
|
|
158
144
|
super();
|
|
159
145
|
this.context = context;
|
|
@@ -166,7 +152,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
166
152
|
this.summaryConfiguration = summaryConfiguration;
|
|
167
153
|
this.defaultMaxConsecutiveReconnects = 7;
|
|
168
154
|
this._orderSequentiallyCalls = 0;
|
|
169
|
-
this.
|
|
155
|
+
this.flushTaskExists = false;
|
|
170
156
|
this.savedOps = [];
|
|
171
157
|
this.consecutiveReconnects = 0;
|
|
172
158
|
this.ensureNoDataModelChangesCalls = 0;
|
|
@@ -187,7 +173,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
187
173
|
trackingSignalSequenceNumber: undefined,
|
|
188
174
|
};
|
|
189
175
|
this.summarizeOnDemand = (...args) => {
|
|
190
|
-
if (this.clientDetails.type ===
|
|
176
|
+
if (this.clientDetails.type === summary_1.summarizerClientType) {
|
|
191
177
|
return this.summarizer.summarizeOnDemand(...args);
|
|
192
178
|
}
|
|
193
179
|
else if (this.summaryManager !== undefined) {
|
|
@@ -201,7 +187,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
201
187
|
}
|
|
202
188
|
};
|
|
203
189
|
this.enqueueSummarize = (...args) => {
|
|
204
|
-
if (this.clientDetails.type ===
|
|
190
|
+
if (this.clientDetails.type === summary_1.summarizerClientType) {
|
|
205
191
|
return this.summarizer.enqueueSummarize(...args);
|
|
206
192
|
}
|
|
207
193
|
else if (this.summaryManager !== undefined) {
|
|
@@ -236,37 +222,46 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
236
222
|
this.nextSummaryNumber = loadSummaryNumber + 1;
|
|
237
223
|
this.messageAtLastSummary = metadata === null || metadata === void 0 ? void 0 : metadata.message;
|
|
238
224
|
this._connected = this.context.connected;
|
|
239
|
-
this.gcTombstoneEnforcementAllowed = (0,
|
|
225
|
+
this.gcTombstoneEnforcementAllowed = (0, gc_1.shouldAllowGcTombstoneEnforcement)((_c = metadata === null || metadata === void 0 ? void 0 : metadata.gcFeatureMatrix) === null || _c === void 0 ? void 0 : _c.tombstoneGeneration /* persisted */, this.runtimeOptions.gcOptions[gc_1.gcTombstoneGenerationOptionName] /* current */);
|
|
240
226
|
this.mc = (0, telemetry_utils_1.loggerToMonitoringContext)(telemetry_utils_1.ChildLogger.create(this.logger, "ContainerRuntime"));
|
|
241
227
|
this.mc.logger.sendTelemetryEvent({
|
|
242
228
|
eventName: "GCFeatureMatrix",
|
|
243
229
|
metadataValue: JSON.stringify(metadata === null || metadata === void 0 ? void 0 : metadata.gcFeatureMatrix),
|
|
244
230
|
inputs: JSON.stringify({
|
|
245
|
-
gcOptions_gcTombstoneGeneration: this.runtimeOptions.gcOptions[
|
|
231
|
+
gcOptions_gcTombstoneGeneration: this.runtimeOptions.gcOptions[gc_1.gcTombstoneGenerationOptionName],
|
|
246
232
|
}),
|
|
247
233
|
});
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
234
|
+
this.disableAttachReorder = this.mc.config.getBoolean("Fluid.ContainerRuntime.disableAttachOpReorder");
|
|
235
|
+
const disableChunking = this.mc.config.getBoolean("Fluid.ContainerRuntime.DisableCompressionChunking");
|
|
236
|
+
const opSplitter = new opLifecycle_1.OpSplitter(chunks, this.context.submitBatchFn, disableChunking === true ? Number.POSITIVE_INFINITY : runtimeOptions.chunkSizeInBytes, runtimeOptions.maxBatchSizeInBytes, this.mc.logger);
|
|
251
237
|
this.remoteMessageProcessor = new opLifecycle_1.RemoteMessageProcessor(opSplitter, new opLifecycle_1.OpDecompressor());
|
|
252
238
|
this.handleContext = new containerHandleContext_1.ContainerFluidHandleContext("", this);
|
|
253
239
|
if (this.summaryConfiguration.state === "enabled") {
|
|
254
240
|
this.validateSummaryHeuristicConfiguration(this.summaryConfiguration);
|
|
255
241
|
}
|
|
242
|
+
const disableOpReentryCheck = this.mc.config.getBoolean("Fluid.ContainerRuntime.DisableOpReentryCheck");
|
|
256
243
|
this.enableOpReentryCheck =
|
|
257
244
|
runtimeOptions.enableOpReentryCheck === true &&
|
|
258
245
|
// Allow for a break-glass config to override the options
|
|
259
|
-
|
|
246
|
+
disableOpReentryCheck !== true;
|
|
260
247
|
this.summariesDisabled = this.isSummariesDisabled();
|
|
261
248
|
this.heuristicsDisabled = this.isHeuristicsDisabled();
|
|
262
249
|
this.maxOpsSinceLastSummary = this.getMaxOpsSinceLastSummary();
|
|
263
250
|
this.initialSummarizerDelayMs = this.getInitialSummarizerDelayMs();
|
|
264
251
|
this.maxConsecutiveReconnects =
|
|
265
252
|
(_d = this.mc.config.getNumber(maxConsecutiveReconnectsKey)) !== null && _d !== void 0 ? _d : this.defaultMaxConsecutiveReconnects;
|
|
266
|
-
|
|
253
|
+
if (runtimeOptions.flushMode === runtime_definitions_1.FlushModeExperimental.Async &&
|
|
254
|
+
((_e = context.supportedFeatures) === null || _e === void 0 ? void 0 : _e.get("referenceSequenceNumbers")) !== true) {
|
|
255
|
+
// The loader does not support reference sequence numbers, falling back on FlushMode.TurnBased
|
|
256
|
+
this.mc.logger.sendErrorEvent({ eventName: "FlushModeFallback" });
|
|
257
|
+
this._flushMode = runtime_definitions_1.FlushMode.TurnBased;
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
this._flushMode = runtimeOptions.flushMode;
|
|
261
|
+
}
|
|
267
262
|
const pendingRuntimeState = context.pendingLocalState;
|
|
268
|
-
const baseSnapshot = (
|
|
269
|
-
const maxSnapshotCacheDurationMs = (
|
|
263
|
+
const baseSnapshot = (_f = pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.baseSnapshot) !== null && _f !== void 0 ? _f : context.baseSnapshot;
|
|
264
|
+
const maxSnapshotCacheDurationMs = (_h = (_g = this._storage) === null || _g === void 0 ? void 0 : _g.policies) === null || _h === void 0 ? void 0 : _h.maximumCacheDurationMs;
|
|
270
265
|
if (maxSnapshotCacheDurationMs !== undefined &&
|
|
271
266
|
maxSnapshotCacheDurationMs > 5 * 24 * 60 * 60 * 1000) {
|
|
272
267
|
// This is a runtime enforcement of what's already explicit in the policy's type itself,
|
|
@@ -274,7 +269,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
274
269
|
// As long as the actual value is less than 5 days, the assumptions GC makes here are valid.
|
|
275
270
|
throw new container_utils_1.UsageError("Driver's maximumCacheDurationMs policy cannot exceed 5 days");
|
|
276
271
|
}
|
|
277
|
-
this.garbageCollector =
|
|
272
|
+
this.garbageCollector = gc_1.GarbageCollector.create({
|
|
278
273
|
runtime: this,
|
|
279
274
|
gcOptions: this.runtimeOptions.gcOptions,
|
|
280
275
|
baseSnapshot,
|
|
@@ -282,7 +277,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
282
277
|
existing,
|
|
283
278
|
metadata,
|
|
284
279
|
createContainerMetadata: this.createContainerMetadata,
|
|
285
|
-
isSummarizerClient: this.context.clientDetails.type ===
|
|
280
|
+
isSummarizerClient: this.context.clientDetails.type === summary_1.summarizerClientType,
|
|
286
281
|
getNodePackagePath: async (nodePath) => this.getGCNodePackagePath(nodePath),
|
|
287
282
|
getLastSummaryTimestampMs: () => { var _a; return (_a = this.messageAtLastSummary) === null || _a === void 0 ? void 0 : _a.timestamp; },
|
|
288
283
|
readAndParseBlob: async (id) => (0, driver_utils_1.readAndParse)(this.storage, id),
|
|
@@ -313,7 +308,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
313
308
|
if (baseSnapshot) {
|
|
314
309
|
this.summarizerNode.updateBaseSummaryState(baseSnapshot);
|
|
315
310
|
}
|
|
316
|
-
this.dataStores = new dataStores_1.DataStores((0, dataStores_1.getSummaryForDatastores)(baseSnapshot, metadata), this, (attachMsg) => this.submit(ContainerMessageType.Attach, attachMsg), (id, createParam) => (summarizeInternal, getGCDataFn
|
|
311
|
+
this.dataStores = new dataStores_1.DataStores((0, dataStores_1.getSummaryForDatastores)(baseSnapshot, metadata), this, (attachMsg) => this.submit(ContainerMessageType.Attach, attachMsg), (id, createParam) => (summarizeInternal, getGCDataFn) => this.summarizerNode.createChild(summarizeInternal, id, createParam, undefined, getGCDataFn), (id) => this.summarizerNode.deleteChild(id), this.mc.logger, (path, timestampMs, packagePath) => this.garbageCollector.nodeUpdated(path, "Changed", timestampMs, packagePath), (path) => this.garbageCollector.isNodeDeleted(path), new Map(dataStoreAliasMap));
|
|
317
312
|
this.blobManager = new blobManager_1.BlobManager(this.handleContext, blobManagerSnapshot, () => this.storage, (localId, blobId) => {
|
|
318
313
|
if (!this.disposed) {
|
|
319
314
|
this.submit(ContainerMessageType.BlobAttach, undefined, undefined, {
|
|
@@ -332,12 +327,14 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
332
327
|
rollback: this.rollback.bind(this),
|
|
333
328
|
orderSequentially: this.orderSequentially.bind(this),
|
|
334
329
|
}, pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.pending);
|
|
335
|
-
const
|
|
330
|
+
const disableCompression = this.mc.config.getBoolean("Fluid.ContainerRuntime.DisableCompression");
|
|
331
|
+
const compressionOptions = disableCompression === true
|
|
336
332
|
? {
|
|
337
333
|
minimumBatchSizeInBytes: Number.POSITIVE_INFINITY,
|
|
338
334
|
compressionAlgorithm: CompressionAlgorithms.lz4,
|
|
339
335
|
}
|
|
340
336
|
: runtimeOptions.compressionOptions;
|
|
337
|
+
const disablePartialFlush = this.mc.config.getBoolean("Fluid.ContainerRuntime.DisablePartialFlush");
|
|
341
338
|
this.outbox = new opLifecycle_1.Outbox({
|
|
342
339
|
shouldSend: () => this.canSendOps(),
|
|
343
340
|
pendingStateManager: this.pendingStateManager,
|
|
@@ -347,14 +344,14 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
347
344
|
config: {
|
|
348
345
|
compressionOptions,
|
|
349
346
|
maxBatchSizeInBytes: runtimeOptions.maxBatchSizeInBytes,
|
|
350
|
-
|
|
347
|
+
disablePartialFlush: disablePartialFlush === true,
|
|
351
348
|
},
|
|
352
349
|
logger: this.mc.logger,
|
|
353
350
|
});
|
|
354
351
|
this.context.quorum.on("removeMember", (clientId) => {
|
|
355
352
|
this.remoteMessageProcessor.clearPartialMessagesFor(clientId);
|
|
356
353
|
});
|
|
357
|
-
this.summaryCollection = new
|
|
354
|
+
this.summaryCollection = new summary_1.SummaryCollection(this.deltaManager, this.logger);
|
|
358
355
|
this.dirtyContainer =
|
|
359
356
|
this.context.attachState !== container_definitions_1.AttachState.Attached ||
|
|
360
357
|
this.pendingStateManager.hasPendingMessages();
|
|
@@ -364,13 +361,13 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
364
361
|
}
|
|
365
362
|
else {
|
|
366
363
|
const orderedClientLogger = telemetry_utils_1.ChildLogger.create(this.logger, "OrderedClientElection");
|
|
367
|
-
const orderedClientCollection = new
|
|
368
|
-
const orderedClientElectionForSummarizer = new
|
|
369
|
-
this.summarizerClientElection = new
|
|
370
|
-
if (this.context.clientDetails.type ===
|
|
371
|
-
this._summarizer = new
|
|
364
|
+
const orderedClientCollection = new summary_1.OrderedClientCollection(orderedClientLogger, this.context.deltaManager, this.context.quorum);
|
|
365
|
+
const orderedClientElectionForSummarizer = new summary_1.OrderedClientElection(orderedClientLogger, orderedClientCollection, electedSummarizerData !== null && electedSummarizerData !== void 0 ? electedSummarizerData : this.context.deltaManager.lastSequenceNumber, summary_1.SummarizerClientElection.isClientEligible);
|
|
366
|
+
this.summarizerClientElection = new summary_1.SummarizerClientElection(orderedClientLogger, this.summaryCollection, orderedClientElectionForSummarizer, this.maxOpsSinceLastSummary);
|
|
367
|
+
if (this.context.clientDetails.type === summary_1.summarizerClientType) {
|
|
368
|
+
this._summarizer = new summary_1.Summarizer("/_summarizer", this /* ISummarizerRuntime */, () => this.summaryConfiguration, this /* ISummarizerInternalsProvider */, this.handleContext, this.summaryCollection, async (runtime) => summary_1.RunWhileConnectedCoordinator.create(runtime));
|
|
372
369
|
}
|
|
373
|
-
else if (
|
|
370
|
+
else if (summary_1.SummarizerClientElection.clientDetailsPermitElection(this.context.clientDetails)) {
|
|
374
371
|
// Only create a SummaryManager and SummarizerClientElection
|
|
375
372
|
// if summaries are enabled and we are not the summarizer client.
|
|
376
373
|
const defaultAction = () => {
|
|
@@ -390,7 +387,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
390
387
|
};
|
|
391
388
|
this.summaryCollection.on("default", defaultAction);
|
|
392
389
|
// Create the SummaryManager and mark the initial state
|
|
393
|
-
this.summaryManager = new
|
|
390
|
+
this.summaryManager = new summary_1.SummaryManager(this.summarizerClientElection, this, // IConnectedState
|
|
394
391
|
this.summaryCollection, this.logger, this.formRequestSummarizerFn(this.context.loader), new throttler_1.Throttler(60 * 1000, // 60 sec delay window
|
|
395
392
|
30 * 1000, // 30 sec max delay
|
|
396
393
|
// throttling function increases exponentially (0ms, 40ms, 80ms, 160ms, etc)
|
|
@@ -421,7 +418,13 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
421
418
|
});
|
|
422
419
|
// logging hardware telemetry
|
|
423
420
|
logger.sendTelemetryEvent(Object.assign({ eventName: "DeviceSpec" }, getDeviceSpec()));
|
|
424
|
-
this.logger.sendTelemetryEvent(Object.assign(Object.assign(Object.assign({ eventName: "ContainerLoadStats" }, this.createContainerMetadata), this.dataStores.containerLoadStats), { summaryNumber: loadSummaryNumber, summaryFormatVersion: metadata === null || metadata === void 0 ? void 0 : metadata.summaryFormatVersion, disableIsolatedChannels: metadata === null || metadata === void 0 ? void 0 : metadata.disableIsolatedChannels, gcVersion: metadata === null || metadata === void 0 ? void 0 : metadata.gcFeature
|
|
421
|
+
this.logger.sendTelemetryEvent(Object.assign(Object.assign(Object.assign({ eventName: "ContainerLoadStats" }, this.createContainerMetadata), this.dataStores.containerLoadStats), { summaryNumber: loadSummaryNumber, summaryFormatVersion: metadata === null || metadata === void 0 ? void 0 : metadata.summaryFormatVersion, disableIsolatedChannels: metadata === null || metadata === void 0 ? void 0 : metadata.disableIsolatedChannels, gcVersion: metadata === null || metadata === void 0 ? void 0 : metadata.gcFeature, options: JSON.stringify(runtimeOptions), featureGates: JSON.stringify({
|
|
422
|
+
disableCompression,
|
|
423
|
+
disableOpReentryCheck,
|
|
424
|
+
disableChunking,
|
|
425
|
+
disableAttachReorder: this.disableAttachReorder,
|
|
426
|
+
disablePartialFlush,
|
|
427
|
+
}) }));
|
|
425
428
|
(0, connectionTelemetry_1.ReportOpPerfTelemetry)(this.context.clientId, this.deltaManager, this.logger);
|
|
426
429
|
(0, batchTracker_1.BindBatchTracker)(this, this.logger);
|
|
427
430
|
}
|
|
@@ -503,14 +506,14 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
503
506
|
}
|
|
504
507
|
};
|
|
505
508
|
const [chunks, metadata, electedSummarizerData, aliases] = await Promise.all([
|
|
506
|
-
tryFetchBlob(
|
|
507
|
-
tryFetchBlob(
|
|
508
|
-
tryFetchBlob(
|
|
509
|
-
tryFetchBlob(
|
|
509
|
+
tryFetchBlob(summary_1.chunksBlobName),
|
|
510
|
+
tryFetchBlob(summary_1.metadataBlobName),
|
|
511
|
+
tryFetchBlob(summary_1.electedSummarizerBlobName),
|
|
512
|
+
tryFetchBlob(summary_1.aliasBlobName),
|
|
510
513
|
]);
|
|
511
514
|
const loadExisting = existing === true || context.existing === true;
|
|
512
515
|
// read snapshot blobs needed for BlobManager to load
|
|
513
|
-
const blobManagerSnapshot = await blobManager_1.BlobManager.load(baseSnapshot === null || baseSnapshot === void 0 ? void 0 : baseSnapshot.trees[
|
|
516
|
+
const blobManagerSnapshot = await blobManager_1.BlobManager.load(baseSnapshot === null || baseSnapshot === void 0 ? void 0 : baseSnapshot.trees[summary_1.blobsTreeName], async (id) => {
|
|
514
517
|
// IContainerContext storage api return type still has undefined in 0.39 package version.
|
|
515
518
|
// So once we release 0.40 container-defn package we can remove this check.
|
|
516
519
|
(0, common_utils_1.assert)(storage !== undefined, 0x256 /* "storage undefined in attached container" */);
|
|
@@ -687,6 +690,9 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
687
690
|
this.emit("dispose");
|
|
688
691
|
this.removeAllListeners();
|
|
689
692
|
}
|
|
693
|
+
/**
|
|
694
|
+
* @deprecated 2.0.0-internal.3.2.0 ContainerRuntime is not an IFluidTokenProvider. Token providers should be accessed using normal provider patterns.
|
|
695
|
+
*/
|
|
690
696
|
get IFluidTokenProvider() {
|
|
691
697
|
var _a;
|
|
692
698
|
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.intelligence) {
|
|
@@ -764,7 +770,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
764
770
|
return (_a = this.dataStores.aliases.get(maybeAlias)) !== null && _a !== void 0 ? _a : maybeAlias;
|
|
765
771
|
}
|
|
766
772
|
async getDataStoreFromRequest(id, request) {
|
|
767
|
-
var _a, _b, _c
|
|
773
|
+
var _a, _b, _c;
|
|
768
774
|
const headerData = {};
|
|
769
775
|
if (typeof ((_a = request.headers) === null || _a === void 0 ? void 0 : _a[RuntimeHeaders.wait]) === "boolean") {
|
|
770
776
|
headerData.wait = request.headers[RuntimeHeaders.wait];
|
|
@@ -778,23 +784,6 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
778
784
|
await this.dataStores.waitIfPendingAlias(id);
|
|
779
785
|
const internalId = this.internalId(id);
|
|
780
786
|
const dataStoreContext = await this.dataStores.getDataStore(internalId, headerData);
|
|
781
|
-
/**
|
|
782
|
-
* If GC should run and this an external app request with "externalRequest" header, we need to return
|
|
783
|
-
* an error if the data store being requested is marked as unreferenced as per the data store's base
|
|
784
|
-
* GC data.
|
|
785
|
-
*
|
|
786
|
-
* This is a workaround to handle scenarios where a data store shared with an external app is deleted
|
|
787
|
-
* and marked as unreferenced by GC. Returning an error will fail to load the data store for the app.
|
|
788
|
-
*/
|
|
789
|
-
if (((_d = request.headers) === null || _d === void 0 ? void 0 : _d[RuntimeHeaders.externalRequest]) &&
|
|
790
|
-
this.garbageCollector.shouldRunGC) {
|
|
791
|
-
// The data store is referenced if used routes in the base summary has a route to self.
|
|
792
|
-
// Older documents may not have used routes in the summary. They are considered referenced.
|
|
793
|
-
const usedRoutes = (await dataStoreContext.getBaseGCDetails()).usedRoutes;
|
|
794
|
-
if (!(usedRoutes === undefined || usedRoutes.includes("") || usedRoutes.includes("/"))) {
|
|
795
|
-
throw (0, runtime_utils_1.responseToException)((0, runtime_utils_1.create404Response)(request), request);
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
787
|
const dataStoreChannel = await dataStoreContext.realize();
|
|
799
788
|
// Remove query params, leading and trailing slashes from the url. This is done to make sure the format is
|
|
800
789
|
// the same as GC nodes id.
|
|
@@ -810,29 +799,29 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
810
799
|
summaryNumber: this.nextSummaryNumber++, summaryFormatVersion: 1 }), this.garbageCollector.getMetadata()), {
|
|
811
800
|
// The last message processed at the time of summary. If there are no new messages, use the message from the
|
|
812
801
|
// last summary.
|
|
813
|
-
message: (_a = (0,
|
|
814
|
-
(0, runtime_utils_1.addBlobToSummary)(summaryTree,
|
|
802
|
+
message: (_a = (0, summary_1.extractSummaryMetadataMessage)(this.deltaManager.lastMessage)) !== null && _a !== void 0 ? _a : this.messageAtLastSummary });
|
|
803
|
+
(0, runtime_utils_1.addBlobToSummary)(summaryTree, summary_1.metadataBlobName, JSON.stringify(metadata));
|
|
815
804
|
}
|
|
816
805
|
addContainerStateToSummary(summaryTree, fullTree, trackState, telemetryContext) {
|
|
817
806
|
var _a;
|
|
818
807
|
this.addMetadataToSummary(summaryTree);
|
|
819
808
|
if (this.remoteMessageProcessor.partialMessages.size > 0) {
|
|
820
809
|
const content = JSON.stringify([...this.remoteMessageProcessor.partialMessages]);
|
|
821
|
-
(0, runtime_utils_1.addBlobToSummary)(summaryTree,
|
|
810
|
+
(0, runtime_utils_1.addBlobToSummary)(summaryTree, summary_1.chunksBlobName, content);
|
|
822
811
|
}
|
|
823
812
|
const dataStoreAliases = this.dataStores.aliases;
|
|
824
813
|
if (dataStoreAliases.size > 0) {
|
|
825
|
-
(0, runtime_utils_1.addBlobToSummary)(summaryTree,
|
|
814
|
+
(0, runtime_utils_1.addBlobToSummary)(summaryTree, summary_1.aliasBlobName, JSON.stringify([...dataStoreAliases]));
|
|
826
815
|
}
|
|
827
816
|
if (this.summarizerClientElection) {
|
|
828
817
|
const electedSummarizerContent = JSON.stringify((_a = this.summarizerClientElection) === null || _a === void 0 ? void 0 : _a.serialize());
|
|
829
|
-
(0, runtime_utils_1.addBlobToSummary)(summaryTree,
|
|
818
|
+
(0, runtime_utils_1.addBlobToSummary)(summaryTree, summary_1.electedSummarizerBlobName, electedSummarizerContent);
|
|
830
819
|
}
|
|
831
820
|
const blobManagerSummary = this.blobManager.summarize();
|
|
832
821
|
// Some storage (like git) doesn't allow empty tree, so we can omit it.
|
|
833
822
|
// and the blob manager can handle the tree not existing when loading
|
|
834
823
|
if (Object.keys(blobManagerSummary.summary.tree).length > 0) {
|
|
835
|
-
(0, runtime_utils_1.addTreeToSummary)(summaryTree,
|
|
824
|
+
(0, runtime_utils_1.addTreeToSummary)(summaryTree, summary_1.blobsTreeName, blobManagerSummary);
|
|
836
825
|
}
|
|
837
826
|
const gcSummary = this.garbageCollector.summarize(fullTree, trackState, telemetryContext);
|
|
838
827
|
if (gcSummary !== undefined) {
|
|
@@ -1080,8 +1069,10 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1080
1069
|
clientSignalSequenceNumber: envelope.clientSignalSequenceNumber,
|
|
1081
1070
|
});
|
|
1082
1071
|
}
|
|
1083
|
-
else if (
|
|
1084
|
-
|
|
1072
|
+
else if (this.consecutiveReconnects === 0 &&
|
|
1073
|
+
envelope.clientSignalSequenceNumber ===
|
|
1074
|
+
this._perfSignalData.trackingSignalSequenceNumber) {
|
|
1075
|
+
// only logging for the first connection and the trackingSignalSequenceNUmber.
|
|
1085
1076
|
this.sendSignalTelemetryEvent(envelope.clientSignalSequenceNumber);
|
|
1086
1077
|
this._perfSignalData.trackingSignalSequenceNumber = undefined;
|
|
1087
1078
|
}
|
|
@@ -1185,7 +1176,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1185
1176
|
* Are we in the middle of batching ops together?
|
|
1186
1177
|
*/
|
|
1187
1178
|
currentlyBatching() {
|
|
1188
|
-
return this.flushMode
|
|
1179
|
+
return this.flushMode !== runtime_definitions_1.FlushMode.Immediate || this._orderSequentiallyCalls !== 0;
|
|
1189
1180
|
}
|
|
1190
1181
|
getQuorum() {
|
|
1191
1182
|
return this.context.quorum;
|
|
@@ -1274,7 +1265,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1274
1265
|
}
|
|
1275
1266
|
const summarizeResult = this.dataStores.createSummary(telemetryContext);
|
|
1276
1267
|
// Wrap data store summaries in .channels subtree.
|
|
1277
|
-
(0,
|
|
1268
|
+
(0, summary_1.wrapSummaryInChannelsTree)(summarizeResult);
|
|
1278
1269
|
this.addContainerStateToSummary(summarizeResult, true /* fullTree */, false /* trackState */, telemetryContext);
|
|
1279
1270
|
return summarizeResult.summary;
|
|
1280
1271
|
}
|
|
@@ -1290,7 +1281,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1290
1281
|
async summarizeInternal(fullTree, trackState, telemetryContext) {
|
|
1291
1282
|
const summarizeResult = await this.dataStores.summarize(fullTree, trackState, telemetryContext);
|
|
1292
1283
|
// Wrap data store summaries in .channels subtree.
|
|
1293
|
-
(0,
|
|
1284
|
+
(0, summary_1.wrapSummaryInChannelsTree)(summarizeResult);
|
|
1294
1285
|
const pathPartsForChildren = [runtime_definitions_1.channelsTreeName];
|
|
1295
1286
|
this.addContainerStateToSummary(summarizeResult, fullTree, trackState, telemetryContext);
|
|
1296
1287
|
return Object.assign(Object.assign({}, summarizeResult), { id: "", pathPartsForChildren });
|
|
@@ -1301,11 +1292,19 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1301
1292
|
async summarize(options) {
|
|
1302
1293
|
this.verifyNotClosed();
|
|
1303
1294
|
const { fullTree = false, trackState = true, summaryLogger = this.mc.logger, runGC = this.garbageCollector.shouldRunGC, runSweep, fullGC, } = options;
|
|
1295
|
+
const telemetryContext = new runtime_utils_1.TelemetryContext();
|
|
1296
|
+
// Add the options that are used to generate this summary to the telemetry context.
|
|
1297
|
+
telemetryContext.setMultiple("fluid_Summarize", "Options", {
|
|
1298
|
+
fullTree,
|
|
1299
|
+
trackState,
|
|
1300
|
+
runGC,
|
|
1301
|
+
fullGC,
|
|
1302
|
+
runSweep,
|
|
1303
|
+
});
|
|
1304
1304
|
let gcStats;
|
|
1305
1305
|
if (runGC) {
|
|
1306
|
-
gcStats = await this.collectGarbage({ logger: summaryLogger, runSweep, fullGC });
|
|
1306
|
+
gcStats = await this.collectGarbage({ logger: summaryLogger, runSweep, fullGC }, telemetryContext);
|
|
1307
1307
|
}
|
|
1308
|
-
const telemetryContext = new runtime_utils_1.TelemetryContext();
|
|
1309
1308
|
const { stats, summary } = await this.summarizerNode.summarize(fullTree, trackState, telemetryContext);
|
|
1310
1309
|
this.logger.sendTelemetryEvent({
|
|
1311
1310
|
eventName: "SummarizeTelemetry",
|
|
@@ -1362,16 +1361,20 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1362
1361
|
this.dataStores.updateUnusedRoutes(dataStoreRoutes);
|
|
1363
1362
|
}
|
|
1364
1363
|
/**
|
|
1365
|
-
*
|
|
1366
|
-
* @param unusedRoutes - object routes and sub routes that can be deleted
|
|
1367
|
-
* @returns - routes of objects deleted from the runtime
|
|
1364
|
+
* @deprecated - Replaced by deleteSweepReadyNodes.
|
|
1368
1365
|
*/
|
|
1369
1366
|
deleteUnusedNodes(unusedRoutes) {
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1367
|
+
throw new Error("deleteUnusedRoutes should not be called");
|
|
1368
|
+
}
|
|
1369
|
+
/**
|
|
1370
|
+
* After GC has run and identified nodes that are sweep ready, this is called to delete the sweep ready nodes.
|
|
1371
|
+
* @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.
|
|
1372
|
+
* @returns - The routes of nodes that were deleted.
|
|
1373
|
+
*/
|
|
1374
|
+
deleteSweepReadyNodes(sweepReadyRoutes) {
|
|
1375
|
+
const { dataStoreRoutes, blobManagerRoutes } = this.getDataStoreAndBlobManagerRoutes(sweepReadyRoutes);
|
|
1376
|
+
const deletedRoutes = this.dataStores.deleteSweepReadyNodes(dataStoreRoutes);
|
|
1377
|
+
return deletedRoutes.concat(this.blobManager.deleteSweepReadyNodes(blobManagerRoutes));
|
|
1375
1378
|
}
|
|
1376
1379
|
/**
|
|
1377
1380
|
* This is called to update objects that are tombstones.
|
|
@@ -1398,9 +1401,9 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1398
1401
|
getNodeType(nodePath) {
|
|
1399
1402
|
var _a;
|
|
1400
1403
|
if (this.isBlobPath(nodePath)) {
|
|
1401
|
-
return
|
|
1404
|
+
return gc_1.GCNodeType.Blob;
|
|
1402
1405
|
}
|
|
1403
|
-
return (_a = this.dataStores.getGCNodeType(nodePath)) !== null && _a !== void 0 ? _a :
|
|
1406
|
+
return (_a = this.dataStores.getGCNodeType(nodePath)) !== null && _a !== void 0 ? _a : gc_1.GCNodeType.Other;
|
|
1404
1407
|
}
|
|
1405
1408
|
/**
|
|
1406
1409
|
* Called by GC to retrieve the package path of the node with the given path. The node should belong to a
|
|
@@ -1408,10 +1411,10 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1408
1411
|
*/
|
|
1409
1412
|
async getGCNodePackagePath(nodePath) {
|
|
1410
1413
|
switch (this.getNodeType(nodePath)) {
|
|
1411
|
-
case
|
|
1414
|
+
case gc_1.GCNodeType.Blob:
|
|
1412
1415
|
return [blobManager_1.BlobManager.basePath];
|
|
1413
|
-
case
|
|
1414
|
-
case
|
|
1416
|
+
case gc_1.GCNodeType.DataStore:
|
|
1417
|
+
case gc_1.GCNodeType.SubDataStore:
|
|
1415
1418
|
return this.dataStores.getDataStorePackagePath(nodePath);
|
|
1416
1419
|
default:
|
|
1417
1420
|
(0, common_utils_1.assert)(false, 0x2de /* "Package path requested for unsupported node type." */);
|
|
@@ -1450,8 +1453,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1450
1453
|
* Runs garbage collection and updates the reference / used state of the nodes in the container.
|
|
1451
1454
|
* @returns the statistics of the garbage collection run; undefined if GC did not run.
|
|
1452
1455
|
*/
|
|
1453
|
-
async collectGarbage(options) {
|
|
1454
|
-
return this.garbageCollector.collectGarbage(options);
|
|
1456
|
+
async collectGarbage(options, telemetryContext) {
|
|
1457
|
+
return this.garbageCollector.collectGarbage(options, telemetryContext);
|
|
1455
1458
|
}
|
|
1456
1459
|
/**
|
|
1457
1460
|
* Called when a new outbound reference is added to another node. This is used by garbage collection to identify
|
|
@@ -1638,7 +1641,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1638
1641
|
}
|
|
1639
1642
|
let clientSequenceNumber;
|
|
1640
1643
|
try {
|
|
1641
|
-
clientSequenceNumber = this.submitSummaryMessage(summaryMessage);
|
|
1644
|
+
clientSequenceNumber = this.submitSummaryMessage(summaryMessage, summaryRefSeqNum);
|
|
1642
1645
|
}
|
|
1643
1646
|
catch (error) {
|
|
1644
1647
|
return Object.assign(Object.assign({ stage: "upload" }, uploadData), { error });
|
|
@@ -1700,8 +1703,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1700
1703
|
this.verifyCanSubmitOps();
|
|
1701
1704
|
// There should be no ops in detached container state!
|
|
1702
1705
|
(0, common_utils_1.assert)(this.attachState !== container_definitions_1.AttachState.Detached, 0x132 /* "sending ops in detached container" */);
|
|
1703
|
-
const
|
|
1704
|
-
const serializedContent = JSON.stringify(deserializedContent);
|
|
1706
|
+
const serializedContent = JSON.stringify({ type, contents });
|
|
1705
1707
|
if (this.deltaManager.readOnlyInfo.readonly) {
|
|
1706
1708
|
this.logger.sendTelemetryEvent({
|
|
1707
1709
|
eventName: "SubmitOpInReadonly",
|
|
@@ -1710,7 +1712,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1710
1712
|
}
|
|
1711
1713
|
const message = {
|
|
1712
1714
|
contents: serializedContent,
|
|
1713
|
-
deserializedContent,
|
|
1715
|
+
deserializedContent: JSON.parse(serializedContent),
|
|
1714
1716
|
metadata,
|
|
1715
1717
|
localOpMetadata,
|
|
1716
1718
|
referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
|
|
@@ -1738,7 +1740,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1738
1740
|
// optimization no longer makes sense (for example, batch compression may make it less appealing).
|
|
1739
1741
|
if (this.currentlyBatching() &&
|
|
1740
1742
|
type === ContainerMessageType.Attach &&
|
|
1741
|
-
this.
|
|
1743
|
+
this.disableAttachReorder !== true) {
|
|
1742
1744
|
this.outbox.submitAttach(message);
|
|
1743
1745
|
}
|
|
1744
1746
|
else {
|
|
@@ -1747,17 +1749,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1747
1749
|
if (!this.currentlyBatching()) {
|
|
1748
1750
|
this.flush();
|
|
1749
1751
|
}
|
|
1750
|
-
else
|
|
1751
|
-
this.
|
|
1752
|
-
// Queue a microtask to detect the end of the turn and force a flush.
|
|
1753
|
-
Promise.resolve()
|
|
1754
|
-
.then(() => {
|
|
1755
|
-
this.flushMicroTaskExists = false;
|
|
1756
|
-
this.flush();
|
|
1757
|
-
})
|
|
1758
|
-
.catch((error) => {
|
|
1759
|
-
this.closeFn(error);
|
|
1760
|
-
});
|
|
1752
|
+
else {
|
|
1753
|
+
this.scheduleFlush();
|
|
1761
1754
|
}
|
|
1762
1755
|
}
|
|
1763
1756
|
catch (error) {
|
|
@@ -1768,14 +1761,47 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1768
1761
|
this.updateDocumentDirtyState(true);
|
|
1769
1762
|
}
|
|
1770
1763
|
}
|
|
1771
|
-
|
|
1764
|
+
scheduleFlush() {
|
|
1765
|
+
if (this.flushTaskExists) {
|
|
1766
|
+
return;
|
|
1767
|
+
}
|
|
1768
|
+
this.flushTaskExists = true;
|
|
1769
|
+
const flush = () => {
|
|
1770
|
+
this.flushTaskExists = false;
|
|
1771
|
+
try {
|
|
1772
|
+
this.flush();
|
|
1773
|
+
}
|
|
1774
|
+
catch (error) {
|
|
1775
|
+
this.closeFn(error);
|
|
1776
|
+
}
|
|
1777
|
+
};
|
|
1778
|
+
switch (this.flushMode) {
|
|
1779
|
+
case runtime_definitions_1.FlushMode.TurnBased:
|
|
1780
|
+
// When in TurnBased flush mode the runtime will buffer operations in the current turn and send them as a single
|
|
1781
|
+
// batch at the end of the turn
|
|
1782
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
1783
|
+
Promise.resolve().then(flush);
|
|
1784
|
+
break;
|
|
1785
|
+
// FlushModeExperimental is experimental and not exposed directly in the runtime APIs
|
|
1786
|
+
case runtime_definitions_1.FlushModeExperimental.Async:
|
|
1787
|
+
// When in Async flush mode, the runtime will accumulate all operations across JS turns and send them as a single
|
|
1788
|
+
// batch when all micro-tasks are complete.
|
|
1789
|
+
// Compared to TurnBased, this flush mode will capture more ops into the same batch.
|
|
1790
|
+
setTimeout(flush, 0);
|
|
1791
|
+
break;
|
|
1792
|
+
default:
|
|
1793
|
+
(0, common_utils_1.assert)(this._orderSequentiallyCalls > 0, 0x587 /* Unreachable unless running under orderSequentially */);
|
|
1794
|
+
break;
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
submitSummaryMessage(contents, referenceSequenceNumber) {
|
|
1772
1798
|
this.verifyNotClosed();
|
|
1773
1799
|
(0, common_utils_1.assert)(this.connected, 0x133 /* "Container disconnected when trying to submit system message" */);
|
|
1774
1800
|
// System message should not be sent in the middle of the batch.
|
|
1775
1801
|
(0, common_utils_1.assert)(this.outbox.isEmpty, 0x3d4 /* System op in the middle of a batch */);
|
|
1776
1802
|
// back-compat: ADO #1385: Make this call unconditional in the future
|
|
1777
1803
|
return this.context.submitSummaryFn !== undefined
|
|
1778
|
-
? this.context.submitSummaryFn(contents)
|
|
1804
|
+
? this.context.submitSummaryFn(contents, referenceSequenceNumber)
|
|
1779
1805
|
: this.context.submitFn(protocol_definitions_1.MessageType.Summarize, contents, false);
|
|
1780
1806
|
}
|
|
1781
1807
|
/**
|
|
@@ -1872,7 +1898,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1872
1898
|
// It should only be done by the summarizerNode, if required.
|
|
1873
1899
|
// When fetching from storage we will always get the latest version and do not use the ackHandle.
|
|
1874
1900
|
const fetchLatestSnapshot = async () => {
|
|
1875
|
-
|
|
1901
|
+
let fetchResult = await this.fetchLatestSnapshotFromStorage(summaryLogger, {
|
|
1876
1902
|
eventName: "RefreshLatestSummaryAckFetch",
|
|
1877
1903
|
ackHandle,
|
|
1878
1904
|
targetSequenceNumber: summaryRefSeq,
|
|
@@ -1888,13 +1914,21 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1888
1914
|
* state.
|
|
1889
1915
|
*/
|
|
1890
1916
|
if (fetchResult.latestSnapshotRefSeq < summaryRefSeq) {
|
|
1891
|
-
|
|
1917
|
+
/* before failing, let's try to retrieve the latest snapshot for that specific ackHandle */
|
|
1918
|
+
fetchResult = await this.fetchSnapshotFromStorage(summaryLogger, {
|
|
1919
|
+
eventName: "RefreshLatestSummaryAckFetch",
|
|
1892
1920
|
ackHandle,
|
|
1893
|
-
summaryRefSeq,
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1921
|
+
targetSequenceNumber: summaryRefSeq,
|
|
1922
|
+
}, readAndParseBlob, ackHandle);
|
|
1923
|
+
if (fetchResult.latestSnapshotRefSeq < summaryRefSeq) {
|
|
1924
|
+
const error = container_utils_1.DataProcessingError.create("Fetched snapshot is older than the received ack", "RefreshLatestSummaryAck", undefined /* sequencedMessage */, {
|
|
1925
|
+
ackHandle,
|
|
1926
|
+
summaryRefSeq,
|
|
1927
|
+
fetchedSnapshotRefSeq: fetchResult.latestSnapshotRefSeq,
|
|
1928
|
+
});
|
|
1929
|
+
this.closeFn(error);
|
|
1930
|
+
throw error;
|
|
1931
|
+
}
|
|
1898
1932
|
}
|
|
1899
1933
|
// In case we had to retrieve the latest snapshot and it is different than summaryRefSeq,
|
|
1900
1934
|
// wait for the delta manager to catch up before refreshing the latest Summary.
|
|
@@ -1929,10 +1963,13 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1929
1963
|
return { latestSnapshotRefSeq, latestSnapshotVersionId: versionId };
|
|
1930
1964
|
}
|
|
1931
1965
|
async fetchLatestSnapshotFromStorage(logger, event, readAndParseBlob) {
|
|
1966
|
+
return this.fetchSnapshotFromStorage(logger, event, readAndParseBlob, null /* latest */);
|
|
1967
|
+
}
|
|
1968
|
+
async fetchSnapshotFromStorage(logger, event, readAndParseBlob, versionId) {
|
|
1932
1969
|
return telemetry_utils_1.PerformanceEvent.timedExecAsync(logger, event, async (perfEvent) => {
|
|
1933
1970
|
const stats = {};
|
|
1934
1971
|
const trace = common_utils_1.Trace.start();
|
|
1935
|
-
const versions = await this.storage.getVersions(
|
|
1972
|
+
const versions = await this.storage.getVersions(versionId, 1, "refreshLatestSummaryAckFromServer", versionId === null ? driver_definitions_1.FetchSource.noCache : undefined);
|
|
1936
1973
|
(0, common_utils_1.assert)(!!versions && !!versions[0], 0x137 /* "Failed to get version from storage" */);
|
|
1937
1974
|
stats.getVersionDuration = trace.trace().duration;
|
|
1938
1975
|
const maybeSnapshot = await this.storage.getSnapshotTree(versions[0]);
|
|
@@ -2009,7 +2046,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
2009
2046
|
[container_definitions_1.LoaderHeader.cache]: false,
|
|
2010
2047
|
[container_definitions_1.LoaderHeader.clientDetails]: {
|
|
2011
2048
|
capabilities: { interactive: false },
|
|
2012
|
-
type:
|
|
2049
|
+
type: summary_1.summarizerClientType,
|
|
2013
2050
|
},
|
|
2014
2051
|
[driver_definitions_1.DriverHeader.summarizingClient]: true,
|
|
2015
2052
|
[container_definitions_1.LoaderHeader.reconnect]: false,
|