@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
package/src/dataStoreContext.ts
CHANGED
|
@@ -29,7 +29,6 @@ import {
|
|
|
29
29
|
} from "@fluidframework/protocol-definitions";
|
|
30
30
|
import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
31
31
|
import {
|
|
32
|
-
BindState,
|
|
33
32
|
channelsTreeName,
|
|
34
33
|
CreateChildSummarizerNodeFn,
|
|
35
34
|
CreateChildSummarizerNodeParam,
|
|
@@ -49,10 +48,16 @@ import {
|
|
|
49
48
|
ISummarizerNodeWithGC,
|
|
50
49
|
SummarizeInternalFn,
|
|
51
50
|
ITelemetryContext,
|
|
51
|
+
VisibilityState,
|
|
52
52
|
} from "@fluidframework/runtime-definitions";
|
|
53
|
-
import {
|
|
53
|
+
import {
|
|
54
|
+
addBlobToSummary,
|
|
55
|
+
convertSummaryTreeToITree,
|
|
56
|
+
packagePathToTelemetryProperty,
|
|
57
|
+
} from "@fluidframework/runtime-utils";
|
|
54
58
|
import {
|
|
55
59
|
ChildLogger,
|
|
60
|
+
generateStack,
|
|
56
61
|
loggerToMonitoringContext,
|
|
57
62
|
LoggingError,
|
|
58
63
|
MonitoringContext,
|
|
@@ -65,7 +70,6 @@ import {
|
|
|
65
70
|
extractSafePropertiesFromMessage,
|
|
66
71
|
} from "@fluidframework/container-utils";
|
|
67
72
|
|
|
68
|
-
import { ContainerRuntime } from "./containerRuntime";
|
|
69
73
|
import {
|
|
70
74
|
dataStoreAttributesBlobName,
|
|
71
75
|
hasIsolatedChannels,
|
|
@@ -74,10 +78,10 @@ import {
|
|
|
74
78
|
WriteFluidDataStoreAttributes,
|
|
75
79
|
getAttributesFormatVersion,
|
|
76
80
|
getFluidDataStoreAttributes,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
+
summarizerClientType,
|
|
82
|
+
} from "./summary";
|
|
83
|
+
import { ContainerRuntime } from "./containerRuntime";
|
|
84
|
+
import { sendGCUnexpectedUsageEvent, throwOnTombstoneUsageKey } from "./gc";
|
|
81
85
|
|
|
82
86
|
function createAttributes(
|
|
83
87
|
pkg: readonly string[],
|
|
@@ -131,7 +135,6 @@ export interface ILocalFluidDataStoreContextProps extends IFluidDataStoreContext
|
|
|
131
135
|
/** Properties necessary for creating a remote FluidDataStoreContext */
|
|
132
136
|
export interface IRemoteFluidDataStoreContextProps extends IFluidDataStoreContextProps {
|
|
133
137
|
readonly snapshotTree: ISnapshotTree | undefined;
|
|
134
|
-
readonly getBaseGCDetails: () => Promise<IGarbageCollectionDetailsBase | undefined>;
|
|
135
138
|
}
|
|
136
139
|
|
|
137
140
|
/**
|
|
@@ -241,8 +244,6 @@ export abstract class FluidDataStoreContext
|
|
|
241
244
|
protected registry: IFluidDataStoreRegistry | undefined;
|
|
242
245
|
|
|
243
246
|
protected detachedRuntimeCreation = false;
|
|
244
|
-
/** @deprecated - To be replaced by calling makeLocallyVisible directly */
|
|
245
|
-
public readonly bindToContext: () => void;
|
|
246
247
|
protected channel: IFluidDataStoreChannel | undefined;
|
|
247
248
|
private loaded = false;
|
|
248
249
|
protected pending: ISequencedDocumentMessage[] | undefined = [];
|
|
@@ -255,6 +256,13 @@ export abstract class FluidDataStoreContext
|
|
|
255
256
|
private readonly thresholdOpsCounter: ThresholdCounter;
|
|
256
257
|
private static readonly pendingOpsCountThreshold = 1000;
|
|
257
258
|
|
|
259
|
+
/**
|
|
260
|
+
* If the summarizer makes local changes, a telemetry event is logged. This has the potential to be very noisy.
|
|
261
|
+
* So, adding a count of how many telemetry events are logged per data store context. This can be
|
|
262
|
+
* controlled via feature flags.
|
|
263
|
+
*/
|
|
264
|
+
private localChangesTelemetryCount: number;
|
|
265
|
+
|
|
258
266
|
// The used routes of this node as per the last GC run. This is used to update the used routes of the channel
|
|
259
267
|
// if it realizes after GC is run.
|
|
260
268
|
private lastUsedRoutes: string[] | undefined;
|
|
@@ -268,7 +276,6 @@ export abstract class FluidDataStoreContext
|
|
|
268
276
|
constructor(
|
|
269
277
|
props: IFluidDataStoreContextProps,
|
|
270
278
|
private readonly existing: boolean,
|
|
271
|
-
private bindState: BindState, // Used to assert for state tracking purposes
|
|
272
279
|
public readonly isLocalDataStore: boolean,
|
|
273
280
|
private readonly makeLocallyVisibleFn: () => void,
|
|
274
281
|
) {
|
|
@@ -289,20 +296,6 @@ export abstract class FluidDataStoreContext
|
|
|
289
296
|
? this.containerRuntime.attachState
|
|
290
297
|
: AttachState.Detached;
|
|
291
298
|
|
|
292
|
-
this.bindToContext = () => {
|
|
293
|
-
assert(
|
|
294
|
-
this.bindState === BindState.NotBound,
|
|
295
|
-
0x13b /* "datastore context is already in bound state" */,
|
|
296
|
-
);
|
|
297
|
-
this.bindState = BindState.Binding;
|
|
298
|
-
assert(
|
|
299
|
-
this.channel !== undefined,
|
|
300
|
-
0x13c /* "undefined channel on datastore context" */,
|
|
301
|
-
);
|
|
302
|
-
this.makeLocallyVisible();
|
|
303
|
-
this.bindState = BindState.Bound;
|
|
304
|
-
};
|
|
305
|
-
|
|
306
299
|
const thisSummarizeInternal = async (
|
|
307
300
|
fullTree: boolean,
|
|
308
301
|
trackState: boolean,
|
|
@@ -312,7 +305,6 @@ export abstract class FluidDataStoreContext
|
|
|
312
305
|
this.summarizerNode = props.createSummarizerNodeFn(
|
|
313
306
|
thisSummarizeInternal,
|
|
314
307
|
async (fullGC?: boolean) => this.getGCDataInternal(fullGC),
|
|
315
|
-
async () => this.getBaseGCDetails(),
|
|
316
308
|
);
|
|
317
309
|
|
|
318
310
|
this.mc = loggerToMonitoringContext(
|
|
@@ -328,6 +320,10 @@ export abstract class FluidDataStoreContext
|
|
|
328
320
|
this.mc.config.getBoolean(throwOnTombstoneUsageKey) === true &&
|
|
329
321
|
this._containerRuntime.gcTombstoneEnforcementAllowed &&
|
|
330
322
|
this.clientDetails.type !== summarizerClientType;
|
|
323
|
+
|
|
324
|
+
// By default, a data store can log maximum 10 local changes telemetry in summarizer.
|
|
325
|
+
this.localChangesTelemetryCount =
|
|
326
|
+
this.mc.config.getNumber("Fluid.Telemetry.LocalChangesTelemetryCount") ?? 10;
|
|
331
327
|
}
|
|
332
328
|
|
|
333
329
|
public dispose(): void {
|
|
@@ -364,9 +360,14 @@ export abstract class FluidDataStoreContext
|
|
|
364
360
|
this._tombstoned = tombstone;
|
|
365
361
|
}
|
|
366
362
|
|
|
367
|
-
private rejectDeferredRealize(
|
|
363
|
+
private rejectDeferredRealize(
|
|
364
|
+
reason: string,
|
|
365
|
+
failedPkgPath?: string,
|
|
366
|
+
fullPackageName?: readonly string[],
|
|
367
|
+
): never {
|
|
368
368
|
throw new LoggingError(reason, {
|
|
369
|
-
|
|
369
|
+
failedPkgPath: { value: failedPkgPath, tag: TelemetryDataTag.CodeArtifact },
|
|
370
|
+
fullPackageName: packagePathToTelemetryProperty(fullPackageName),
|
|
370
371
|
});
|
|
371
372
|
}
|
|
372
373
|
|
|
@@ -384,6 +385,7 @@ export abstract class FluidDataStoreContext
|
|
|
384
385
|
value: this.id,
|
|
385
386
|
tag: TelemetryDataTag.CodeArtifact,
|
|
386
387
|
},
|
|
388
|
+
packageName: packagePathToTelemetryProperty(this.pkg),
|
|
387
389
|
});
|
|
388
390
|
this.channelDeferred?.reject(errorWrapped);
|
|
389
391
|
this.logger.sendErrorEvent({ eventName: "RealizeError" }, errorWrapped);
|
|
@@ -404,18 +406,22 @@ export abstract class FluidDataStoreContext
|
|
|
404
406
|
let lastPkg: string | undefined;
|
|
405
407
|
for (const pkg of packages) {
|
|
406
408
|
if (!registry) {
|
|
407
|
-
this.rejectDeferredRealize("No registry for package", lastPkg);
|
|
409
|
+
this.rejectDeferredRealize("No registry for package", lastPkg, packages);
|
|
408
410
|
}
|
|
409
411
|
lastPkg = pkg;
|
|
410
412
|
entry = await registry.get(pkg);
|
|
411
413
|
if (!entry) {
|
|
412
|
-
this.rejectDeferredRealize(
|
|
414
|
+
this.rejectDeferredRealize(
|
|
415
|
+
"Registry does not contain entry for the package",
|
|
416
|
+
pkg,
|
|
417
|
+
packages,
|
|
418
|
+
);
|
|
413
419
|
}
|
|
414
420
|
registry = entry.IFluidDataStoreRegistry;
|
|
415
421
|
}
|
|
416
422
|
const factory = entry?.IFluidDataStoreFactory;
|
|
417
423
|
if (factory === undefined) {
|
|
418
|
-
this.rejectDeferredRealize("Can't find factory for package", lastPkg);
|
|
424
|
+
this.rejectDeferredRealize("Can't find factory for package", lastPkg, packages);
|
|
419
425
|
}
|
|
420
426
|
|
|
421
427
|
return { factory, registry };
|
|
@@ -671,6 +677,10 @@ export abstract class FluidDataStoreContext
|
|
|
671
677
|
content,
|
|
672
678
|
type,
|
|
673
679
|
};
|
|
680
|
+
|
|
681
|
+
// Summarizer clients should not submit messages.
|
|
682
|
+
this.identifyLocalChangeInSummarizer("DataStoreMessageSubmittedInSummarizer", type);
|
|
683
|
+
|
|
674
684
|
this._containerRuntime.submitDataStoreOp(this.id, fluidDataStoreContent, localOpMetadata);
|
|
675
685
|
}
|
|
676
686
|
|
|
@@ -711,6 +721,15 @@ export abstract class FluidDataStoreContext
|
|
|
711
721
|
*/
|
|
712
722
|
public makeLocallyVisible() {
|
|
713
723
|
assert(this.channel !== undefined, 0x2cf /* "undefined channel on datastore context" */);
|
|
724
|
+
assert(
|
|
725
|
+
this.channel.visibilityState === VisibilityState.LocallyVisible,
|
|
726
|
+
0x590 /* Channel must be locally visible */,
|
|
727
|
+
);
|
|
728
|
+
this.makeLocallyVisibleFn();
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/** @deprecated - To be replaced by calling makeLocallyVisible directly */
|
|
732
|
+
public bindToContext() {
|
|
714
733
|
this.makeLocallyVisibleFn();
|
|
715
734
|
}
|
|
716
735
|
|
|
@@ -792,7 +811,12 @@ export abstract class FluidDataStoreContext
|
|
|
792
811
|
this._isInMemoryRoot = true;
|
|
793
812
|
}
|
|
794
813
|
|
|
795
|
-
|
|
814
|
+
/**
|
|
815
|
+
* @deprecated - The functionality to get base GC details has been moved to summarizer node.
|
|
816
|
+
*/
|
|
817
|
+
public async getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase> {
|
|
818
|
+
return {};
|
|
819
|
+
}
|
|
796
820
|
|
|
797
821
|
public reSubmit(contents: any, localOpMetadata: unknown) {
|
|
798
822
|
assert(!!this.channel, 0x14b /* "Channel must exist when resubmitting ops" */);
|
|
@@ -865,11 +889,40 @@ export abstract class FluidDataStoreContext
|
|
|
865
889
|
}
|
|
866
890
|
}
|
|
867
891
|
|
|
892
|
+
/**
|
|
893
|
+
* Summarizer client should not have local changes. These changes can become part of the summary and can break
|
|
894
|
+
* eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas
|
|
895
|
+
* other clients that are up-to-date till seq# 100 may not have them yet.
|
|
896
|
+
*/
|
|
897
|
+
protected identifyLocalChangeInSummarizer(eventName: string, type?: string) {
|
|
898
|
+
if (
|
|
899
|
+
this.clientDetails.type !== summarizerClientType ||
|
|
900
|
+
this.localChangesTelemetryCount <= 0
|
|
901
|
+
) {
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
// Log a telemetry if there are local changes in the summarizer. This will give us data on how often
|
|
906
|
+
// this is happening and which data stores do this. The eventual goal is to disallow local changes
|
|
907
|
+
// in the summarizer and the data will help us plan this.
|
|
908
|
+
this.mc.logger.sendTelemetryEvent({
|
|
909
|
+
eventName,
|
|
910
|
+
type,
|
|
911
|
+
fluidDataStoreId: {
|
|
912
|
+
value: this.id,
|
|
913
|
+
tag: TelemetryDataTag.CodeArtifact,
|
|
914
|
+
},
|
|
915
|
+
packageName: packagePathToTelemetryProperty(this.pkg),
|
|
916
|
+
isSummaryInProgress: this.summarizerNode.isSummaryInProgress?.(),
|
|
917
|
+
stack: generateStack(),
|
|
918
|
+
});
|
|
919
|
+
this.localChangesTelemetryCount--;
|
|
920
|
+
}
|
|
921
|
+
|
|
868
922
|
public getCreateChildSummarizerNodeFn(id: string, createParam: CreateChildSummarizerNodeParam) {
|
|
869
923
|
return (
|
|
870
924
|
summarizeInternal: SummarizeInternalFn,
|
|
871
925
|
getGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
|
|
872
|
-
getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,
|
|
873
926
|
) =>
|
|
874
927
|
this.summarizerNode.createChild(
|
|
875
928
|
summarizeInternal,
|
|
@@ -878,7 +931,6 @@ export abstract class FluidDataStoreContext
|
|
|
878
931
|
// DDS will not create failure summaries
|
|
879
932
|
{ throwOnFailure: true },
|
|
880
933
|
getGCDataFn,
|
|
881
|
-
getBaseGCDetailsFn,
|
|
882
934
|
);
|
|
883
935
|
}
|
|
884
936
|
|
|
@@ -889,17 +941,13 @@ export abstract class FluidDataStoreContext
|
|
|
889
941
|
|
|
890
942
|
export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
891
943
|
private readonly initSnapshotValue: ISnapshotTree | undefined;
|
|
892
|
-
private readonly baseGCDetailsP: Promise<IGarbageCollectionDetailsBase>;
|
|
893
944
|
|
|
894
945
|
constructor(props: IRemoteFluidDataStoreContextProps) {
|
|
895
|
-
super(props, true /* existing */,
|
|
946
|
+
super(props, true /* existing */, false /* isLocalDataStore */, () => {
|
|
896
947
|
throw new Error("Already attached");
|
|
897
948
|
});
|
|
898
949
|
|
|
899
950
|
this.initSnapshotValue = props.snapshotTree;
|
|
900
|
-
this.baseGCDetailsP = new LazyPromise<IGarbageCollectionDetailsBase>(async () => {
|
|
901
|
-
return (await props.getBaseGCDetails()) ?? {};
|
|
902
|
-
});
|
|
903
951
|
|
|
904
952
|
if (props.snapshotTree !== undefined) {
|
|
905
953
|
this.summarizerNode.updateBaseSummaryState(props.snapshotTree);
|
|
@@ -959,10 +1007,6 @@ export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
959
1007
|
return this.initialSnapshotDetailsP;
|
|
960
1008
|
}
|
|
961
1009
|
|
|
962
|
-
public async getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase> {
|
|
963
|
-
return this.baseGCDetailsP;
|
|
964
|
-
}
|
|
965
|
-
|
|
966
1010
|
public generateAttachMessage(): IAttachMessage {
|
|
967
1011
|
throw new Error("Cannot attach remote store");
|
|
968
1012
|
}
|
|
@@ -982,11 +1026,13 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
982
1026
|
super(
|
|
983
1027
|
props,
|
|
984
1028
|
props.snapshotTree !== undefined ? true : false /* existing */,
|
|
985
|
-
props.snapshotTree ? BindState.Bound : BindState.NotBound,
|
|
986
1029
|
true /* isLocalDataStore */,
|
|
987
1030
|
props.makeLocallyVisibleFn,
|
|
988
1031
|
);
|
|
989
1032
|
|
|
1033
|
+
// Summarizer client should not create local data stores.
|
|
1034
|
+
this.identifyLocalChangeInSummarizer("DataStoreCreatedInSummarizer");
|
|
1035
|
+
|
|
990
1036
|
this.snapshotTree = props.snapshotTree;
|
|
991
1037
|
if (props.isRootDataStore === true) {
|
|
992
1038
|
this.setInMemoryRoot();
|
|
@@ -1078,11 +1124,6 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1078
1124
|
};
|
|
1079
1125
|
}
|
|
1080
1126
|
|
|
1081
|
-
public async getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase> {
|
|
1082
|
-
// Local data store does not have initial summary.
|
|
1083
|
-
return {};
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
1127
|
/**
|
|
1087
1128
|
* A context should only be marked as deleted when its a remote context.
|
|
1088
1129
|
* Session Expiry at the runtime level should have closed the container creating the local data store context
|
package/src/dataStores.ts
CHANGED
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
IEnvelope,
|
|
22
22
|
IFluidDataStoreContextDetached,
|
|
23
23
|
IGarbageCollectionData,
|
|
24
|
-
IGarbageCollectionDetailsBase,
|
|
25
24
|
IInboundSignalMessage,
|
|
26
25
|
InboundAttachMessage,
|
|
27
26
|
ISummarizeResult,
|
|
@@ -45,13 +44,9 @@ import {
|
|
|
45
44
|
} from "@fluidframework/telemetry-utils";
|
|
46
45
|
import { AttachState } from "@fluidframework/container-definitions";
|
|
47
46
|
import { BlobCacheStorageService, buildSnapshotTree } from "@fluidframework/driver-utils";
|
|
48
|
-
import { assert, Lazy
|
|
47
|
+
import { assert, Lazy } from "@fluidframework/common-utils";
|
|
49
48
|
import { v4 as uuid } from "uuid";
|
|
50
|
-
import {
|
|
51
|
-
GCDataBuilder,
|
|
52
|
-
unpackChildNodesGCDetails,
|
|
53
|
-
unpackChildNodesUsedRoutes,
|
|
54
|
-
} from "@fluidframework/garbage-collector";
|
|
49
|
+
import { GCDataBuilder, unpackChildNodesUsedRoutes } from "@fluidframework/garbage-collector";
|
|
55
50
|
import { DataStoreContexts } from "./dataStoreContexts";
|
|
56
51
|
import {
|
|
57
52
|
ContainerRuntime,
|
|
@@ -66,16 +61,19 @@ import {
|
|
|
66
61
|
createAttributesBlob,
|
|
67
62
|
LocalDetachedFluidDataStoreContext,
|
|
68
63
|
} from "./dataStoreContext";
|
|
64
|
+
import { IDataStoreAliasMessage, isDataStoreAliasMessage } from "./dataStore";
|
|
65
|
+
import {
|
|
66
|
+
GCNodeType,
|
|
67
|
+
sweepDatastoresKey,
|
|
68
|
+
throwOnTombstoneLoadKey,
|
|
69
|
+
sendGCUnexpectedUsageEvent,
|
|
70
|
+
} from "./gc";
|
|
69
71
|
import {
|
|
72
|
+
summarizerClientType,
|
|
70
73
|
IContainerRuntimeMetadata,
|
|
71
74
|
nonDataStorePaths,
|
|
72
75
|
rootHasIsolatedChannels,
|
|
73
|
-
} from "./
|
|
74
|
-
import { IDataStoreAliasMessage, isDataStoreAliasMessage } from "./dataStore";
|
|
75
|
-
import { GCNodeType } from "./garbageCollection";
|
|
76
|
-
import { sweepDatastoresKey, throwOnTombstoneLoadKey } from "./garbageCollectionConstants";
|
|
77
|
-
import { summarizerClientType } from "./summarizerClientElection";
|
|
78
|
-
import { sendGCUnexpectedUsageEvent } from "./garbageCollectionHelpers";
|
|
76
|
+
} from "./summary";
|
|
79
77
|
|
|
80
78
|
type PendingAliasResolve = (success: boolean) => void;
|
|
81
79
|
|
|
@@ -123,7 +121,6 @@ export class DataStores implements IDisposable {
|
|
|
123
121
|
) => CreateChildSummarizerNodeFn,
|
|
124
122
|
private readonly deleteChildSummarizerNodeFn: (id: string) => void,
|
|
125
123
|
baseLogger: ITelemetryBaseLogger,
|
|
126
|
-
getBaseGCDetails: () => Promise<IGarbageCollectionDetailsBase>,
|
|
127
124
|
private readonly gcNodeUpdated: (
|
|
128
125
|
nodePath: string,
|
|
129
126
|
timestampMs: number,
|
|
@@ -140,15 +137,6 @@ export class DataStores implements IDisposable {
|
|
|
140
137
|
this.runtime.IFluidHandleContext,
|
|
141
138
|
);
|
|
142
139
|
|
|
143
|
-
const baseGCDetailsP = new LazyPromise(async () => {
|
|
144
|
-
const baseGCDetails = await getBaseGCDetails();
|
|
145
|
-
return unpackChildNodesGCDetails(baseGCDetails);
|
|
146
|
-
});
|
|
147
|
-
// Returns the base GC details for the data store with the given id.
|
|
148
|
-
const dataStoreBaseGCDetails = async (dataStoreId: string) => {
|
|
149
|
-
const baseGCDetails = await baseGCDetailsP;
|
|
150
|
-
return baseGCDetails.get(dataStoreId);
|
|
151
|
-
};
|
|
152
140
|
// Tombstone should only throw when the feature flag is enabled and the client isn't a summarizer
|
|
153
141
|
this.throwOnTombstoneLoad =
|
|
154
142
|
this.mc.config.getBoolean(throwOnTombstoneLoadKey) === true &&
|
|
@@ -177,7 +165,6 @@ export class DataStores implements IDisposable {
|
|
|
177
165
|
dataStoreContext = new RemoteFluidDataStoreContext({
|
|
178
166
|
id: key,
|
|
179
167
|
snapshotTree: value,
|
|
180
|
-
getBaseGCDetails: async () => dataStoreBaseGCDetails(key),
|
|
181
168
|
runtime: this.runtime,
|
|
182
169
|
storage: this.runtime.storage,
|
|
183
170
|
scope: this.runtime.scope,
|
|
@@ -270,10 +257,6 @@ export class DataStores implements IDisposable {
|
|
|
270
257
|
const remoteFluidDataStoreContext = new RemoteFluidDataStoreContext({
|
|
271
258
|
id: attachMessage.id,
|
|
272
259
|
snapshotTree,
|
|
273
|
-
// New data stores begin with empty GC details since GC hasn't run on them yet.
|
|
274
|
-
getBaseGCDetails: async () => {
|
|
275
|
-
return {};
|
|
276
|
-
},
|
|
277
260
|
runtime: this.runtime,
|
|
278
261
|
storage: new BlobCacheStorageService(this.runtime.storage, flatBlobs),
|
|
279
262
|
scope: this.runtime.scope,
|
|
@@ -448,6 +431,8 @@ export class DataStores implements IDisposable {
|
|
|
448
431
|
) {
|
|
449
432
|
const envelope = message.contents as IEnvelope;
|
|
450
433
|
const transformed = { ...message, contents: envelope.contents };
|
|
434
|
+
const request = { url: envelope.address };
|
|
435
|
+
this.validateNotDeleted(envelope.address, request);
|
|
451
436
|
const context = this.contexts.get(envelope.address);
|
|
452
437
|
assert(!!context, 0x162 /* "There should be a store context for the op" */);
|
|
453
438
|
context.process(transformed, local, localMessageMetadata);
|
|
@@ -491,7 +476,7 @@ export class DataStores implements IDisposable {
|
|
|
491
476
|
private validateNotDeleted(
|
|
492
477
|
id: string,
|
|
493
478
|
request: IRequest,
|
|
494
|
-
requestHeaderData
|
|
479
|
+
requestHeaderData?: RuntimeHeaderData,
|
|
495
480
|
) {
|
|
496
481
|
const dataStoreNodePath = `/${id}`;
|
|
497
482
|
if (this.isDataStoreDeleted(dataStoreNodePath)) {
|
|
@@ -562,6 +547,8 @@ export class DataStores implements IDisposable {
|
|
|
562
547
|
}
|
|
563
548
|
|
|
564
549
|
public processSignal(address: string, message: IInboundSignalMessage, local: boolean) {
|
|
550
|
+
const request = { url: address };
|
|
551
|
+
this.validateNotDeleted(address, request);
|
|
565
552
|
const context = this.contexts.get(address);
|
|
566
553
|
if (!context) {
|
|
567
554
|
// Attach message may not have been processed yet
|
|
@@ -621,10 +608,11 @@ export class DataStores implements IDisposable {
|
|
|
621
608
|
await Promise.all(
|
|
622
609
|
Array.from(this.contexts)
|
|
623
610
|
.filter(([_, context]) => {
|
|
624
|
-
// Summarizer works only with clients with no local changes
|
|
611
|
+
// Summarizer works only with clients with no local changes. A data store in attaching
|
|
612
|
+
// state indicates an op was sent to attach a local data store.
|
|
625
613
|
assert(
|
|
626
614
|
context.attachState !== AttachState.Attaching,
|
|
627
|
-
|
|
615
|
+
0x588 /* Local data store detected in attaching state during summarize */,
|
|
628
616
|
);
|
|
629
617
|
return context.attachState === AttachState.Attached;
|
|
630
618
|
})
|
|
@@ -722,8 +710,12 @@ export class DataStores implements IDisposable {
|
|
|
722
710
|
await Promise.all(
|
|
723
711
|
Array.from(this.contexts)
|
|
724
712
|
.filter(([_, context]) => {
|
|
725
|
-
//
|
|
726
|
-
//
|
|
713
|
+
// Summarizer client and hence GC works only with clients with no local changes. A data store in
|
|
714
|
+
// attaching state indicates an op was sent to attach a local data store.
|
|
715
|
+
assert(
|
|
716
|
+
context.attachState !== AttachState.Attaching,
|
|
717
|
+
0x589 /* Local data store detected in attaching state while running GC */,
|
|
718
|
+
);
|
|
727
719
|
return context.attachState === AttachState.Attached;
|
|
728
720
|
})
|
|
729
721
|
.map(async ([contextId, context]) => {
|
|
@@ -783,43 +775,44 @@ export class DataStores implements IDisposable {
|
|
|
783
775
|
}
|
|
784
776
|
|
|
785
777
|
/**
|
|
786
|
-
*
|
|
787
|
-
*
|
|
788
|
-
*
|
|
789
|
-
* @returns - routes of
|
|
790
|
-
* and other state
|
|
778
|
+
* Delete data stores and its objects that are sweep ready.
|
|
779
|
+
* @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should
|
|
780
|
+
* be deleted.
|
|
781
|
+
* @returns - The routes of data stores and its objects that were deleted.
|
|
791
782
|
*/
|
|
792
|
-
public
|
|
783
|
+
public deleteSweepReadyNodes(sweepReadyDataStoreRoutes: string[]): string[] {
|
|
784
|
+
// If sweep for data stores is not enabled, return empty list indicating nothing is deleted.
|
|
793
785
|
if (this.mc.config.getBoolean(sweepDatastoresKey) !== true) {
|
|
794
786
|
return [];
|
|
795
787
|
}
|
|
796
|
-
const
|
|
797
|
-
|
|
798
|
-
for (const route of unusedRoutes) {
|
|
788
|
+
for (const route of sweepReadyDataStoreRoutes) {
|
|
799
789
|
const pathParts = route.split("/");
|
|
800
790
|
const dataStoreId = pathParts[1];
|
|
801
791
|
|
|
802
792
|
// TODO: GC:Validation - Skip any routes already deleted
|
|
803
|
-
|
|
804
|
-
//
|
|
805
|
-
deletedRoutes.add(route);
|
|
806
|
-
|
|
807
|
-
// 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.
|
|
793
|
+
// Ignore sub-data store routes because a data store and its sub-routes are deleted together, so, we only
|
|
794
|
+
// need to delete the data store.
|
|
808
795
|
if (pathParts.length > 2) {
|
|
809
796
|
continue;
|
|
810
797
|
}
|
|
811
798
|
|
|
799
|
+
if (!this.contexts.has(dataStoreId)) {
|
|
800
|
+
this.mc.logger.sendErrorEvent({
|
|
801
|
+
eventName: "DeletedDataStoreNotFound",
|
|
802
|
+
dataStoreId,
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
|
|
812
806
|
const dataStore = this.contexts.get(dataStoreId);
|
|
813
807
|
assert(dataStore !== undefined, 0x571 /* Attempting to delete unknown dataStore */);
|
|
814
808
|
dataStore.delete();
|
|
815
809
|
|
|
816
|
-
// Delete the contexts of
|
|
810
|
+
// Delete the contexts of sweep ready data stores.
|
|
817
811
|
this.contexts.delete(dataStoreId);
|
|
818
|
-
// Delete the summarizer node of the
|
|
812
|
+
// Delete the summarizer node of the sweep ready data stores.
|
|
819
813
|
this.deleteChildSummarizerNodeFn(dataStoreId);
|
|
820
814
|
}
|
|
821
|
-
|
|
822
|
-
return Array.from(deletedRoutes);
|
|
815
|
+
return Array.from(sweepReadyDataStoreRoutes);
|
|
823
816
|
}
|
|
824
817
|
|
|
825
818
|
/**
|
|
@@ -18,7 +18,7 @@ Currently, the only Fluid objects that are eligible for GC are data stores and a
|
|
|
18
18
|
|
|
19
19
|
There are 2 ways to reference a data store:
|
|
20
20
|
|
|
21
|
-
- Store the data stores's handle (see [IFluidHandle](
|
|
21
|
+
- Store the data stores's handle (see [IFluidHandle](../../../../../packages/common/core-interfaces/src/handles.ts) in a referenced DDS that supports handle in its data. For example, a data store's handle can be stored in a referenced `SharedMap` DDS.
|
|
22
22
|
|
|
23
23
|
Note that storing a handle of any of a data store's DDS will also mark the data store as referenced.
|
|
24
24
|
|
|
@@ -50,7 +50,7 @@ Mark phase is enabled by default for a container. It is enabled during creation
|
|
|
50
50
|
|
|
51
51
|
If you wish to disable this, set the `gcAllowed` option to `false` in `IGCRuntimeOptions`. These options are under `IContainerRuntimeOptions` and are passed to the container runtime during its creation. Note that this will disable GC permanently (including the sweep phase) for the container during its lifetime.
|
|
52
52
|
|
|
53
|
-
See `IGCRuntimeOptions` in [containerRuntime.ts](
|
|
53
|
+
See `IGCRuntimeOptions` in [containerRuntime.ts](../containerRuntime.ts) for more options to control GC behavior.
|
|
54
54
|
|
|
55
55
|
### Sweep phase
|
|
56
56
|
|