@fluidframework/container-runtime 2.0.0-internal.3.1.0 → 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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreContext.js","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,iFAK+C;AAC/C,+DAAgG;AAEhG,+DA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+FAA+F;QAC/F,2GAA2G;QAC3G,6GAA6G;QAC7G,yGAAyG;QACzG,qCAAqC;QACrC,MAAM,CAAA,MAAA,gBAAgB,CAAC,UAAU,0CAAE,GAAG,EAAE,CAAA,CAAC;QAEzC,IAAI,MAAM,IAAI,CAAC,MAAM,EAAE,EAAE;YACxB,gBAAgB,CAAC,yBAAyB,EAAE,CAAC;SAC7C;IACF,CAAC;IAEM,KAAK,CAAC,yBAAyB;QACrC,IAAI,IAAI,CAAC,uBAAuB,EAAE;YACjC,MAAM,IAAI,KAAK,CACd,mFAAmF,CACnF,CAAC;SACF;QACD,OAAO,KAAK,CAAC,yBAAyB,EAAE,CAAC;IAC1C,CAAC;CACD;AAnDD,gFAmDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDisposable,\n\tITelemetryLogger,\n\tITelemetryProperties,\n} from \"@fluidframework/common-definitions\";\nimport { FluidObject, IRequest, IResponse, IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n\tIAudience,\n\tIDeltaManager,\n\tAttachState,\n\tILoaderOptions,\n} from \"@fluidframework/container-definitions\";\nimport { assert, Deferred, LazyPromise, TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport { BlobTreeEntry } from \"@fluidframework/protocol-base\";\nimport {\n\tIClientDetails,\n\tIDocumentMessage,\n\tIQuorumClients,\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n\tITreeEntry,\n} from \"@fluidframework/protocol-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport {\n\tBindState,\n\tchannelsTreeName,\n\tCreateChildSummarizerNodeFn,\n\tCreateChildSummarizerNodeParam,\n\tFluidDataStoreRegistryEntry,\n\tIAttachMessage,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreContextDetached,\n\tIFluidDataStoreContextEvents,\n\tIFluidDataStoreRegistry,\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n\tIInboundSignalMessage,\n\tIProvideFluidDataStoreFactory,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNodeWithGC,\n\tSummarizeInternalFn,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { addBlobToSummary, convertSummaryTreeToITree } from \"@fluidframework/runtime-utils\";\nimport {\n\tChildLogger,\n\tloggerToMonitoringContext,\n\tLoggingError,\n\tMonitoringContext,\n\tTelemetryDataTag,\n\tThresholdCounter,\n} from \"@fluidframework/telemetry-utils\";\nimport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\textractSafePropertiesFromMessage,\n} from \"@fluidframework/container-utils\";\n\nimport { ContainerRuntime } from \"./containerRuntime\";\nimport {\n\tdataStoreAttributesBlobName,\n\thasIsolatedChannels,\n\twrapSummaryInChannelsTree,\n\tReadFluidDataStoreAttributes,\n\tWriteFluidDataStoreAttributes,\n\tgetAttributesFormatVersion,\n\tgetFluidDataStoreAttributes,\n} from \"./summaryFormat\";\nimport { throwOnTombstoneUsageKey } from \"./garbageCollectionConstants\";\nimport { sendGCUnexpectedUsageEvent } from \"./garbageCollectionHelpers\";\nimport { summarizerClientType } from \"./summarizerClientElection\";\n\nfunction createAttributes(\n\tpkg: readonly string[],\n\tisRootDataStore: boolean,\n): WriteFluidDataStoreAttributes {\n\tconst stringifiedPkg = JSON.stringify(pkg);\n\treturn {\n\t\tpkg: stringifiedPkg,\n\t\tsummaryFormatVersion: 2,\n\t\tisRootDataStore,\n\t};\n}\nexport function createAttributesBlob(pkg: readonly string[], isRootDataStore: boolean): ITreeEntry {\n\tconst attributes = createAttributes(pkg, isRootDataStore);\n\treturn new BlobTreeEntry(dataStoreAttributesBlobName, JSON.stringify(attributes));\n}\n\ninterface ISnapshotDetails {\n\tpkg: readonly string[];\n\tisRootDataStore: boolean;\n\tsnapshot?: ISnapshotTree;\n}\n\ninterface FluidDataStoreMessage {\n\tcontent: any;\n\ttype: string;\n}\n\n/** Properties necessary for creating a FluidDataStoreContext */\nexport interface IFluidDataStoreContextProps {\n\treadonly id: string;\n\treadonly runtime: ContainerRuntime;\n\treadonly storage: IDocumentStorageService;\n\treadonly scope: FluidObject;\n\treadonly createSummarizerNodeFn: CreateChildSummarizerNodeFn;\n\treadonly pkg?: Readonly<string[]>;\n}\n\n/** Properties necessary for creating a local FluidDataStoreContext */\nexport interface ILocalFluidDataStoreContextProps extends IFluidDataStoreContextProps {\n\treadonly pkg: Readonly<string[]> | undefined;\n\treadonly snapshotTree: ISnapshotTree | undefined;\n\treadonly isRootDataStore: boolean | undefined;\n\treadonly makeLocallyVisibleFn: () => void;\n\t/**\n\t * @deprecated 0.16 Issue #1635, #3631\n\t */\n\treadonly createProps?: any;\n}\n\n/** Properties necessary for creating a remote FluidDataStoreContext */\nexport interface IRemoteFluidDataStoreContextProps extends IFluidDataStoreContextProps {\n\treadonly snapshotTree: ISnapshotTree | undefined;\n\treadonly getBaseGCDetails: () => Promise<IGarbageCollectionDetailsBase | undefined>;\n}\n\n/**\n * Represents the context for the store. This context is passed to the store runtime.\n */\nexport abstract class FluidDataStoreContext\n\textends TypedEventEmitter<IFluidDataStoreContextEvents>\n\timplements IFluidDataStoreContext, IDisposable\n{\n\tpublic get packagePath(): readonly string[] {\n\t\tassert(this.pkg !== undefined, 0x139 /* \"Undefined package path\" */);\n\t\treturn this.pkg;\n\t}\n\n\tpublic get options(): ILoaderOptions {\n\t\treturn this._containerRuntime.options;\n\t}\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this._containerRuntime.clientId;\n\t}\n\n\tpublic get clientDetails(): IClientDetails {\n\t\treturn this._containerRuntime.clientDetails;\n\t}\n\n\tpublic get logger(): ITelemetryLogger {\n\t\treturn this._containerRuntime.logger;\n\t}\n\n\tpublic get deltaManager(): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {\n\t\treturn this._containerRuntime.deltaManager;\n\t}\n\n\tpublic get connected(): boolean {\n\t\treturn this._containerRuntime.connected;\n\t}\n\n\tpublic get IFluidHandleContext() {\n\t\treturn this._containerRuntime.IFluidHandleContext;\n\t}\n\n\tpublic get containerRuntime(): IContainerRuntime {\n\t\treturn this._containerRuntime;\n\t}\n\n\tpublic ensureNoDataModelChanges<T>(callback: () => T): T {\n\t\treturn this._containerRuntime.ensureNoDataModelChanges(callback);\n\t}\n\n\tpublic get isLoaded(): boolean {\n\t\treturn this.loaded;\n\t}\n\n\tpublic get baseSnapshot(): ISnapshotTree | undefined {\n\t\treturn this._baseSnapshot;\n\t}\n\n\tprivate _disposed = false;\n\tpublic get disposed() {\n\t\treturn this._disposed;\n\t}\n\n\t/**\n\t * Tombstone is a temporary feature that prevents a data store from sending / receiving ops, signals and from\n\t * loading.\n\t */\n\tprivate _tombstoned = false;\n\tpublic get tombstoned() {\n\t\treturn this._tombstoned;\n\t}\n\t/** If true, throw an error when a tombstone data store is used. */\n\tprivate readonly throwOnTombstoneUsage: boolean;\n\n\t/** If true, this means that this data store context and its children have been removed from the runtime */\n\tprivate deleted: boolean = false;\n\n\tpublic get attachState(): AttachState {\n\t\treturn this._attachState;\n\t}\n\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry | undefined {\n\t\treturn this.registry;\n\t}\n\n\t/**\n\t * A datastore is considered as root if it\n\t * 1. is root in memory - see isInMemoryRoot\n\t * 2. is root as part of the base snapshot that the datastore loaded from\n\t * @returns whether a datastore is root\n\t */\n\tpublic async isRoot(): Promise<boolean> {\n\t\treturn this.isInMemoryRoot() || (await this.getInitialSnapshotDetails()).isRootDataStore;\n\t}\n\n\t/**\n\t * There are 3 states where isInMemoryRoot needs to be true\n\t * 1. when a datastore becomes aliased. This can happen for both remote and local datastores\n\t * 2. when a datastore is created locally as root\n\t * 3. when a datastore is created locally as root and is rehydrated\n\t * @returns whether a datastore is root in memory\n\t */\n\tprotected isInMemoryRoot(): boolean {\n\t\treturn this._isInMemoryRoot;\n\t}\n\n\tprotected registry: IFluidDataStoreRegistry | undefined;\n\n\tprotected detachedRuntimeCreation = false;\n\t/** @deprecated - To be replaced by calling makeLocallyVisible directly */\n\tpublic readonly bindToContext: () => void;\n\tprotected channel: IFluidDataStoreChannel | undefined;\n\tprivate loaded = false;\n\tprotected pending: ISequencedDocumentMessage[] | undefined = [];\n\tprotected channelDeferred: Deferred<IFluidDataStoreChannel> | undefined;\n\tprivate _baseSnapshot: ISnapshotTree | undefined;\n\tprotected _attachState: AttachState;\n\tprivate _isInMemoryRoot: boolean = false;\n\tprotected readonly summarizerNode: ISummarizerNodeWithGC;\n\tprotected readonly mc: MonitoringContext;\n\tprivate readonly thresholdOpsCounter: ThresholdCounter;\n\tprivate static readonly pendingOpsCountThreshold = 1000;\n\n\t// The used routes of this node as per the last GC run. This is used to update the used routes of the channel\n\t// if it realizes after GC is run.\n\tprivate lastUsedRoutes: string[] | undefined;\n\n\tpublic readonly id: string;\n\tprivate readonly _containerRuntime: ContainerRuntime;\n\tpublic readonly storage: IDocumentStorageService;\n\tpublic readonly scope: FluidObject;\n\tprotected pkg?: readonly string[];\n\n\tconstructor(\n\t\tprops: IFluidDataStoreContextProps,\n\t\tprivate readonly existing: boolean,\n\t\tprivate bindState: BindState, // Used to assert for state tracking purposes\n\t\tpublic readonly isLocalDataStore: boolean,\n\t\tprivate readonly makeLocallyVisibleFn: () => void,\n\t) {\n\t\tsuper();\n\n\t\tthis._containerRuntime = props.runtime;\n\t\tthis.id = props.id;\n\t\tthis.storage = props.storage;\n\t\tthis.scope = props.scope;\n\t\tthis.pkg = props.pkg;\n\n\t\t// URIs use slashes as delimiters. Handles use URIs.\n\t\t// Thus having slashes in types almost guarantees trouble down the road!\n\t\tassert(!this.id.includes(\"/\"), 0x13a /* Data store ID contains slash */);\n\n\t\tthis._attachState =\n\t\t\tthis.containerRuntime.attachState !== AttachState.Detached && this.existing\n\t\t\t\t? this.containerRuntime.attachState\n\t\t\t\t: AttachState.Detached;\n\n\t\tthis.bindToContext = () => {\n\t\t\tassert(\n\t\t\t\tthis.bindState === BindState.NotBound,\n\t\t\t\t0x13b /* \"datastore context is already in bound state\" */,\n\t\t\t);\n\t\t\tthis.bindState = BindState.Binding;\n\t\t\tassert(\n\t\t\t\tthis.channel !== undefined,\n\t\t\t\t0x13c /* \"undefined channel on datastore context\" */,\n\t\t\t);\n\t\t\tthis.makeLocallyVisible();\n\t\t\tthis.bindState = BindState.Bound;\n\t\t};\n\n\t\tconst thisSummarizeInternal = async (\n\t\t\tfullTree: boolean,\n\t\t\ttrackState: boolean,\n\t\t\ttelemetryContext?: ITelemetryContext,\n\t\t) => this.summarizeInternal(fullTree, trackState, telemetryContext);\n\n\t\tthis.summarizerNode = props.createSummarizerNodeFn(\n\t\t\tthisSummarizeInternal,\n\t\t\tasync (fullGC?: boolean) => this.getGCDataInternal(fullGC),\n\t\t\tasync () => this.getBaseGCDetails(),\n\t\t);\n\n\t\tthis.mc = loggerToMonitoringContext(\n\t\t\tChildLogger.create(this.logger, \"FluidDataStoreContext\"),\n\t\t);\n\t\tthis.thresholdOpsCounter = new ThresholdCounter(\n\t\t\tFluidDataStoreContext.pendingOpsCountThreshold,\n\t\t\tthis.mc.logger,\n\t\t);\n\n\t\t// Tombstone should only throw when the feature flag is enabled and the client isn't a summarizer\n\t\tthis.throwOnTombstoneUsage =\n\t\t\tthis.mc.config.getBoolean(throwOnTombstoneUsageKey) === true &&\n\t\t\tthis._containerRuntime.gcTombstoneEnforcementAllowed &&\n\t\t\tthis.clientDetails.type !== summarizerClientType;\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis._disposed = true;\n\n\t\t// Dispose any pending runtime after it gets fulfilled\n\t\t// Errors are logged where this.channelDeferred is consumed/generated (realizeCore(), bindRuntime())\n\t\tif (this.channelDeferred) {\n\t\t\tthis.channelDeferred.promise\n\t\t\t\t.then((runtime) => {\n\t\t\t\t\truntime.dispose();\n\t\t\t\t})\n\t\t\t\t.catch((error) => {});\n\t\t}\n\t}\n\n\t/**\n\t * When delete is called, that means that the data store is permanently removed from the runtime, and will not show up in future summaries\n\t * This function is called to prevent ops from being generated from this data store once it has been deleted. Furthermore, this data store\n\t * should not receive any ops/signals.\n\t */\n\tpublic delete() {\n\t\tthis.deleted = true;\n\t}\n\n\tpublic setTombstone(tombstone: boolean) {\n\t\tif (this.tombstoned === tombstone) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._tombstoned = tombstone;\n\t}\n\n\tprivate rejectDeferredRealize(reason: string, packageName?: string): never {\n\t\tthrow new LoggingError(reason, {\n\t\t\tpackageName: { value: packageName, tag: TelemetryDataTag.CodeArtifact },\n\t\t});\n\t}\n\n\tpublic async realize(): Promise<IFluidDataStoreChannel> {\n\t\tassert(!this.detachedRuntimeCreation, 0x13d /* \"Detached runtime creation on realize()\" */);\n\t\tif (!this.channelDeferred) {\n\t\t\tthis.channelDeferred = new Deferred<IFluidDataStoreChannel>();\n\t\t\tthis.realizeCore(this.existing).catch((error) => {\n\t\t\t\tconst errorWrapped = DataProcessingError.wrapIfUnrecognized(\n\t\t\t\t\terror,\n\t\t\t\t\t\"realizeFluidDataStoreContext\",\n\t\t\t\t);\n\t\t\t\terrorWrapped.addTelemetryProperties({\n\t\t\t\t\tfluidDataStoreId: {\n\t\t\t\t\t\tvalue: this.id,\n\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tthis.channelDeferred?.reject(errorWrapped);\n\t\t\t\tthis.logger.sendErrorEvent({ eventName: \"RealizeError\" }, errorWrapped);\n\t\t\t});\n\t\t}\n\t\treturn this.channelDeferred.promise;\n\t}\n\n\tprotected async factoryFromPackagePath(packages?: readonly string[]) {\n\t\tassert(this.pkg === packages, 0x13e /* \"Unexpected package path\" */);\n\t\tif (packages === undefined) {\n\t\t\tthis.rejectDeferredRealize(\"packages is undefined\");\n\t\t}\n\n\t\tlet entry: FluidDataStoreRegistryEntry | undefined;\n\t\tlet registry: IFluidDataStoreRegistry | undefined =\n\t\t\tthis._containerRuntime.IFluidDataStoreRegistry;\n\t\tlet lastPkg: string | undefined;\n\t\tfor (const pkg of packages) {\n\t\t\tif (!registry) {\n\t\t\t\tthis.rejectDeferredRealize(\"No registry for package\", lastPkg);\n\t\t\t}\n\t\t\tlastPkg = pkg;\n\t\t\tentry = await registry.get(pkg);\n\t\t\tif (!entry) {\n\t\t\t\tthis.rejectDeferredRealize(\"Registry does not contain entry for the package\", pkg);\n\t\t\t}\n\t\t\tregistry = entry.IFluidDataStoreRegistry;\n\t\t}\n\t\tconst factory = entry?.IFluidDataStoreFactory;\n\t\tif (factory === undefined) {\n\t\t\tthis.rejectDeferredRealize(\"Can't find factory for package\", lastPkg);\n\t\t}\n\n\t\treturn { factory, registry };\n\t}\n\n\tprivate async realizeCore(existing: boolean): Promise<void> {\n\t\tconst details = await this.getInitialSnapshotDetails();\n\t\t// Base snapshot is the baseline where pending ops are applied to.\n\t\t// It is important that this be in sync with the pending ops, and also\n\t\t// that it is set here, before bindRuntime is called.\n\t\tthis._baseSnapshot = details.snapshot;\n\t\tconst packages = details.pkg;\n\n\t\tconst { factory, registry } = await this.factoryFromPackagePath(packages);\n\n\t\tassert(\n\t\t\tthis.registry === undefined,\n\t\t\t0x13f /* \"datastore context registry is already set\" */,\n\t\t);\n\t\tthis.registry = registry;\n\n\t\tconst channel = await factory.instantiateDataStore(this, existing);\n\t\tassert(channel !== undefined, 0x140 /* \"undefined channel on datastore context\" */);\n\t\tthis.bindRuntime(channel);\n\t}\n\n\t/**\n\t * Notifies this object about changes in the connection state.\n\t * @param value - New connection state.\n\t * @param clientId - ID of the client. Its old ID when in disconnected state and\n\t * its new client ID when we are connecting or connected.\n\t */\n\tpublic setConnectionState(connected: boolean, clientId?: string) {\n\t\t// ConnectionState should not fail in tombstone mode as this is internally run\n\t\tthis.verifyNotClosed(\"setConnectionState\", false /* checkTombstone */);\n\n\t\t// Connection events are ignored if the store is not yet loaded\n\t\tif (!this.loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tassert(this.connected === connected, 0x141 /* \"Unexpected connected state\" */);\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tthis.channel!.setConnectionState(connected, clientId);\n\t}\n\n\tpublic process(\n\t\tmessageArg: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\tthis.verifyNotClosed(\"process\", true, extractSafePropertiesFromMessage(messageArg));\n\n\t\tconst innerContents = messageArg.contents as FluidDataStoreMessage;\n\t\tconst message = {\n\t\t\t...messageArg,\n\t\t\ttype: innerContents.type,\n\t\t\tcontents: innerContents.content,\n\t\t};\n\n\t\tthis.summarizerNode.recordChange(message);\n\n\t\tif (this.loaded) {\n\t\t\treturn this.channel?.process(message, local, localOpMetadata);\n\t\t} else {\n\t\t\tassert(!local, 0x142 /* \"local store channel is not loaded\" */);\n\t\t\tassert(this.pending !== undefined, 0x23d /* \"pending is undefined\" */);\n\t\t\tthis.pending.push(message);\n\t\t\tthis.thresholdOpsCounter.sendIfMultiple(\"StorePendingOps\", this.pending.length);\n\t\t}\n\t}\n\n\tpublic processSignal(message: IInboundSignalMessage, local: boolean): void {\n\t\tthis.verifyNotClosed(\"processSignal\");\n\n\t\t// Signals are ignored if the store is not yet loaded\n\t\tif (!this.loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.channel?.processSignal(message, local);\n\t}\n\n\tpublic getQuorum(): IQuorumClients {\n\t\treturn this._containerRuntime.getQuorum();\n\t}\n\n\tpublic getAudience(): IAudience {\n\t\treturn this._containerRuntime.getAudience();\n\t}\n\n\t/**\n\t * Returns a summary at the current sequence number.\n\t * @param fullTree - true to bypass optimizations and force a full summary tree\n\t * @param trackState - This tells whether we should track state from this summary.\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tpublic async summarize(\n\t\tfullTree: boolean = false,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult> {\n\t\treturn this.summarizerNode.summarize(fullTree, trackState, telemetryContext);\n\t}\n\n\tprivate async summarizeInternal(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeInternalResult> {\n\t\tawait this.realize();\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tconst summarizeResult = await this.channel!.summarize(\n\t\t\tfullTree,\n\t\t\ttrackState,\n\t\t\ttelemetryContext,\n\t\t);\n\n\t\t// Wrap dds summaries in .channels subtree.\n\t\twrapSummaryInChannelsTree(summarizeResult);\n\t\tconst pathPartsForChildren = [channelsTreeName];\n\n\t\t// Add data store's attributes to the summary.\n\t\tconst { pkg } = await this.getInitialSnapshotDetails();\n\t\tconst isRoot = await this.isRoot();\n\t\tconst attributes = createAttributes(pkg, isRoot);\n\t\taddBlobToSummary(summarizeResult, dataStoreAttributesBlobName, JSON.stringify(attributes));\n\n\t\t// If we are not referenced, mark the summary tree as unreferenced. Also, update unreferenced blob\n\t\t// size in the summary stats with the blobs size of this data store.\n\t\tif (!this.summarizerNode.isReferenced()) {\n\t\t\tsummarizeResult.summary.unreferenced = true;\n\t\t\tsummarizeResult.stats.unreferencedBlobSize = summarizeResult.stats.totalBlobSize;\n\t\t}\n\n\t\treturn {\n\t\t\t...summarizeResult,\n\t\t\tid: this.id,\n\t\t\tpathPartsForChildren,\n\t\t};\n\t}\n\n\t/**\n\t * Returns the data used for garbage collection. This includes a list of GC nodes that represent this data store\n\t * including any of its child channel contexts. Each node has a set of outbound routes to other GC nodes in the\n\t * document.\n\t * If there is no new data in this data store since the last summary, previous GC data is used.\n\t * If there is new data, the GC data is generated again (by calling getGCDataInternal).\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\treturn this.summarizerNode.getGCData(fullGC);\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. This is called when there is new data since last summary. It\n\t * realizes the data store and calls into each channel context to get its GC data.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tprivate async getGCDataInternal(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tawait this.realize();\n\t\tassert(\n\t\t\tthis.channel !== undefined,\n\t\t\t0x143 /* \"Channel should not be undefined when running GC\" */,\n\t\t);\n\n\t\treturn this.channel.getGCData(fullGC);\n\t}\n\n\t/**\n\t * After GC has run, called to notify the data store of routes used in it. These are used for the following:\n\t *\n\t * 1. To identify if this data store is being referenced in the document or not.\n\t *\n\t * 2. To determine if it needs to re-summarize in case used routes changed since last summary.\n\t *\n\t * 3. These are added to the summary generated by the data store.\n\t *\n\t * 4. To notify child contexts of their used routes. This is done immediately if the data store is loaded.\n\t * Else, it is done when realizing the data store.\n\t *\n\t * 5. To update the timestamp when this data store or any children are marked as unreferenced.\n\t *\n\t * @param usedRoutes - The routes that are used in this data store.\n\t */\n\tpublic updateUsedRoutes(usedRoutes: string[]) {\n\t\t// Update the used routes in this data store's summarizer node.\n\t\tthis.summarizerNode.updateUsedRoutes(usedRoutes);\n\n\t\t/**\n\t\t * Store the used routes to update the channel if the data store is not loaded yet. If the used routes changed\n\t\t * since the previous run, the data store will be loaded during summarize since the used state changed. So, it's\n\t\t * safe to only store the last used routes.\n\t\t */\n\t\tthis.lastUsedRoutes = usedRoutes;\n\n\t\t// If we are loaded, call the channel so it can update the used routes of the child contexts.\n\t\t// If we are not loaded, we will update this when we are realized.\n\t\tif (this.loaded) {\n\t\t\tthis.updateChannelUsedRoutes();\n\t\t}\n\t}\n\n\t/**\n\t * Called when a new outbound reference is added to another node. This is used by garbage collection to identify\n\t * all references added in the system.\n\t * @param srcHandle - The handle of the node that added the reference.\n\t * @param outboundHandle - The handle of the outbound node that is referenced.\n\t */\n\tpublic addedGCOutboundReference(srcHandle: IFluidHandle, outboundHandle: IFluidHandle) {\n\t\tthis._containerRuntime.addedGCOutboundReference(srcHandle, outboundHandle);\n\t}\n\n\t/**\n\t * Updates the used routes of the channel and its child contexts. The channel must be loaded before calling this.\n\t * It is called in these two scenarios:\n\t * 1. When the used routes of the data store is updated and the data store is loaded.\n\t * 2. When the data store is realized. This updates the channel's used routes as per last GC run.\n\t */\n\tprivate updateChannelUsedRoutes() {\n\t\tassert(this.loaded, 0x144 /* \"Channel should be loaded when updating used routes\" */);\n\t\tassert(\n\t\t\tthis.channel !== undefined,\n\t\t\t0x145 /* \"Channel should be present when data store is loaded\" */,\n\t\t);\n\n\t\t// If there is no lastUsedRoutes, GC has not run up until this point.\n\t\tif (this.lastUsedRoutes === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove the route to this data store, if it exists.\n\t\tconst usedChannelRoutes = this.lastUsedRoutes.filter((id: string) => {\n\t\t\treturn id !== \"/\" && id !== \"\";\n\t\t});\n\t\tthis.channel.updateUsedRoutes(usedChannelRoutes);\n\t}\n\n\t/**\n\t * @deprecated 0.18.Should call request on the runtime directly\n\t */\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\tconst runtime = await this.realize();\n\t\treturn runtime.request(request);\n\t}\n\n\tpublic submitMessage(type: string, content: any, localOpMetadata: unknown): void {\n\t\tthis.verifyNotClosed(\"submitMessage\");\n\t\tassert(!!this.channel, 0x146 /* \"Channel must exist when submitting message\" */);\n\t\tconst fluidDataStoreContent: FluidDataStoreMessage = {\n\t\t\tcontent,\n\t\t\ttype,\n\t\t};\n\t\tthis._containerRuntime.submitDataStoreOp(this.id, fluidDataStoreContent, localOpMetadata);\n\t}\n\n\t/**\n\t * This is called from a SharedSummaryBlock that does not generate ops but only wants to be part of the summary.\n\t * It indicates that there is data in the object that needs to be summarized.\n\t * We will update the latestSequenceNumber of the summary tracker of this\n\t * store and of the object's channel.\n\t *\n\t * @param address - The address of the channel that is dirty.\n\t *\n\t */\n\tpublic setChannelDirty(address: string): void {\n\t\tthis.verifyNotClosed(\"setChannelDirty\");\n\n\t\t// Get the latest sequence number.\n\t\tconst latestSequenceNumber = this.deltaManager.lastSequenceNumber;\n\n\t\tthis.summarizerNode.invalidate(latestSequenceNumber);\n\n\t\tconst channelSummarizerNode = this.summarizerNode.getChild(address);\n\n\t\tif (channelSummarizerNode) {\n\t\t\tchannelSummarizerNode.invalidate(latestSequenceNumber); // TODO: lazy load problem?\n\t\t}\n\t}\n\n\tpublic submitSignal(type: string, content: any) {\n\t\tthis.verifyNotClosed(\"submitSignal\");\n\n\t\tassert(!!this.channel, 0x147 /* \"Channel must exist on submitting signal\" */);\n\t\treturn this._containerRuntime.submitDataStoreSignal(this.id, type, content);\n\t}\n\n\t/**\n\t * This is called by the data store channel when it becomes locally visible indicating that it is ready to become\n\t * globally visible now.\n\t */\n\tpublic makeLocallyVisible() {\n\t\tassert(this.channel !== undefined, 0x2cf /* \"undefined channel on datastore context\" */);\n\t\tthis.makeLocallyVisibleFn();\n\t}\n\n\tprotected bindRuntime(channel: IFluidDataStoreChannel) {\n\t\tif (this.channel) {\n\t\t\tthrow new Error(\"Runtime already bound\");\n\t\t}\n\n\t\ttry {\n\t\t\tassert(\n\t\t\t\t!this.detachedRuntimeCreation,\n\t\t\t\t0x148 /* \"Detached runtime creation on runtime bind\" */,\n\t\t\t);\n\t\t\tassert(this.channelDeferred !== undefined, 0x149 /* \"Undefined channel deferral\" */);\n\t\t\tassert(this.pkg !== undefined, 0x14a /* \"Undefined package path\" */);\n\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst pending = this.pending!;\n\n\t\t\t// Apply all pending ops\n\t\t\tfor (const op of pending) {\n\t\t\t\tchannel.process(op, false, undefined /* localOpMetadata */);\n\t\t\t}\n\n\t\t\tthis.thresholdOpsCounter.send(\"ProcessPendingOps\", pending.length);\n\t\t\tthis.pending = undefined;\n\n\t\t\t// And now mark the runtime active\n\t\t\tthis.loaded = true;\n\t\t\tthis.channel = channel;\n\n\t\t\t// Freeze the package path to ensure that someone doesn't modify it when it is\n\t\t\t// returned in packagePath().\n\t\t\tObject.freeze(this.pkg);\n\n\t\t\t/**\n\t\t\t * Update the used routes of the channel. If GC has run before this data store was realized, we will have\n\t\t\t * the used routes saved. So, this will ensure that all the child contexts have up-to-date used routes as\n\t\t\t * per the last time GC was run.\n\t\t\t * Also, this data store may have been realized during summarize. In that case, the child contexts need to\n\t\t\t * have their used routes updated to determine if its needs to summarize again and to add it to the summary.\n\t\t\t */\n\t\t\tthis.updateChannelUsedRoutes();\n\n\t\t\t// And notify the pending promise it is now available\n\t\t\tthis.channelDeferred.resolve(this.channel);\n\t\t} catch (error) {\n\t\t\tthis.channelDeferred?.reject(error);\n\t\t\tthis.logger.sendErrorEvent(\n\t\t\t\t{\n\t\t\t\t\teventName: \"BindRuntimeError\",\n\t\t\t\t\tfluidDataStoreId: {\n\t\t\t\t\t\tvalue: this.id,\n\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\terror,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic async getAbsoluteUrl(relativeUrl: string): Promise<string | undefined> {\n\t\tif (this.attachState !== AttachState.Attached) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this._containerRuntime.getAbsoluteUrl(relativeUrl);\n\t}\n\n\tpublic abstract generateAttachMessage(): IAttachMessage;\n\n\tpublic abstract getInitialSnapshotDetails(): Promise<ISnapshotDetails>;\n\n\t/**\n\t * @deprecated Sets the datastore as root, for aliasing purposes: #7948\n\t * This method should not be used outside of the aliasing context.\n\t * It will be removed, as the source of truth for this flag will be the aliasing blob.\n\t */\n\tpublic setInMemoryRoot(): void {\n\t\tthis._isInMemoryRoot = true;\n\t}\n\n\tpublic abstract getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n\n\tpublic reSubmit(contents: any, localOpMetadata: unknown) {\n\t\tassert(!!this.channel, 0x14b /* \"Channel must exist when resubmitting ops\" */);\n\t\tconst innerContents = contents as FluidDataStoreMessage;\n\t\tthis.channel.reSubmit(innerContents.type, innerContents.content, localOpMetadata);\n\t}\n\n\tpublic rollback(contents: any, localOpMetadata: unknown) {\n\t\tif (!this.channel) {\n\t\t\tthrow new Error(\"Channel must exist when rolling back ops\");\n\t\t}\n\t\tif (!this.channel.rollback) {\n\t\t\tthrow new Error(\"Channel doesn't support rollback\");\n\t\t}\n\t\tconst innerContents = contents as FluidDataStoreMessage;\n\t\tthis.channel.rollback(innerContents.type, innerContents.content, localOpMetadata);\n\t}\n\n\tpublic async applyStashedOp(contents: any): Promise<unknown> {\n\t\tif (!this.channel) {\n\t\t\tawait this.realize();\n\t\t}\n\t\tassert(!!this.channel, 0x14c /* \"Channel must exist when rebasing ops\" */);\n\t\tconst innerContents = contents as FluidDataStoreMessage;\n\t\treturn this.channel.applyStashedOp(innerContents.content);\n\t}\n\n\tprivate verifyNotClosed(\n\t\tcallSite: string,\n\t\tcheckTombstone = true,\n\t\tsafeTelemetryProps: ITelemetryProperties = {},\n\t) {\n\t\tif (this.deleted) {\n\t\t\tconst messageString = `Context is deleted! Call site [${callSite}]`;\n\t\t\tconst error = new DataCorruptionError(messageString, safeTelemetryProps);\n\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t{\n\t\t\t\t\teventName: \"GC_Deleted_DataStore_Changed\",\n\t\t\t\t\tcallSite,\n\t\t\t\t},\n\t\t\t\terror,\n\t\t\t);\n\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (this._disposed) {\n\t\t\tthrow new Error(`Context is closed! Call site [${callSite}]`);\n\t\t}\n\n\t\tif (checkTombstone && this.tombstoned) {\n\t\t\tconst messageString = `Context is tombstoned! Call site [${callSite}]`;\n\t\t\tconst error = new DataCorruptionError(messageString, safeTelemetryProps);\n\n\t\t\tsendGCUnexpectedUsageEvent(\n\t\t\t\tthis.mc,\n\t\t\t\t{\n\t\t\t\t\teventName: \"GC_Tombstone_DataStore_Changed\",\n\t\t\t\t\tcategory: this.throwOnTombstoneUsage ? \"error\" : \"generic\",\n\t\t\t\t\tgcTombstoneEnforcementAllowed:\n\t\t\t\t\t\tthis._containerRuntime.gcTombstoneEnforcementAllowed,\n\t\t\t\t\tcallSite,\n\t\t\t\t},\n\t\t\t\tthis.pkg,\n\t\t\t\terror,\n\t\t\t);\n\t\t\tif (this.throwOnTombstoneUsage) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic getCreateChildSummarizerNodeFn(id: string, createParam: CreateChildSummarizerNodeParam) {\n\t\treturn (\n\t\t\tsummarizeInternal: SummarizeInternalFn,\n\t\t\tgetGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t\t\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n\t\t) =>\n\t\t\tthis.summarizerNode.createChild(\n\t\t\t\tsummarizeInternal,\n\t\t\t\tid,\n\t\t\t\tcreateParam,\n\t\t\t\t// DDS will not create failure summaries\n\t\t\t\t{ throwOnFailure: true },\n\t\t\t\tgetGCDataFn,\n\t\t\t\tgetBaseGCDetailsFn,\n\t\t\t);\n\t}\n\n\tpublic async uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n\t\treturn this.containerRuntime.uploadBlob(blob);\n\t}\n}\n\nexport class RemoteFluidDataStoreContext extends FluidDataStoreContext {\n\tprivate readonly initSnapshotValue: ISnapshotTree | undefined;\n\tprivate readonly baseGCDetailsP: Promise<IGarbageCollectionDetailsBase>;\n\n\tconstructor(props: IRemoteFluidDataStoreContextProps) {\n\t\tsuper(props, true /* existing */, BindState.Bound, false /* isLocalDataStore */, () => {\n\t\t\tthrow new Error(\"Already attached\");\n\t\t});\n\n\t\tthis.initSnapshotValue = props.snapshotTree;\n\t\tthis.baseGCDetailsP = new LazyPromise<IGarbageCollectionDetailsBase>(async () => {\n\t\t\treturn (await props.getBaseGCDetails()) ?? {};\n\t\t});\n\n\t\tif (props.snapshotTree !== undefined) {\n\t\t\tthis.summarizerNode.updateBaseSummaryState(props.snapshotTree);\n\t\t}\n\t}\n\n\tprivate readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {\n\t\tlet tree = this.initSnapshotValue;\n\t\tlet isRootDataStore = true;\n\n\t\tif (!!tree && tree.blobs[dataStoreAttributesBlobName] !== undefined) {\n\t\t\t// Need to get through snapshot and use that to populate extraBlobs\n\t\t\tconst attributes = await readAndParse<ReadFluidDataStoreAttributes>(\n\t\t\t\tthis.storage,\n\t\t\t\ttree.blobs[dataStoreAttributesBlobName],\n\t\t\t);\n\n\t\t\tlet pkgFromSnapshot: string[];\n\t\t\t// Use the snapshotFormatVersion to determine how the pkg is encoded in the snapshot.\n\t\t\t// For snapshotFormatVersion = \"0.1\" (1) or above, pkg is jsonified, otherwise it is just a string.\n\t\t\tconst formatVersion = getAttributesFormatVersion(attributes);\n\t\t\tif (formatVersion < 1) {\n\t\t\t\tpkgFromSnapshot =\n\t\t\t\t\tattributes.pkg.startsWith('[\"') && attributes.pkg.endsWith('\"]')\n\t\t\t\t\t\t? (JSON.parse(attributes.pkg) as string[])\n\t\t\t\t\t\t: [attributes.pkg];\n\t\t\t} else {\n\t\t\t\tpkgFromSnapshot = JSON.parse(attributes.pkg) as string[];\n\t\t\t}\n\t\t\tthis.pkg = pkgFromSnapshot;\n\n\t\t\t/**\n\t\t\t * If there is no isRootDataStore in the attributes blob, set it to true. This will ensure that\n\t\t\t * data stores in older documents are not garbage collected incorrectly. This may lead to additional\n\t\t\t * roots in the document but they won't break.\n\t\t\t */\n\t\t\tisRootDataStore = attributes.isRootDataStore ?? true;\n\n\t\t\tif (hasIsolatedChannels(attributes)) {\n\t\t\t\ttree = tree.trees[channelsTreeName];\n\t\t\t\tassert(\n\t\t\t\t\ttree !== undefined,\n\t\t\t\t\t0x1fe /* \"isolated channels subtree should exist in remote datastore snapshot\" */,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tpkg: this.pkg!,\n\t\t\tisRootDataStore,\n\t\t\tsnapshot: tree,\n\t\t};\n\t});\n\n\tpublic async getInitialSnapshotDetails(): Promise<ISnapshotDetails> {\n\t\treturn this.initialSnapshotDetailsP;\n\t}\n\n\tpublic async getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase> {\n\t\treturn this.baseGCDetailsP;\n\t}\n\n\tpublic generateAttachMessage(): IAttachMessage {\n\t\tthrow new Error(\"Cannot attach remote store\");\n\t}\n}\n\n/**\n * Base class for detached & attached context classes\n */\nexport class LocalFluidDataStoreContextBase extends FluidDataStoreContext {\n\tprivate readonly snapshotTree: ISnapshotTree | undefined;\n\t/**\n\t * @deprecated 0.16 Issue #1635, #3631\n\t */\n\tpublic readonly createProps?: any;\n\n\tconstructor(props: ILocalFluidDataStoreContextProps) {\n\t\tsuper(\n\t\t\tprops,\n\t\t\tprops.snapshotTree !== undefined ? true : false /* existing */,\n\t\t\tprops.snapshotTree ? BindState.Bound : BindState.NotBound,\n\t\t\ttrue /* isLocalDataStore */,\n\t\t\tprops.makeLocallyVisibleFn,\n\t\t);\n\n\t\tthis.snapshotTree = props.snapshotTree;\n\t\tif (props.isRootDataStore === true) {\n\t\t\tthis.setInMemoryRoot();\n\t\t}\n\t\tthis.createProps = props.createProps;\n\t\tthis.attachListeners();\n\t}\n\n\tprivate attachListeners(): void {\n\t\tthis.once(\"attaching\", () => {\n\t\t\tassert(\n\t\t\t\tthis.attachState === AttachState.Detached,\n\t\t\t\t0x14d /* \"Should move from detached to attaching\" */,\n\t\t\t);\n\t\t\tthis._attachState = AttachState.Attaching;\n\t\t});\n\t\tthis.once(\"attached\", () => {\n\t\t\tassert(\n\t\t\t\tthis.attachState === AttachState.Attaching,\n\t\t\t\t0x14e /* \"Should move from attaching to attached\" */,\n\t\t\t);\n\t\t\tthis._attachState = AttachState.Attached;\n\t\t});\n\t}\n\n\tpublic generateAttachMessage(): IAttachMessage {\n\t\tassert(\n\t\t\tthis.channel !== undefined,\n\t\t\t0x14f /* \"There should be a channel when generating attach message\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.pkg !== undefined,\n\t\t\t0x150 /* \"pkg should be available in local data store context\" */,\n\t\t);\n\n\t\tconst summarizeResult = this.channel.getAttachSummary();\n\n\t\t// Wrap dds summaries in .channels subtree.\n\t\twrapSummaryInChannelsTree(summarizeResult);\n\n\t\t// Add data store's attributes to the summary.\n\t\tconst attributes = createAttributes(this.pkg, this.isInMemoryRoot());\n\t\taddBlobToSummary(summarizeResult, dataStoreAttributesBlobName, JSON.stringify(attributes));\n\n\t\t// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.\n\t\tconst snapshot = convertSummaryTreeToITree(summarizeResult.summary);\n\n\t\tconst message: IAttachMessage = {\n\t\t\tid: this.id,\n\t\t\tsnapshot,\n\t\t\ttype: this.pkg[this.pkg.length - 1],\n\t\t};\n\n\t\treturn message;\n\t}\n\n\tpublic async getInitialSnapshotDetails(): Promise<ISnapshotDetails> {\n\t\tlet snapshot = this.snapshotTree;\n\t\tlet attributes: ReadFluidDataStoreAttributes;\n\t\tlet isRootDataStore = false;\n\t\tif (snapshot !== undefined) {\n\t\t\t// Get the dataStore attributes.\n\t\t\t// Note: storage can be undefined in special case while detached.\n\t\t\tattributes = await getFluidDataStoreAttributes(this.storage, snapshot);\n\t\t\tif (hasIsolatedChannels(attributes)) {\n\t\t\t\tsnapshot = snapshot.trees[channelsTreeName];\n\t\t\t\tassert(\n\t\t\t\t\tsnapshot !== undefined,\n\t\t\t\t\t0x1ff /* \"isolated channels subtree should exist in local datastore snapshot\" */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.pkg === undefined) {\n\t\t\t\tthis.pkg = JSON.parse(attributes.pkg) as string[];\n\t\t\t\t// If there is no isRootDataStore in the attributes blob, set it to true. This ensures that data\n\t\t\t\t// stores in older documents are not garbage collected incorrectly. This may lead to additional\n\t\t\t\t// roots in the document but they won't break.\n\t\t\t\tif (attributes.isRootDataStore ?? true) {\n\t\t\t\t\tisRootDataStore = true;\n\t\t\t\t\tthis.setInMemoryRoot();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tassert(this.pkg !== undefined, 0x152 /* \"pkg should be available in local data store\" */);\n\n\t\treturn {\n\t\t\tpkg: this.pkg,\n\t\t\tisRootDataStore,\n\t\t\tsnapshot,\n\t\t};\n\t}\n\n\tpublic async getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase> {\n\t\t// Local data store does not have initial summary.\n\t\treturn {};\n\t}\n\n\t/**\n\t * A context should only be marked as deleted when its a remote context.\n\t * Session Expiry at the runtime level should have closed the container creating the local data store context\n\t * before delete is even possible. Session Expiry is at 30 days, and sweep is done 36+ days later from the time\n\t * it was unreferenced. Thus the sweeping container should have loaded from a snapshot and thus creating a remote\n\t * context.\n\t */\n\tpublic delete() {\n\t\t// TODO: GC:Validation - potentially prevent this from happening or asserting. Maybe throw here.\n\t\tsendGCUnexpectedUsageEvent(\n\t\t\tthis.mc,\n\t\t\t{\n\t\t\t\teventName: \"GC_Deleted_DataStore_Unexpected_Delete\",\n\t\t\t\tmessage: \"Unexpected deletion of a local data store context\",\n\t\t\t\tcategory: \"error\",\n\t\t\t\tgcTombstoneEnforcementAllowed: undefined,\n\t\t\t},\n\t\t\tthis.pkg,\n\t\t);\n\t\tsuper.delete();\n\t}\n}\n\n/**\n * context implementation for \"attached\" data store runtime.\n * Various workflows (snapshot creation, requests) result in .realize() being called\n * on context, resulting in instantiation and attachment of runtime.\n * Runtime is created using data store factory that is associated with this context.\n */\nexport class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {\n\tconstructor(props: ILocalFluidDataStoreContextProps) {\n\t\tsuper(props);\n\t}\n}\n\n/**\n * Detached context. Data Store runtime will be attached to it by attachRuntime() call\n * Before attachment happens, this context is not associated with particular type of runtime\n * or factory, i.e. it's package path is undefined.\n * Attachment process provides all missing parts - package path, data store runtime, and data store factory\n */\nexport class LocalDetachedFluidDataStoreContext\n\textends LocalFluidDataStoreContextBase\n\timplements IFluidDataStoreContextDetached\n{\n\tconstructor(props: ILocalFluidDataStoreContextProps) {\n\t\tsuper(props);\n\t\tthis.detachedRuntimeCreation = true;\n\t}\n\n\tpublic async attachRuntime(\n\t\tregistry: IProvideFluidDataStoreFactory,\n\t\tdataStoreChannel: IFluidDataStoreChannel,\n\t) {\n\t\tassert(this.detachedRuntimeCreation, 0x154 /* \"runtime creation is already attached\" */);\n\t\tthis.detachedRuntimeCreation = false;\n\n\t\tassert(this.channelDeferred === undefined, 0x155 /* \"channel deferral is already set\" */);\n\t\tthis.channelDeferred = new Deferred<IFluidDataStoreChannel>();\n\n\t\tconst factory = registry.IFluidDataStoreFactory;\n\n\t\tconst entry = await this.factoryFromPackagePath(this.pkg);\n\t\tassert(entry.factory === factory, 0x156 /* \"Unexpected factory for package path\" */);\n\n\t\tassert(this.registry === undefined, 0x157 /* \"datastore registry already attached\" */);\n\t\tthis.registry = entry.registry;\n\n\t\tsuper.bindRuntime(dataStoreChannel);\n\n\t\t// Load the handle to the data store's entryPoint to make sure that for a detached data store, the entryPoint\n\t\t// initialization function is called before the data store gets attached and potentially connected to the\n\t\t// delta stream, so it gets a chance to do things while the data store is still \"purely local\".\n\t\t// This preserves the behavior from before we introduced entryPoints, where the instantiateDataStore method\n\t\t// of data store factories tends to construct the data object (at least kick off an async method that returns\n\t\t// it); that code moved to the entryPoint initialization function, so we want to ensure it still executes\n\t\t// before the data store is attached.\n\t\tawait dataStoreChannel.entryPoint?.get();\n\n\t\tif (await this.isRoot()) {\n\t\t\tdataStoreChannel.makeVisibleAndAttachGraph();\n\t\t}\n\t}\n\n\tpublic async getInitialSnapshotDetails(): Promise<ISnapshotDetails> {\n\t\tif (this.detachedRuntimeCreation) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Detached Fluid Data Store context can't be realized! Please attach runtime first!\",\n\t\t\t);\n\t\t}\n\t\treturn super.getInitialSnapshotDetails();\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dataStoreContext.js","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,iFAK+C;AAC/C,+DAAgG;AAEhG,+DAA4D;AAC5D,iEAA8D;AAU9D,6EAqB6C;AAC7C,iEAIuC;AACvC,qEAQyC;AACzC,qEAIyC;AAEzC,uCASmB;AAEnB,6BAA4E;AAE5E,SAAS,gBAAgB,CACxB,GAAsB,EACtB,eAAwB;IAExB,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC3C,OAAO;QACN,GAAG,EAAE,cAAc;QACnB,oBAAoB,EAAE,CAAC;QACvB,eAAe;KACf,CAAC;AACH,CAAC;AACD,SAAgB,oBAAoB,CAAC,GAAsB,EAAE,eAAwB;IACpF,MAAM,UAAU,GAAG,gBAAgB,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAC1D,OAAO,IAAI,6BAAa,CAAC,qCAA2B,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;AACnF,CAAC;AAHD,oDAGC;AAwCD;;GAEG;AACH,MAAsB,qBACrB,SAAQ,gCAA+C;IAoIvD,YACC,KAAkC,EACjB,QAAiB,EAClB,gBAAyB,EACxB,oBAAgC;;QAEjD,KAAK,EAAE,CAAC;QAJS,aAAQ,GAAR,QAAQ,CAAS;QAClB,qBAAgB,GAAhB,gBAAgB,CAAS;QACxB,yBAAoB,GAApB,oBAAoB,CAAY;QApF1C,cAAS,GAAG,KAAK,CAAC;QAK1B;;;WAGG;QACK,gBAAW,GAAG,KAAK,CAAC;QAO5B,2GAA2G;QACnG,YAAO,GAAY,KAAK,CAAC;QAiCvB,4BAAuB,GAAG,KAAK,CAAC;QAElC,WAAM,GAAG,KAAK,CAAC;QACb,YAAO,GAA4C,EAAE,CAAC;QAIxD,oBAAe,GAAY,KA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,uBAAQ,EAA0B,CAAC;QAE9D,MAAM,OAAO,GAAG,QAAQ,CAAC,sBAAsB,CAAC;QAEhD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1D,IAAA,qBAAM,EAAC,KAAK,CAAC,OAAO,KAAK,OAAO,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAErF,IAAA,qBAAM,EAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;QACvF,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAE/B,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAEpC,6GAA6G;QAC7G,yGAAyG;QACzG,+FAA+F;QAC/F,2GAA2G;QAC3G,6GAA6G;QAC7G,yGAAyG;QACzG,qCAAqC;QACrC,MAAM,CAAA,MAAA,gBAAgB,CAAC,UAAU,0CAAE,GAAG,EAAE,CAAA,CAAC;QAEzC,IAAI,MAAM,IAAI,CAAC,MAAM,EAAE,EAAE;YACxB,gBAAgB,CAAC,yBAAyB,EAAE,CAAC;SAC7C;IACF,CAAC;IAEM,KAAK,CAAC,yBAAyB;QACrC,IAAI,IAAI,CAAC,uBAAuB,EAAE;YACjC,MAAM,IAAI,KAAK,CACd,mFAAmF,CACnF,CAAC;SACF;QACD,OAAO,KAAK,CAAC,yBAAyB,EAAE,CAAC;IAC1C,CAAC;CACD;AAnDD,gFAmDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDisposable,\n\tITelemetryLogger,\n\tITelemetryProperties,\n} from \"@fluidframework/common-definitions\";\nimport { FluidObject, IRequest, IResponse, IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n\tIAudience,\n\tIDeltaManager,\n\tAttachState,\n\tILoaderOptions,\n} from \"@fluidframework/container-definitions\";\nimport { assert, Deferred, LazyPromise, TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport { BlobTreeEntry } from \"@fluidframework/protocol-base\";\nimport {\n\tIClientDetails,\n\tIDocumentMessage,\n\tIQuorumClients,\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n\tITreeEntry,\n} from \"@fluidframework/protocol-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport {\n\tchannelsTreeName,\n\tCreateChildSummarizerNodeFn,\n\tCreateChildSummarizerNodeParam,\n\tFluidDataStoreRegistryEntry,\n\tIAttachMessage,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreContextDetached,\n\tIFluidDataStoreContextEvents,\n\tIFluidDataStoreRegistry,\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n\tIInboundSignalMessage,\n\tIProvideFluidDataStoreFactory,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNodeWithGC,\n\tSummarizeInternalFn,\n\tITelemetryContext,\n\tVisibilityState,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\taddBlobToSummary,\n\tconvertSummaryTreeToITree,\n\tpackagePathToTelemetryProperty,\n} from \"@fluidframework/runtime-utils\";\nimport {\n\tChildLogger,\n\tgenerateStack,\n\tloggerToMonitoringContext,\n\tLoggingError,\n\tMonitoringContext,\n\tTelemetryDataTag,\n\tThresholdCounter,\n} from \"@fluidframework/telemetry-utils\";\nimport {\n\tDataCorruptionError,\n\tDataProcessingError,\n\textractSafePropertiesFromMessage,\n} from \"@fluidframework/container-utils\";\n\nimport {\n\tdataStoreAttributesBlobName,\n\thasIsolatedChannels,\n\twrapSummaryInChannelsTree,\n\tReadFluidDataStoreAttributes,\n\tWriteFluidDataStoreAttributes,\n\tgetAttributesFormatVersion,\n\tgetFluidDataStoreAttributes,\n\tsummarizerClientType,\n} from \"./summary\";\nimport { ContainerRuntime } from \"./containerRuntime\";\nimport { sendGCUnexpectedUsageEvent, throwOnTombstoneUsageKey } from \"./gc\";\n\nfunction createAttributes(\n\tpkg: readonly string[],\n\tisRootDataStore: boolean,\n): WriteFluidDataStoreAttributes {\n\tconst stringifiedPkg = JSON.stringify(pkg);\n\treturn {\n\t\tpkg: stringifiedPkg,\n\t\tsummaryFormatVersion: 2,\n\t\tisRootDataStore,\n\t};\n}\nexport function createAttributesBlob(pkg: readonly string[], isRootDataStore: boolean): ITreeEntry {\n\tconst attributes = createAttributes(pkg, isRootDataStore);\n\treturn new BlobTreeEntry(dataStoreAttributesBlobName, JSON.stringify(attributes));\n}\n\ninterface ISnapshotDetails {\n\tpkg: readonly string[];\n\tisRootDataStore: boolean;\n\tsnapshot?: ISnapshotTree;\n}\n\ninterface FluidDataStoreMessage {\n\tcontent: any;\n\ttype: string;\n}\n\n/** Properties necessary for creating a FluidDataStoreContext */\nexport interface IFluidDataStoreContextProps {\n\treadonly id: string;\n\treadonly runtime: ContainerRuntime;\n\treadonly storage: IDocumentStorageService;\n\treadonly scope: FluidObject;\n\treadonly createSummarizerNodeFn: CreateChildSummarizerNodeFn;\n\treadonly pkg?: Readonly<string[]>;\n}\n\n/** Properties necessary for creating a local FluidDataStoreContext */\nexport interface ILocalFluidDataStoreContextProps extends IFluidDataStoreContextProps {\n\treadonly pkg: Readonly<string[]> | undefined;\n\treadonly snapshotTree: ISnapshotTree | undefined;\n\treadonly isRootDataStore: boolean | undefined;\n\treadonly makeLocallyVisibleFn: () => void;\n\t/**\n\t * @deprecated 0.16 Issue #1635, #3631\n\t */\n\treadonly createProps?: any;\n}\n\n/** Properties necessary for creating a remote FluidDataStoreContext */\nexport interface IRemoteFluidDataStoreContextProps extends IFluidDataStoreContextProps {\n\treadonly snapshotTree: ISnapshotTree | undefined;\n}\n\n/**\n * Represents the context for the store. This context is passed to the store runtime.\n */\nexport abstract class FluidDataStoreContext\n\textends TypedEventEmitter<IFluidDataStoreContextEvents>\n\timplements IFluidDataStoreContext, IDisposable\n{\n\tpublic get packagePath(): readonly string[] {\n\t\tassert(this.pkg !== undefined, 0x139 /* \"Undefined package path\" */);\n\t\treturn this.pkg;\n\t}\n\n\tpublic get options(): ILoaderOptions {\n\t\treturn this._containerRuntime.options;\n\t}\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this._containerRuntime.clientId;\n\t}\n\n\tpublic get clientDetails(): IClientDetails {\n\t\treturn this._containerRuntime.clientDetails;\n\t}\n\n\tpublic get logger(): ITelemetryLogger {\n\t\treturn this._containerRuntime.logger;\n\t}\n\n\tpublic get deltaManager(): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {\n\t\treturn this._containerRuntime.deltaManager;\n\t}\n\n\tpublic get connected(): boolean {\n\t\treturn this._containerRuntime.connected;\n\t}\n\n\tpublic get IFluidHandleContext() {\n\t\treturn this._containerRuntime.IFluidHandleContext;\n\t}\n\n\tpublic get containerRuntime(): IContainerRuntime {\n\t\treturn this._containerRuntime;\n\t}\n\n\tpublic ensureNoDataModelChanges<T>(callback: () => T): T {\n\t\treturn this._containerRuntime.ensureNoDataModelChanges(callback);\n\t}\n\n\tpublic get isLoaded(): boolean {\n\t\treturn this.loaded;\n\t}\n\n\tpublic get baseSnapshot(): ISnapshotTree | undefined {\n\t\treturn this._baseSnapshot;\n\t}\n\n\tprivate _disposed = false;\n\tpublic get disposed() {\n\t\treturn this._disposed;\n\t}\n\n\t/**\n\t * Tombstone is a temporary feature that prevents a data store from sending / receiving ops, signals and from\n\t * loading.\n\t */\n\tprivate _tombstoned = false;\n\tpublic get tombstoned() {\n\t\treturn this._tombstoned;\n\t}\n\t/** If true, throw an error when a tombstone data store is used. */\n\tprivate readonly throwOnTombstoneUsage: boolean;\n\n\t/** If true, this means that this data store context and its children have been removed from the runtime */\n\tprivate deleted: boolean = false;\n\n\tpublic get attachState(): AttachState {\n\t\treturn this._attachState;\n\t}\n\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry | undefined {\n\t\treturn this.registry;\n\t}\n\n\t/**\n\t * A datastore is considered as root if it\n\t * 1. is root in memory - see isInMemoryRoot\n\t * 2. is root as part of the base snapshot that the datastore loaded from\n\t * @returns whether a datastore is root\n\t */\n\tpublic async isRoot(): Promise<boolean> {\n\t\treturn this.isInMemoryRoot() || (await this.getInitialSnapshotDetails()).isRootDataStore;\n\t}\n\n\t/**\n\t * There are 3 states where isInMemoryRoot needs to be true\n\t * 1. when a datastore becomes aliased. This can happen for both remote and local datastores\n\t * 2. when a datastore is created locally as root\n\t * 3. when a datastore is created locally as root and is rehydrated\n\t * @returns whether a datastore is root in memory\n\t */\n\tprotected isInMemoryRoot(): boolean {\n\t\treturn this._isInMemoryRoot;\n\t}\n\n\tprotected registry: IFluidDataStoreRegistry | undefined;\n\n\tprotected detachedRuntimeCreation = false;\n\tprotected channel: IFluidDataStoreChannel | undefined;\n\tprivate loaded = false;\n\tprotected pending: ISequencedDocumentMessage[] | undefined = [];\n\tprotected channelDeferred: Deferred<IFluidDataStoreChannel> | undefined;\n\tprivate _baseSnapshot: ISnapshotTree | undefined;\n\tprotected _attachState: AttachState;\n\tprivate _isInMemoryRoot: boolean = false;\n\tprotected readonly summarizerNode: ISummarizerNodeWithGC;\n\tprotected readonly mc: MonitoringContext;\n\tprivate readonly thresholdOpsCounter: ThresholdCounter;\n\tprivate static readonly pendingOpsCountThreshold = 1000;\n\n\t/**\n\t * If the summarizer makes local changes, a telemetry event is logged. This has the potential to be very noisy.\n\t * So, adding a count of how many telemetry events are logged per data store context. This can be\n\t * controlled via feature flags.\n\t */\n\tprivate localChangesTelemetryCount: number;\n\n\t// The used routes of this node as per the last GC run. This is used to update the used routes of the channel\n\t// if it realizes after GC is run.\n\tprivate lastUsedRoutes: string[] | undefined;\n\n\tpublic readonly id: string;\n\tprivate readonly _containerRuntime: ContainerRuntime;\n\tpublic readonly storage: IDocumentStorageService;\n\tpublic readonly scope: FluidObject;\n\tprotected pkg?: readonly string[];\n\n\tconstructor(\n\t\tprops: IFluidDataStoreContextProps,\n\t\tprivate readonly existing: boolean,\n\t\tpublic readonly isLocalDataStore: boolean,\n\t\tprivate readonly makeLocallyVisibleFn: () => void,\n\t) {\n\t\tsuper();\n\n\t\tthis._containerRuntime = props.runtime;\n\t\tthis.id = props.id;\n\t\tthis.storage = props.storage;\n\t\tthis.scope = props.scope;\n\t\tthis.pkg = props.pkg;\n\n\t\t// URIs use slashes as delimiters. Handles use URIs.\n\t\t// Thus having slashes in types almost guarantees trouble down the road!\n\t\tassert(!this.id.includes(\"/\"), 0x13a /* Data store ID contains slash */);\n\n\t\tthis._attachState =\n\t\t\tthis.containerRuntime.attachState !== AttachState.Detached && this.existing\n\t\t\t\t? this.containerRuntime.attachState\n\t\t\t\t: AttachState.Detached;\n\n\t\tconst thisSummarizeInternal = async (\n\t\t\tfullTree: boolean,\n\t\t\ttrackState: boolean,\n\t\t\ttelemetryContext?: ITelemetryContext,\n\t\t) => this.summarizeInternal(fullTree, trackState, telemetryContext);\n\n\t\tthis.summarizerNode = props.createSummarizerNodeFn(\n\t\t\tthisSummarizeInternal,\n\t\t\tasync (fullGC?: boolean) => this.getGCDataInternal(fullGC),\n\t\t);\n\n\t\tthis.mc = loggerToMonitoringContext(\n\t\t\tChildLogger.create(this.logger, \"FluidDataStoreContext\"),\n\t\t);\n\t\tthis.thresholdOpsCounter = new ThresholdCounter(\n\t\t\tFluidDataStoreContext.pendingOpsCountThreshold,\n\t\t\tthis.mc.logger,\n\t\t);\n\n\t\t// Tombstone should only throw when the feature flag is enabled and the client isn't a summarizer\n\t\tthis.throwOnTombstoneUsage =\n\t\t\tthis.mc.config.getBoolean(throwOnTombstoneUsageKey) === true &&\n\t\t\tthis._containerRuntime.gcTombstoneEnforcementAllowed &&\n\t\t\tthis.clientDetails.type !== summarizerClientType;\n\n\t\t// By default, a data store can log maximum 10 local changes telemetry in summarizer.\n\t\tthis.localChangesTelemetryCount =\n\t\t\tthis.mc.config.getNumber(\"Fluid.Telemetry.LocalChangesTelemetryCount\") ?? 10;\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis._disposed = true;\n\n\t\t// Dispose any pending runtime after it gets fulfilled\n\t\t// Errors are logged where this.channelDeferred is consumed/generated (realizeCore(), bindRuntime())\n\t\tif (this.channelDeferred) {\n\t\t\tthis.channelDeferred.promise\n\t\t\t\t.then((runtime) => {\n\t\t\t\t\truntime.dispose();\n\t\t\t\t})\n\t\t\t\t.catch((error) => {});\n\t\t}\n\t}\n\n\t/**\n\t * When delete is called, that means that the data store is permanently removed from the runtime, and will not show up in future summaries\n\t * This function is called to prevent ops from being generated from this data store once it has been deleted. Furthermore, this data store\n\t * should not receive any ops/signals.\n\t */\n\tpublic delete() {\n\t\tthis.deleted = true;\n\t}\n\n\tpublic setTombstone(tombstone: boolean) {\n\t\tif (this.tombstoned === tombstone) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._tombstoned = tombstone;\n\t}\n\n\tprivate rejectDeferredRealize(\n\t\treason: string,\n\t\tfailedPkgPath?: string,\n\t\tfullPackageName?: readonly string[],\n\t): never {\n\t\tthrow new LoggingError(reason, {\n\t\t\tfailedPkgPath: { value: failedPkgPath, tag: TelemetryDataTag.CodeArtifact },\n\t\t\tfullPackageName: packagePathToTelemetryProperty(fullPackageName),\n\t\t});\n\t}\n\n\tpublic async realize(): Promise<IFluidDataStoreChannel> {\n\t\tassert(!this.detachedRuntimeCreation, 0x13d /* \"Detached runtime creation on realize()\" */);\n\t\tif (!this.channelDeferred) {\n\t\t\tthis.channelDeferred = new Deferred<IFluidDataStoreChannel>();\n\t\t\tthis.realizeCore(this.existing).catch((error) => {\n\t\t\t\tconst errorWrapped = DataProcessingError.wrapIfUnrecognized(\n\t\t\t\t\terror,\n\t\t\t\t\t\"realizeFluidDataStoreContext\",\n\t\t\t\t);\n\t\t\t\terrorWrapped.addTelemetryProperties({\n\t\t\t\t\tfluidDataStoreId: {\n\t\t\t\t\t\tvalue: this.id,\n\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\t},\n\t\t\t\t\tpackageName: packagePathToTelemetryProperty(this.pkg),\n\t\t\t\t});\n\t\t\t\tthis.channelDeferred?.reject(errorWrapped);\n\t\t\t\tthis.logger.sendErrorEvent({ eventName: \"RealizeError\" }, errorWrapped);\n\t\t\t});\n\t\t}\n\t\treturn this.channelDeferred.promise;\n\t}\n\n\tprotected async factoryFromPackagePath(packages?: readonly string[]) {\n\t\tassert(this.pkg === packages, 0x13e /* \"Unexpected package path\" */);\n\t\tif (packages === undefined) {\n\t\t\tthis.rejectDeferredRealize(\"packages is undefined\");\n\t\t}\n\n\t\tlet entry: FluidDataStoreRegistryEntry | undefined;\n\t\tlet registry: IFluidDataStoreRegistry | undefined =\n\t\t\tthis._containerRuntime.IFluidDataStoreRegistry;\n\t\tlet lastPkg: string | undefined;\n\t\tfor (const pkg of packages) {\n\t\t\tif (!registry) {\n\t\t\t\tthis.rejectDeferredRealize(\"No registry for package\", lastPkg, packages);\n\t\t\t}\n\t\t\tlastPkg = pkg;\n\t\t\tentry = await registry.get(pkg);\n\t\t\tif (!entry) {\n\t\t\t\tthis.rejectDeferredRealize(\n\t\t\t\t\t\"Registry does not contain entry for the package\",\n\t\t\t\t\tpkg,\n\t\t\t\t\tpackages,\n\t\t\t\t);\n\t\t\t}\n\t\t\tregistry = entry.IFluidDataStoreRegistry;\n\t\t}\n\t\tconst factory = entry?.IFluidDataStoreFactory;\n\t\tif (factory === undefined) {\n\t\t\tthis.rejectDeferredRealize(\"Can't find factory for package\", lastPkg, packages);\n\t\t}\n\n\t\treturn { factory, registry };\n\t}\n\n\tprivate async realizeCore(existing: boolean): Promise<void> {\n\t\tconst details = await this.getInitialSnapshotDetails();\n\t\t// Base snapshot is the baseline where pending ops are applied to.\n\t\t// It is important that this be in sync with the pending ops, and also\n\t\t// that it is set here, before bindRuntime is called.\n\t\tthis._baseSnapshot = details.snapshot;\n\t\tconst packages = details.pkg;\n\n\t\tconst { factory, registry } = await this.factoryFromPackagePath(packages);\n\n\t\tassert(\n\t\t\tthis.registry === undefined,\n\t\t\t0x13f /* \"datastore context registry is already set\" */,\n\t\t);\n\t\tthis.registry = registry;\n\n\t\tconst channel = await factory.instantiateDataStore(this, existing);\n\t\tassert(channel !== undefined, 0x140 /* \"undefined channel on datastore context\" */);\n\t\tthis.bindRuntime(channel);\n\t}\n\n\t/**\n\t * Notifies this object about changes in the connection state.\n\t * @param value - New connection state.\n\t * @param clientId - ID of the client. Its old ID when in disconnected state and\n\t * its new client ID when we are connecting or connected.\n\t */\n\tpublic setConnectionState(connected: boolean, clientId?: string) {\n\t\t// ConnectionState should not fail in tombstone mode as this is internally run\n\t\tthis.verifyNotClosed(\"setConnectionState\", false /* checkTombstone */);\n\n\t\t// Connection events are ignored if the store is not yet loaded\n\t\tif (!this.loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tassert(this.connected === connected, 0x141 /* \"Unexpected connected state\" */);\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tthis.channel!.setConnectionState(connected, clientId);\n\t}\n\n\tpublic process(\n\t\tmessageArg: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\tthis.verifyNotClosed(\"process\", true, extractSafePropertiesFromMessage(messageArg));\n\n\t\tconst innerContents = messageArg.contents as FluidDataStoreMessage;\n\t\tconst message = {\n\t\t\t...messageArg,\n\t\t\ttype: innerContents.type,\n\t\t\tcontents: innerContents.content,\n\t\t};\n\n\t\tthis.summarizerNode.recordChange(message);\n\n\t\tif (this.loaded) {\n\t\t\treturn this.channel?.process(message, local, localOpMetadata);\n\t\t} else {\n\t\t\tassert(!local, 0x142 /* \"local store channel is not loaded\" */);\n\t\t\tassert(this.pending !== undefined, 0x23d /* \"pending is undefined\" */);\n\t\t\tthis.pending.push(message);\n\t\t\tthis.thresholdOpsCounter.sendIfMultiple(\"StorePendingOps\", this.pending.length);\n\t\t}\n\t}\n\n\tpublic processSignal(message: IInboundSignalMessage, local: boolean): void {\n\t\tthis.verifyNotClosed(\"processSignal\");\n\n\t\t// Signals are ignored if the store is not yet loaded\n\t\tif (!this.loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.channel?.processSignal(message, local);\n\t}\n\n\tpublic getQuorum(): IQuorumClients {\n\t\treturn this._containerRuntime.getQuorum();\n\t}\n\n\tpublic getAudience(): IAudience {\n\t\treturn this._containerRuntime.getAudience();\n\t}\n\n\t/**\n\t * Returns a summary at the current sequence number.\n\t * @param fullTree - true to bypass optimizations and force a full summary tree\n\t * @param trackState - This tells whether we should track state from this summary.\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tpublic async summarize(\n\t\tfullTree: boolean = false,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult> {\n\t\treturn this.summarizerNode.summarize(fullTree, trackState, telemetryContext);\n\t}\n\n\tprivate async summarizeInternal(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeInternalResult> {\n\t\tawait this.realize();\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tconst summarizeResult = await this.channel!.summarize(\n\t\t\tfullTree,\n\t\t\ttrackState,\n\t\t\ttelemetryContext,\n\t\t);\n\n\t\t// Wrap dds summaries in .channels subtree.\n\t\twrapSummaryInChannelsTree(summarizeResult);\n\t\tconst pathPartsForChildren = [channelsTreeName];\n\n\t\t// Add data store's attributes to the summary.\n\t\tconst { pkg } = await this.getInitialSnapshotDetails();\n\t\tconst isRoot = await this.isRoot();\n\t\tconst attributes = createAttributes(pkg, isRoot);\n\t\taddBlobToSummary(summarizeResult, dataStoreAttributesBlobName, JSON.stringify(attributes));\n\n\t\t// If we are not referenced, mark the summary tree as unreferenced. Also, update unreferenced blob\n\t\t// size in the summary stats with the blobs size of this data store.\n\t\tif (!this.summarizerNode.isReferenced()) {\n\t\t\tsummarizeResult.summary.unreferenced = true;\n\t\t\tsummarizeResult.stats.unreferencedBlobSize = summarizeResult.stats.totalBlobSize;\n\t\t}\n\n\t\treturn {\n\t\t\t...summarizeResult,\n\t\t\tid: this.id,\n\t\t\tpathPartsForChildren,\n\t\t};\n\t}\n\n\t/**\n\t * Returns the data used for garbage collection. This includes a list of GC nodes that represent this data store\n\t * including any of its child channel contexts. Each node has a set of outbound routes to other GC nodes in the\n\t * document.\n\t * If there is no new data in this data store since the last summary, previous GC data is used.\n\t * If there is new data, the GC data is generated again (by calling getGCDataInternal).\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\treturn this.summarizerNode.getGCData(fullGC);\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. This is called when there is new data since last summary. It\n\t * realizes the data store and calls into each channel context to get its GC data.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tprivate async getGCDataInternal(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tawait this.realize();\n\t\tassert(\n\t\t\tthis.channel !== undefined,\n\t\t\t0x143 /* \"Channel should not be undefined when running GC\" */,\n\t\t);\n\n\t\treturn this.channel.getGCData(fullGC);\n\t}\n\n\t/**\n\t * After GC has run, called to notify the data store of routes used in it. These are used for the following:\n\t *\n\t * 1. To identify if this data store is being referenced in the document or not.\n\t *\n\t * 2. To determine if it needs to re-summarize in case used routes changed since last summary.\n\t *\n\t * 3. These are added to the summary generated by the data store.\n\t *\n\t * 4. To notify child contexts of their used routes. This is done immediately if the data store is loaded.\n\t * Else, it is done when realizing the data store.\n\t *\n\t * 5. To update the timestamp when this data store or any children are marked as unreferenced.\n\t *\n\t * @param usedRoutes - The routes that are used in this data store.\n\t */\n\tpublic updateUsedRoutes(usedRoutes: string[]) {\n\t\t// Update the used routes in this data store's summarizer node.\n\t\tthis.summarizerNode.updateUsedRoutes(usedRoutes);\n\n\t\t/**\n\t\t * Store the used routes to update the channel if the data store is not loaded yet. If the used routes changed\n\t\t * since the previous run, the data store will be loaded during summarize since the used state changed. So, it's\n\t\t * safe to only store the last used routes.\n\t\t */\n\t\tthis.lastUsedRoutes = usedRoutes;\n\n\t\t// If we are loaded, call the channel so it can update the used routes of the child contexts.\n\t\t// If we are not loaded, we will update this when we are realized.\n\t\tif (this.loaded) {\n\t\t\tthis.updateChannelUsedRoutes();\n\t\t}\n\t}\n\n\t/**\n\t * Called when a new outbound reference is added to another node. This is used by garbage collection to identify\n\t * all references added in the system.\n\t * @param srcHandle - The handle of the node that added the reference.\n\t * @param outboundHandle - The handle of the outbound node that is referenced.\n\t */\n\tpublic addedGCOutboundReference(srcHandle: IFluidHandle, outboundHandle: IFluidHandle) {\n\t\tthis._containerRuntime.addedGCOutboundReference(srcHandle, outboundHandle);\n\t}\n\n\t/**\n\t * Updates the used routes of the channel and its child contexts. The channel must be loaded before calling this.\n\t * It is called in these two scenarios:\n\t * 1. When the used routes of the data store is updated and the data store is loaded.\n\t * 2. When the data store is realized. This updates the channel's used routes as per last GC run.\n\t */\n\tprivate updateChannelUsedRoutes() {\n\t\tassert(this.loaded, 0x144 /* \"Channel should be loaded when updating used routes\" */);\n\t\tassert(\n\t\t\tthis.channel !== undefined,\n\t\t\t0x145 /* \"Channel should be present when data store is loaded\" */,\n\t\t);\n\n\t\t// If there is no lastUsedRoutes, GC has not run up until this point.\n\t\tif (this.lastUsedRoutes === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove the route to this data store, if it exists.\n\t\tconst usedChannelRoutes = this.lastUsedRoutes.filter((id: string) => {\n\t\t\treturn id !== \"/\" && id !== \"\";\n\t\t});\n\t\tthis.channel.updateUsedRoutes(usedChannelRoutes);\n\t}\n\n\t/**\n\t * @deprecated 0.18.Should call request on the runtime directly\n\t */\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\tconst runtime = await this.realize();\n\t\treturn runtime.request(request);\n\t}\n\n\tpublic submitMessage(type: string, content: any, localOpMetadata: unknown): void {\n\t\tthis.verifyNotClosed(\"submitMessage\");\n\t\tassert(!!this.channel, 0x146 /* \"Channel must exist when submitting message\" */);\n\t\tconst fluidDataStoreContent: FluidDataStoreMessage = {\n\t\t\tcontent,\n\t\t\ttype,\n\t\t};\n\n\t\t// Summarizer clients should not submit messages.\n\t\tthis.identifyLocalChangeInSummarizer(\"DataStoreMessageSubmittedInSummarizer\", type);\n\n\t\tthis._containerRuntime.submitDataStoreOp(this.id, fluidDataStoreContent, localOpMetadata);\n\t}\n\n\t/**\n\t * This is called from a SharedSummaryBlock that does not generate ops but only wants to be part of the summary.\n\t * It indicates that there is data in the object that needs to be summarized.\n\t * We will update the latestSequenceNumber of the summary tracker of this\n\t * store and of the object's channel.\n\t *\n\t * @param address - The address of the channel that is dirty.\n\t *\n\t */\n\tpublic setChannelDirty(address: string): void {\n\t\tthis.verifyNotClosed(\"setChannelDirty\");\n\n\t\t// Get the latest sequence number.\n\t\tconst latestSequenceNumber = this.deltaManager.lastSequenceNumber;\n\n\t\tthis.summarizerNode.invalidate(latestSequenceNumber);\n\n\t\tconst channelSummarizerNode = this.summarizerNode.getChild(address);\n\n\t\tif (channelSummarizerNode) {\n\t\t\tchannelSummarizerNode.invalidate(latestSequenceNumber); // TODO: lazy load problem?\n\t\t}\n\t}\n\n\tpublic submitSignal(type: string, content: any) {\n\t\tthis.verifyNotClosed(\"submitSignal\");\n\n\t\tassert(!!this.channel, 0x147 /* \"Channel must exist on submitting signal\" */);\n\t\treturn this._containerRuntime.submitDataStoreSignal(this.id, type, content);\n\t}\n\n\t/**\n\t * This is called by the data store channel when it becomes locally visible indicating that it is ready to become\n\t * globally visible now.\n\t */\n\tpublic makeLocallyVisible() {\n\t\tassert(this.channel !== undefined, 0x2cf /* \"undefined channel on datastore context\" */);\n\t\tassert(\n\t\t\tthis.channel.visibilityState === VisibilityState.LocallyVisible,\n\t\t\t0x590 /* Channel must be locally visible */,\n\t\t);\n\t\tthis.makeLocallyVisibleFn();\n\t}\n\n\t/** @deprecated - To be replaced by calling makeLocallyVisible directly */\n\tpublic bindToContext() {\n\t\tthis.makeLocallyVisibleFn();\n\t}\n\n\tprotected bindRuntime(channel: IFluidDataStoreChannel) {\n\t\tif (this.channel) {\n\t\t\tthrow new Error(\"Runtime already bound\");\n\t\t}\n\n\t\ttry {\n\t\t\tassert(\n\t\t\t\t!this.detachedRuntimeCreation,\n\t\t\t\t0x148 /* \"Detached runtime creation on runtime bind\" */,\n\t\t\t);\n\t\t\tassert(this.channelDeferred !== undefined, 0x149 /* \"Undefined channel deferral\" */);\n\t\t\tassert(this.pkg !== undefined, 0x14a /* \"Undefined package path\" */);\n\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst pending = this.pending!;\n\n\t\t\t// Apply all pending ops\n\t\t\tfor (const op of pending) {\n\t\t\t\tchannel.process(op, false, undefined /* localOpMetadata */);\n\t\t\t}\n\n\t\t\tthis.thresholdOpsCounter.send(\"ProcessPendingOps\", pending.length);\n\t\t\tthis.pending = undefined;\n\n\t\t\t// And now mark the runtime active\n\t\t\tthis.loaded = true;\n\t\t\tthis.channel = channel;\n\n\t\t\t// Freeze the package path to ensure that someone doesn't modify it when it is\n\t\t\t// returned in packagePath().\n\t\t\tObject.freeze(this.pkg);\n\n\t\t\t/**\n\t\t\t * Update the used routes of the channel. If GC has run before this data store was realized, we will have\n\t\t\t * the used routes saved. So, this will ensure that all the child contexts have up-to-date used routes as\n\t\t\t * per the last time GC was run.\n\t\t\t * Also, this data store may have been realized during summarize. In that case, the child contexts need to\n\t\t\t * have their used routes updated to determine if its needs to summarize again and to add it to the summary.\n\t\t\t */\n\t\t\tthis.updateChannelUsedRoutes();\n\n\t\t\t// And notify the pending promise it is now available\n\t\t\tthis.channelDeferred.resolve(this.channel);\n\t\t} catch (error) {\n\t\t\tthis.channelDeferred?.reject(error);\n\t\t\tthis.logger.sendErrorEvent(\n\t\t\t\t{\n\t\t\t\t\teventName: \"BindRuntimeError\",\n\t\t\t\t\tfluidDataStoreId: {\n\t\t\t\t\t\tvalue: this.id,\n\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\terror,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic async getAbsoluteUrl(relativeUrl: string): Promise<string | undefined> {\n\t\tif (this.attachState !== AttachState.Attached) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this._containerRuntime.getAbsoluteUrl(relativeUrl);\n\t}\n\n\tpublic abstract generateAttachMessage(): IAttachMessage;\n\n\tpublic abstract getInitialSnapshotDetails(): Promise<ISnapshotDetails>;\n\n\t/**\n\t * @deprecated Sets the datastore as root, for aliasing purposes: #7948\n\t * This method should not be used outside of the aliasing context.\n\t * It will be removed, as the source of truth for this flag will be the aliasing blob.\n\t */\n\tpublic setInMemoryRoot(): void {\n\t\tthis._isInMemoryRoot = true;\n\t}\n\n\t/**\n\t * @deprecated - The functionality to get base GC details has been moved to summarizer node.\n\t */\n\tpublic async getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase> {\n\t\treturn {};\n\t}\n\n\tpublic reSubmit(contents: any, localOpMetadata: unknown) {\n\t\tassert(!!this.channel, 0x14b /* \"Channel must exist when resubmitting ops\" */);\n\t\tconst innerContents = contents as FluidDataStoreMessage;\n\t\tthis.channel.reSubmit(innerContents.type, innerContents.content, localOpMetadata);\n\t}\n\n\tpublic rollback(contents: any, localOpMetadata: unknown) {\n\t\tif (!this.channel) {\n\t\t\tthrow new Error(\"Channel must exist when rolling back ops\");\n\t\t}\n\t\tif (!this.channel.rollback) {\n\t\t\tthrow new Error(\"Channel doesn't support rollback\");\n\t\t}\n\t\tconst innerContents = contents as FluidDataStoreMessage;\n\t\tthis.channel.rollback(innerContents.type, innerContents.content, localOpMetadata);\n\t}\n\n\tpublic async applyStashedOp(contents: any): Promise<unknown> {\n\t\tif (!this.channel) {\n\t\t\tawait this.realize();\n\t\t}\n\t\tassert(!!this.channel, 0x14c /* \"Channel must exist when rebasing ops\" */);\n\t\tconst innerContents = contents as FluidDataStoreMessage;\n\t\treturn this.channel.applyStashedOp(innerContents.content);\n\t}\n\n\tprivate verifyNotClosed(\n\t\tcallSite: string,\n\t\tcheckTombstone = true,\n\t\tsafeTelemetryProps: ITelemetryProperties = {},\n\t) {\n\t\tif (this.deleted) {\n\t\t\tconst messageString = `Context is deleted! Call site [${callSite}]`;\n\t\t\tconst error = new DataCorruptionError(messageString, safeTelemetryProps);\n\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t{\n\t\t\t\t\teventName: \"GC_Deleted_DataStore_Changed\",\n\t\t\t\t\tcallSite,\n\t\t\t\t},\n\t\t\t\terror,\n\t\t\t);\n\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (this._disposed) {\n\t\t\tthrow new Error(`Context is closed! Call site [${callSite}]`);\n\t\t}\n\n\t\tif (checkTombstone && this.tombstoned) {\n\t\t\tconst messageString = `Context is tombstoned! Call site [${callSite}]`;\n\t\t\tconst error = new DataCorruptionError(messageString, safeTelemetryProps);\n\n\t\t\tsendGCUnexpectedUsageEvent(\n\t\t\t\tthis.mc,\n\t\t\t\t{\n\t\t\t\t\teventName: \"GC_Tombstone_DataStore_Changed\",\n\t\t\t\t\tcategory: this.throwOnTombstoneUsage ? \"error\" : \"generic\",\n\t\t\t\t\tgcTombstoneEnforcementAllowed:\n\t\t\t\t\t\tthis._containerRuntime.gcTombstoneEnforcementAllowed,\n\t\t\t\t\tcallSite,\n\t\t\t\t},\n\t\t\t\tthis.pkg,\n\t\t\t\terror,\n\t\t\t);\n\t\t\tif (this.throwOnTombstoneUsage) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Summarizer client should not have local changes. These changes can become part of the summary and can break\n\t * eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas\n\t * other clients that are up-to-date till seq# 100 may not have them yet.\n\t */\n\tprotected identifyLocalChangeInSummarizer(eventName: string, type?: string) {\n\t\tif (\n\t\t\tthis.clientDetails.type !== summarizerClientType ||\n\t\t\tthis.localChangesTelemetryCount <= 0\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Log a telemetry if there are local changes in the summarizer. This will give us data on how often\n\t\t// this is happening and which data stores do this. The eventual goal is to disallow local changes\n\t\t// in the summarizer and the data will help us plan this.\n\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\teventName,\n\t\t\ttype,\n\t\t\tfluidDataStoreId: {\n\t\t\t\tvalue: this.id,\n\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t},\n\t\t\tpackageName: packagePathToTelemetryProperty(this.pkg),\n\t\t\tisSummaryInProgress: this.summarizerNode.isSummaryInProgress?.(),\n\t\t\tstack: generateStack(),\n\t\t});\n\t\tthis.localChangesTelemetryCount--;\n\t}\n\n\tpublic getCreateChildSummarizerNodeFn(id: string, createParam: CreateChildSummarizerNodeParam) {\n\t\treturn (\n\t\t\tsummarizeInternal: SummarizeInternalFn,\n\t\t\tgetGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t\t) =>\n\t\t\tthis.summarizerNode.createChild(\n\t\t\t\tsummarizeInternal,\n\t\t\t\tid,\n\t\t\t\tcreateParam,\n\t\t\t\t// DDS will not create failure summaries\n\t\t\t\t{ throwOnFailure: true },\n\t\t\t\tgetGCDataFn,\n\t\t\t);\n\t}\n\n\tpublic async uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n\t\treturn this.containerRuntime.uploadBlob(blob);\n\t}\n}\n\nexport class RemoteFluidDataStoreContext extends FluidDataStoreContext {\n\tprivate readonly initSnapshotValue: ISnapshotTree | undefined;\n\n\tconstructor(props: IRemoteFluidDataStoreContextProps) {\n\t\tsuper(props, true /* existing */, false /* isLocalDataStore */, () => {\n\t\t\tthrow new Error(\"Already attached\");\n\t\t});\n\n\t\tthis.initSnapshotValue = props.snapshotTree;\n\n\t\tif (props.snapshotTree !== undefined) {\n\t\t\tthis.summarizerNode.updateBaseSummaryState(props.snapshotTree);\n\t\t}\n\t}\n\n\tprivate readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {\n\t\tlet tree = this.initSnapshotValue;\n\t\tlet isRootDataStore = true;\n\n\t\tif (!!tree && tree.blobs[dataStoreAttributesBlobName] !== undefined) {\n\t\t\t// Need to get through snapshot and use that to populate extraBlobs\n\t\t\tconst attributes = await readAndParse<ReadFluidDataStoreAttributes>(\n\t\t\t\tthis.storage,\n\t\t\t\ttree.blobs[dataStoreAttributesBlobName],\n\t\t\t);\n\n\t\t\tlet pkgFromSnapshot: string[];\n\t\t\t// Use the snapshotFormatVersion to determine how the pkg is encoded in the snapshot.\n\t\t\t// For snapshotFormatVersion = \"0.1\" (1) or above, pkg is jsonified, otherwise it is just a string.\n\t\t\tconst formatVersion = getAttributesFormatVersion(attributes);\n\t\t\tif (formatVersion < 1) {\n\t\t\t\tpkgFromSnapshot =\n\t\t\t\t\tattributes.pkg.startsWith('[\"') && attributes.pkg.endsWith('\"]')\n\t\t\t\t\t\t? (JSON.parse(attributes.pkg) as string[])\n\t\t\t\t\t\t: [attributes.pkg];\n\t\t\t} else {\n\t\t\t\tpkgFromSnapshot = JSON.parse(attributes.pkg) as string[];\n\t\t\t}\n\t\t\tthis.pkg = pkgFromSnapshot;\n\n\t\t\t/**\n\t\t\t * If there is no isRootDataStore in the attributes blob, set it to true. This will ensure that\n\t\t\t * data stores in older documents are not garbage collected incorrectly. This may lead to additional\n\t\t\t * roots in the document but they won't break.\n\t\t\t */\n\t\t\tisRootDataStore = attributes.isRootDataStore ?? true;\n\n\t\t\tif (hasIsolatedChannels(attributes)) {\n\t\t\t\ttree = tree.trees[channelsTreeName];\n\t\t\t\tassert(\n\t\t\t\t\ttree !== undefined,\n\t\t\t\t\t0x1fe /* \"isolated channels subtree should exist in remote datastore snapshot\" */,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tpkg: this.pkg!,\n\t\t\tisRootDataStore,\n\t\t\tsnapshot: tree,\n\t\t};\n\t});\n\n\tpublic async getInitialSnapshotDetails(): Promise<ISnapshotDetails> {\n\t\treturn this.initialSnapshotDetailsP;\n\t}\n\n\tpublic generateAttachMessage(): IAttachMessage {\n\t\tthrow new Error(\"Cannot attach remote store\");\n\t}\n}\n\n/**\n * Base class for detached & attached context classes\n */\nexport class LocalFluidDataStoreContextBase extends FluidDataStoreContext {\n\tprivate readonly snapshotTree: ISnapshotTree | undefined;\n\t/**\n\t * @deprecated 0.16 Issue #1635, #3631\n\t */\n\tpublic readonly createProps?: any;\n\n\tconstructor(props: ILocalFluidDataStoreContextProps) {\n\t\tsuper(\n\t\t\tprops,\n\t\t\tprops.snapshotTree !== undefined ? true : false /* existing */,\n\t\t\ttrue /* isLocalDataStore */,\n\t\t\tprops.makeLocallyVisibleFn,\n\t\t);\n\n\t\t// Summarizer client should not create local data stores.\n\t\tthis.identifyLocalChangeInSummarizer(\"DataStoreCreatedInSummarizer\");\n\n\t\tthis.snapshotTree = props.snapshotTree;\n\t\tif (props.isRootDataStore === true) {\n\t\t\tthis.setInMemoryRoot();\n\t\t}\n\t\tthis.createProps = props.createProps;\n\t\tthis.attachListeners();\n\t}\n\n\tprivate attachListeners(): void {\n\t\tthis.once(\"attaching\", () => {\n\t\t\tassert(\n\t\t\t\tthis.attachState === AttachState.Detached,\n\t\t\t\t0x14d /* \"Should move from detached to attaching\" */,\n\t\t\t);\n\t\t\tthis._attachState = AttachState.Attaching;\n\t\t});\n\t\tthis.once(\"attached\", () => {\n\t\t\tassert(\n\t\t\t\tthis.attachState === AttachState.Attaching,\n\t\t\t\t0x14e /* \"Should move from attaching to attached\" */,\n\t\t\t);\n\t\t\tthis._attachState = AttachState.Attached;\n\t\t});\n\t}\n\n\tpublic generateAttachMessage(): IAttachMessage {\n\t\tassert(\n\t\t\tthis.channel !== undefined,\n\t\t\t0x14f /* \"There should be a channel when generating attach message\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.pkg !== undefined,\n\t\t\t0x150 /* \"pkg should be available in local data store context\" */,\n\t\t);\n\n\t\tconst summarizeResult = this.channel.getAttachSummary();\n\n\t\t// Wrap dds summaries in .channels subtree.\n\t\twrapSummaryInChannelsTree(summarizeResult);\n\n\t\t// Add data store's attributes to the summary.\n\t\tconst attributes = createAttributes(this.pkg, this.isInMemoryRoot());\n\t\taddBlobToSummary(summarizeResult, dataStoreAttributesBlobName, JSON.stringify(attributes));\n\n\t\t// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.\n\t\tconst snapshot = convertSummaryTreeToITree(summarizeResult.summary);\n\n\t\tconst message: IAttachMessage = {\n\t\t\tid: this.id,\n\t\t\tsnapshot,\n\t\t\ttype: this.pkg[this.pkg.length - 1],\n\t\t};\n\n\t\treturn message;\n\t}\n\n\tpublic async getInitialSnapshotDetails(): Promise<ISnapshotDetails> {\n\t\tlet snapshot = this.snapshotTree;\n\t\tlet attributes: ReadFluidDataStoreAttributes;\n\t\tlet isRootDataStore = false;\n\t\tif (snapshot !== undefined) {\n\t\t\t// Get the dataStore attributes.\n\t\t\t// Note: storage can be undefined in special case while detached.\n\t\t\tattributes = await getFluidDataStoreAttributes(this.storage, snapshot);\n\t\t\tif (hasIsolatedChannels(attributes)) {\n\t\t\t\tsnapshot = snapshot.trees[channelsTreeName];\n\t\t\t\tassert(\n\t\t\t\t\tsnapshot !== undefined,\n\t\t\t\t\t0x1ff /* \"isolated channels subtree should exist in local datastore snapshot\" */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.pkg === undefined) {\n\t\t\t\tthis.pkg = JSON.parse(attributes.pkg) as string[];\n\t\t\t\t// If there is no isRootDataStore in the attributes blob, set it to true. This ensures that data\n\t\t\t\t// stores in older documents are not garbage collected incorrectly. This may lead to additional\n\t\t\t\t// roots in the document but they won't break.\n\t\t\t\tif (attributes.isRootDataStore ?? true) {\n\t\t\t\t\tisRootDataStore = true;\n\t\t\t\t\tthis.setInMemoryRoot();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tassert(this.pkg !== undefined, 0x152 /* \"pkg should be available in local data store\" */);\n\n\t\treturn {\n\t\t\tpkg: this.pkg,\n\t\t\tisRootDataStore,\n\t\t\tsnapshot,\n\t\t};\n\t}\n\n\t/**\n\t * A context should only be marked as deleted when its a remote context.\n\t * Session Expiry at the runtime level should have closed the container creating the local data store context\n\t * before delete is even possible. Session Expiry is at 30 days, and sweep is done 36+ days later from the time\n\t * it was unreferenced. Thus the sweeping container should have loaded from a snapshot and thus creating a remote\n\t * context.\n\t */\n\tpublic delete() {\n\t\t// TODO: GC:Validation - potentially prevent this from happening or asserting. Maybe throw here.\n\t\tsendGCUnexpectedUsageEvent(\n\t\t\tthis.mc,\n\t\t\t{\n\t\t\t\teventName: \"GC_Deleted_DataStore_Unexpected_Delete\",\n\t\t\t\tmessage: \"Unexpected deletion of a local data store context\",\n\t\t\t\tcategory: \"error\",\n\t\t\t\tgcTombstoneEnforcementAllowed: undefined,\n\t\t\t},\n\t\t\tthis.pkg,\n\t\t);\n\t\tsuper.delete();\n\t}\n}\n\n/**\n * context implementation for \"attached\" data store runtime.\n * Various workflows (snapshot creation, requests) result in .realize() being called\n * on context, resulting in instantiation and attachment of runtime.\n * Runtime is created using data store factory that is associated with this context.\n */\nexport class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {\n\tconstructor(props: ILocalFluidDataStoreContextProps) {\n\t\tsuper(props);\n\t}\n}\n\n/**\n * Detached context. Data Store runtime will be attached to it by attachRuntime() call\n * Before attachment happens, this context is not associated with particular type of runtime\n * or factory, i.e. it's package path is undefined.\n * Attachment process provides all missing parts - package path, data store runtime, and data store factory\n */\nexport class LocalDetachedFluidDataStoreContext\n\textends LocalFluidDataStoreContextBase\n\timplements IFluidDataStoreContextDetached\n{\n\tconstructor(props: ILocalFluidDataStoreContextProps) {\n\t\tsuper(props);\n\t\tthis.detachedRuntimeCreation = true;\n\t}\n\n\tpublic async attachRuntime(\n\t\tregistry: IProvideFluidDataStoreFactory,\n\t\tdataStoreChannel: IFluidDataStoreChannel,\n\t) {\n\t\tassert(this.detachedRuntimeCreation, 0x154 /* \"runtime creation is already attached\" */);\n\t\tthis.detachedRuntimeCreation = false;\n\n\t\tassert(this.channelDeferred === undefined, 0x155 /* \"channel deferral is already set\" */);\n\t\tthis.channelDeferred = new Deferred<IFluidDataStoreChannel>();\n\n\t\tconst factory = registry.IFluidDataStoreFactory;\n\n\t\tconst entry = await this.factoryFromPackagePath(this.pkg);\n\t\tassert(entry.factory === factory, 0x156 /* \"Unexpected factory for package path\" */);\n\n\t\tassert(this.registry === undefined, 0x157 /* \"datastore registry already attached\" */);\n\t\tthis.registry = entry.registry;\n\n\t\tsuper.bindRuntime(dataStoreChannel);\n\n\t\t// Load the handle to the data store's entryPoint to make sure that for a detached data store, the entryPoint\n\t\t// initialization function is called before the data store gets attached and potentially connected to the\n\t\t// delta stream, so it gets a chance to do things while the data store is still \"purely local\".\n\t\t// This preserves the behavior from before we introduced entryPoints, where the instantiateDataStore method\n\t\t// of data store factories tends to construct the data object (at least kick off an async method that returns\n\t\t// it); that code moved to the entryPoint initialization function, so we want to ensure it still executes\n\t\t// before the data store is attached.\n\t\tawait dataStoreChannel.entryPoint?.get();\n\n\t\tif (await this.isRoot()) {\n\t\t\tdataStoreChannel.makeVisibleAndAttachGraph();\n\t\t}\n\t}\n\n\tpublic async getInitialSnapshotDetails(): Promise<ISnapshotDetails> {\n\t\tif (this.detachedRuntimeCreation) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Detached Fluid Data Store context can't be realized! Please attach runtime first!\",\n\t\t\t);\n\t\t}\n\t\treturn super.getInitialSnapshotDetails();\n\t}\n}\n"]}
|
package/dist/dataStores.d.ts
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ITelemetryBaseLogger, IDisposable } from "@fluidframework/common-definitions";
|
|
6
6
|
import { ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
7
|
-
import { AliasResult, CreateChildSummarizerNodeFn, CreateChildSummarizerNodeParam, IAttachMessage, IFluidDataStoreContextDetached, IGarbageCollectionData,
|
|
7
|
+
import { AliasResult, CreateChildSummarizerNodeFn, CreateChildSummarizerNodeParam, IAttachMessage, IFluidDataStoreContextDetached, IGarbageCollectionData, IInboundSignalMessage, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
8
8
|
import { AttachState } from "@fluidframework/container-definitions";
|
|
9
9
|
import { DataStoreContexts } from "./dataStoreContexts";
|
|
10
10
|
import { ContainerRuntime, RuntimeHeaderData } from "./containerRuntime";
|
|
11
11
|
import { FluidDataStoreContext, LocalFluidDataStoreContext } from "./dataStoreContext";
|
|
12
|
-
import { IContainerRuntimeMetadata } from "./summaryFormat";
|
|
13
12
|
import { IDataStoreAliasMessage } from "./dataStore";
|
|
14
|
-
import { GCNodeType } from "./
|
|
13
|
+
import { GCNodeType } from "./gc";
|
|
14
|
+
import { IContainerRuntimeMetadata } from "./summary";
|
|
15
15
|
/**
|
|
16
16
|
* This class encapsulates data store handling. Currently it is only used by the container runtime,
|
|
17
17
|
* but eventually could be hosted on any channel once we formalize the channel api boundary.
|
|
@@ -39,7 +39,7 @@ export declare class DataStores implements IDisposable {
|
|
|
39
39
|
private readonly throwOnTombstoneLoad;
|
|
40
40
|
private readonly containerRuntimeHandle;
|
|
41
41
|
private readonly pendingAliasMap;
|
|
42
|
-
constructor(baseSnapshot: ISnapshotTree | undefined, runtime: ContainerRuntime, submitAttachFn: (attachContent: any) => void, getCreateChildSummarizerNodeFn: (id: string, createParam: CreateChildSummarizerNodeParam) => CreateChildSummarizerNodeFn, deleteChildSummarizerNodeFn: (id: string) => void, baseLogger: ITelemetryBaseLogger,
|
|
42
|
+
constructor(baseSnapshot: ISnapshotTree | undefined, runtime: ContainerRuntime, submitAttachFn: (attachContent: any) => void, getCreateChildSummarizerNodeFn: (id: string, createParam: CreateChildSummarizerNodeParam) => CreateChildSummarizerNodeFn, deleteChildSummarizerNodeFn: (id: string) => void, baseLogger: ITelemetryBaseLogger, gcNodeUpdated: (nodePath: string, timestampMs: number, packagePath?: readonly string[]) => void, isDataStoreDeleted: (nodePath: string) => boolean, aliasMap: Map<string, string>, contexts?: DataStoreContexts);
|
|
43
43
|
get aliases(): ReadonlyMap<string, string>;
|
|
44
44
|
get pendingAliases(): Map<string, Promise<AliasResult>>;
|
|
45
45
|
waitIfPendingAlias(maybeAlias: string): Promise<AliasResult>;
|
|
@@ -116,13 +116,12 @@ export declare class DataStores implements IDisposable {
|
|
|
116
116
|
*/
|
|
117
117
|
updateUnusedRoutes(unusedRoutes: string[]): void;
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* @returns - routes of
|
|
123
|
-
* and other state
|
|
119
|
+
* Delete data stores and its objects that are sweep ready.
|
|
120
|
+
* @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should
|
|
121
|
+
* be deleted.
|
|
122
|
+
* @returns - The routes of data stores and its objects that were deleted.
|
|
124
123
|
*/
|
|
125
|
-
|
|
124
|
+
deleteSweepReadyNodes(sweepReadyDataStoreRoutes: string[]): string[];
|
|
126
125
|
/**
|
|
127
126
|
* This is called to update objects whose routes are tombstones. Tombstoned datastore contexts enable testing
|
|
128
127
|
* scenarios with accessing deleted content without actually deleting content from summaries.
|
package/dist/dataStores.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStores.d.ts","sourceRoot":"","sources":["../src/dataStores.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,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yB,GAClC,aAAa,GAAG,SAAS,CAsB3B"}
|
package/dist/dataStores.js
CHANGED
|
@@ -18,18 +18,15 @@ const garbage_collector_1 = require("@fluidframework/garbage-collector");
|
|
|
18
18
|
const dataStoreContexts_1 = require("./dataStoreContexts");
|
|
19
19
|
const containerRuntime_1 = require("./containerRuntime");
|
|
20
20
|
const dataStoreContext_1 = require("./dataStoreContext");
|
|
21
|
-
const summaryFormat_1 = require("./summaryFormat");
|
|
22
21
|
const dataStore_1 = require("./dataStore");
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const summarizerClientElection_1 = require("./summarizerClientElection");
|
|
26
|
-
const garbageCollectionHelpers_1 = require("./garbageCollectionHelpers");
|
|
22
|
+
const gc_1 = require("./gc");
|
|
23
|
+
const summary_1 = require("./summary");
|
|
27
24
|
/**
|
|
28
25
|
* This class encapsulates data store handling. Currently it is only used by the container runtime,
|
|
29
26
|
* but eventually could be hosted on any channel once we formalize the channel api boundary.
|
|
30
27
|
*/
|
|
31
28
|
class DataStores {
|
|
32
|
-
constructor(baseSnapshot, runtime, submitAttachFn, getCreateChildSummarizerNodeFn, deleteChildSummarizerNodeFn, baseLogger,
|
|
29
|
+
constructor(baseSnapshot, runtime, submitAttachFn, getCreateChildSummarizerNodeFn, deleteChildSummarizerNodeFn, baseLogger, gcNodeUpdated, isDataStoreDeleted, aliasMap, contexts = new dataStoreContexts_1.DataStoreContexts(baseLogger)) {
|
|
33
30
|
this.baseSnapshot = baseSnapshot;
|
|
34
31
|
this.runtime = runtime;
|
|
35
32
|
this.submitAttachFn = submitAttachFn;
|
|
@@ -51,20 +48,11 @@ class DataStores {
|
|
|
51
48
|
this.dispose = () => this.disposeOnce.value;
|
|
52
49
|
this.mc = (0, telemetry_utils_1.loggerToMonitoringContext)(telemetry_utils_1.ChildLogger.create(baseLogger));
|
|
53
50
|
this.containerRuntimeHandle = new datastore_1.FluidObjectHandle(this.runtime, "/", this.runtime.IFluidHandleContext);
|
|
54
|
-
const baseGCDetailsP = new common_utils_1.LazyPromise(async () => {
|
|
55
|
-
const baseGCDetails = await getBaseGCDetails();
|
|
56
|
-
return (0, garbage_collector_1.unpackChildNodesGCDetails)(baseGCDetails);
|
|
57
|
-
});
|
|
58
|
-
// Returns the base GC details for the data store with the given id.
|
|
59
|
-
const dataStoreBaseGCDetails = async (dataStoreId) => {
|
|
60
|
-
const baseGCDetails = await baseGCDetailsP;
|
|
61
|
-
return baseGCDetails.get(dataStoreId);
|
|
62
|
-
};
|
|
63
51
|
// Tombstone should only throw when the feature flag is enabled and the client isn't a summarizer
|
|
64
52
|
this.throwOnTombstoneLoad =
|
|
65
|
-
this.mc.config.getBoolean(
|
|
53
|
+
this.mc.config.getBoolean(gc_1.throwOnTombstoneLoadKey) === true &&
|
|
66
54
|
this.runtime.gcTombstoneEnforcementAllowed &&
|
|
67
|
-
this.runtime.clientDetails.type !==
|
|
55
|
+
this.runtime.clientDetails.type !== summary_1.summarizerClientType;
|
|
68
56
|
// Extract stores stored inside the snapshot
|
|
69
57
|
const fluidDataStores = new Map();
|
|
70
58
|
if (baseSnapshot) {
|
|
@@ -85,7 +73,6 @@ class DataStores {
|
|
|
85
73
|
dataStoreContext = new dataStoreContext_1.RemoteFluidDataStoreContext({
|
|
86
74
|
id: key,
|
|
87
75
|
snapshotTree: value,
|
|
88
|
-
getBaseGCDetails: async () => dataStoreBaseGCDetails(key),
|
|
89
76
|
runtime: this.runtime,
|
|
90
77
|
storage: this.runtime.storage,
|
|
91
78
|
scope: this.runtime.scope,
|
|
@@ -163,10 +150,6 @@ class DataStores {
|
|
|
163
150
|
const remoteFluidDataStoreContext = new dataStoreContext_1.RemoteFluidDataStoreContext({
|
|
164
151
|
id: attachMessage.id,
|
|
165
152
|
snapshotTree,
|
|
166
|
-
// New data stores begin with empty GC details since GC hasn't run on them yet.
|
|
167
|
-
getBaseGCDetails: async () => {
|
|
168
|
-
return {};
|
|
169
|
-
},
|
|
170
153
|
runtime: this.runtime,
|
|
171
154
|
storage: new driver_utils_1.BlobCacheStorageService(this.runtime.storage, flatBlobs),
|
|
172
155
|
scope: this.runtime.scope,
|
|
@@ -301,6 +284,8 @@ class DataStores {
|
|
|
301
284
|
processFluidDataStoreOp(message, local, localMessageMetadata) {
|
|
302
285
|
const envelope = message.contents;
|
|
303
286
|
const transformed = Object.assign(Object.assign({}, message), { contents: envelope.contents });
|
|
287
|
+
const request = { url: envelope.address };
|
|
288
|
+
this.validateNotDeleted(envelope.address, request);
|
|
304
289
|
const context = this.contexts.get(envelope.address);
|
|
305
290
|
(0, common_utils_1.assert)(!!context, 0x162 /* "There should be a store context for the op" */);
|
|
306
291
|
context.process(transformed, local, localMessageMetadata);
|
|
@@ -333,10 +318,10 @@ class DataStores {
|
|
|
333
318
|
(0, common_utils_1.assert)(!this.contexts.has(id), 0x570 /* Inconsistent state! GC says the data store is deleted, but the data store is not deleted from the runtime. */);
|
|
334
319
|
// The requested data store is removed by gc. Create a 404 gc response exception.
|
|
335
320
|
const error = (0, runtime_utils_1.responseToException)((0, runtime_utils_1.createResponseError)(404, "DataStore was deleted", request), request);
|
|
336
|
-
(0,
|
|
321
|
+
(0, gc_1.sendGCUnexpectedUsageEvent)(this.mc, {
|
|
337
322
|
eventName: "GC_Deleted_DataStore_Requested",
|
|
338
323
|
category: "error",
|
|
339
|
-
isSummarizerClient: this.runtime.clientDetails.type ===
|
|
324
|
+
isSummarizerClient: this.runtime.clientDetails.type === summary_1.summarizerClientType,
|
|
340
325
|
headers: JSON.stringify(requestHeaderData),
|
|
341
326
|
gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
|
|
342
327
|
}, undefined /** packagePath */, error);
|
|
@@ -357,10 +342,10 @@ class DataStores {
|
|
|
357
342
|
const error = (0, runtime_utils_1.responseToException)((0, runtime_utils_1.createResponseError)(404, "DataStore was deleted", request, {
|
|
358
343
|
[containerRuntime_1.TombstoneResponseHeaderKey]: true,
|
|
359
344
|
}), request);
|
|
360
|
-
(0,
|
|
345
|
+
(0, gc_1.sendGCUnexpectedUsageEvent)(this.mc, {
|
|
361
346
|
eventName: "GC_Tombstone_DataStore_Requested",
|
|
362
347
|
category: shouldFail ? "error" : "generic",
|
|
363
|
-
isSummarizerClient: this.runtime.clientDetails.type ===
|
|
348
|
+
isSummarizerClient: this.runtime.clientDetails.type === summary_1.summarizerClientType,
|
|
364
349
|
headers: JSON.stringify(headerData),
|
|
365
350
|
gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
|
|
366
351
|
}, context.isLoaded ? context.packagePath : undefined, error);
|
|
@@ -370,6 +355,8 @@ class DataStores {
|
|
|
370
355
|
}
|
|
371
356
|
}
|
|
372
357
|
processSignal(address, message, local) {
|
|
358
|
+
const request = { url: address };
|
|
359
|
+
this.validateNotDeleted(address, request);
|
|
373
360
|
const context = this.contexts.get(address);
|
|
374
361
|
if (!context) {
|
|
375
362
|
// Attach message may not have been processed yet
|
|
@@ -416,8 +403,9 @@ class DataStores {
|
|
|
416
403
|
// Iterate over each store and ask it to snapshot
|
|
417
404
|
await Promise.all(Array.from(this.contexts)
|
|
418
405
|
.filter(([_, context]) => {
|
|
419
|
-
// Summarizer works only with clients with no local changes
|
|
420
|
-
|
|
406
|
+
// Summarizer works only with clients with no local changes. A data store in attaching
|
|
407
|
+
// state indicates an op was sent to attach a local data store.
|
|
408
|
+
(0, common_utils_1.assert)(context.attachState !== container_definitions_1.AttachState.Attaching, 0x588 /* Local data store detected in attaching state during summarize */);
|
|
421
409
|
return context.attachState === container_definitions_1.AttachState.Attached;
|
|
422
410
|
})
|
|
423
411
|
.map(async ([contextId, context]) => {
|
|
@@ -495,8 +483,9 @@ class DataStores {
|
|
|
495
483
|
// Iterate over each store and get their GC data.
|
|
496
484
|
await Promise.all(Array.from(this.contexts)
|
|
497
485
|
.filter(([_, context]) => {
|
|
498
|
-
//
|
|
499
|
-
//
|
|
486
|
+
// Summarizer client and hence GC works only with clients with no local changes. A data store in
|
|
487
|
+
// attaching state indicates an op was sent to attach a local data store.
|
|
488
|
+
(0, common_utils_1.assert)(context.attachState !== container_definitions_1.AttachState.Attaching, 0x589 /* Local data store detected in attaching state while running GC */);
|
|
500
489
|
return context.attachState === container_definitions_1.AttachState.Attached;
|
|
501
490
|
})
|
|
502
491
|
.map(async ([contextId, context]) => {
|
|
@@ -547,36 +536,40 @@ class DataStores {
|
|
|
547
536
|
}
|
|
548
537
|
}
|
|
549
538
|
/**
|
|
550
|
-
*
|
|
551
|
-
*
|
|
552
|
-
*
|
|
553
|
-
* @returns - routes of
|
|
554
|
-
* and other state
|
|
539
|
+
* Delete data stores and its objects that are sweep ready.
|
|
540
|
+
* @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should
|
|
541
|
+
* be deleted.
|
|
542
|
+
* @returns - The routes of data stores and its objects that were deleted.
|
|
555
543
|
*/
|
|
556
|
-
|
|
557
|
-
|
|
544
|
+
deleteSweepReadyNodes(sweepReadyDataStoreRoutes) {
|
|
545
|
+
// If sweep for data stores is not enabled, return empty list indicating nothing is deleted.
|
|
546
|
+
if (this.mc.config.getBoolean(gc_1.sweepDatastoresKey) !== true) {
|
|
558
547
|
return [];
|
|
559
548
|
}
|
|
560
|
-
const
|
|
561
|
-
for (const route of unusedRoutes) {
|
|
549
|
+
for (const route of sweepReadyDataStoreRoutes) {
|
|
562
550
|
const pathParts = route.split("/");
|
|
563
551
|
const dataStoreId = pathParts[1];
|
|
564
552
|
// TODO: GC:Validation - Skip any routes already deleted
|
|
565
|
-
//
|
|
566
|
-
|
|
567
|
-
// Ignore sub-data store routes because a data store and its sub-routes are deleted together, so, we only need to delete the data store.
|
|
553
|
+
// Ignore sub-data store routes because a data store and its sub-routes are deleted together, so, we only
|
|
554
|
+
// need to delete the data store.
|
|
568
555
|
if (pathParts.length > 2) {
|
|
569
556
|
continue;
|
|
570
557
|
}
|
|
558
|
+
if (!this.contexts.has(dataStoreId)) {
|
|
559
|
+
this.mc.logger.sendErrorEvent({
|
|
560
|
+
eventName: "DeletedDataStoreNotFound",
|
|
561
|
+
dataStoreId,
|
|
562
|
+
});
|
|
563
|
+
}
|
|
571
564
|
const dataStore = this.contexts.get(dataStoreId);
|
|
572
565
|
(0, common_utils_1.assert)(dataStore !== undefined, 0x571 /* Attempting to delete unknown dataStore */);
|
|
573
566
|
dataStore.delete();
|
|
574
|
-
// Delete the contexts of
|
|
567
|
+
// Delete the contexts of sweep ready data stores.
|
|
575
568
|
this.contexts.delete(dataStoreId);
|
|
576
|
-
// Delete the summarizer node of the
|
|
569
|
+
// Delete the summarizer node of the sweep ready data stores.
|
|
577
570
|
this.deleteChildSummarizerNodeFn(dataStoreId);
|
|
578
571
|
}
|
|
579
|
-
return Array.from(
|
|
572
|
+
return Array.from(sweepReadyDataStoreRoutes);
|
|
580
573
|
}
|
|
581
574
|
/**
|
|
582
575
|
* This is called to update objects whose routes are tombstones. Tombstoned datastore contexts enable testing
|
|
@@ -636,9 +629,9 @@ class DataStores {
|
|
|
636
629
|
// Data stores paths are of the format "/dataStoreId".
|
|
637
630
|
// Sub data store paths are of the format "/dataStoreId/subPath/...".
|
|
638
631
|
if (pathParts.length === 2) {
|
|
639
|
-
return
|
|
632
|
+
return gc_1.GCNodeType.DataStore;
|
|
640
633
|
}
|
|
641
|
-
return
|
|
634
|
+
return gc_1.GCNodeType.SubDataStore;
|
|
642
635
|
}
|
|
643
636
|
}
|
|
644
637
|
exports.DataStores = DataStores;
|
|
@@ -646,7 +639,7 @@ function getSummaryForDatastores(snapshot, metadata) {
|
|
|
646
639
|
if (!snapshot) {
|
|
647
640
|
return undefined;
|
|
648
641
|
}
|
|
649
|
-
if ((0,
|
|
642
|
+
if ((0, summary_1.rootHasIsolatedChannels)(metadata)) {
|
|
650
643
|
const datastoresSnapshot = snapshot.trees[runtime_definitions_1.channelsTreeName];
|
|
651
644
|
(0, common_utils_1.assert)(!!datastoresSnapshot, 0x168 /* Expected tree in snapshot not found */);
|
|
652
645
|
return datastoresSnapshot;
|
|
@@ -655,7 +648,7 @@ function getSummaryForDatastores(snapshot, metadata) {
|
|
|
655
648
|
// back-compat: strip out all non-datastore paths before giving to DataStores object.
|
|
656
649
|
const datastoresTrees = {};
|
|
657
650
|
for (const [key, value] of Object.entries(snapshot.trees)) {
|
|
658
|
-
if (!
|
|
651
|
+
if (!summary_1.nonDataStorePaths.includes(key)) {
|
|
659
652
|
datastoresTrees[key] = value;
|
|
660
653
|
}
|
|
661
654
|
}
|