@fluidframework/container-runtime 2.0.0-internal.8.0.1 → 2.0.0-rc.1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +1 -7
- package/api-extractor-esm.json +4 -0
- package/api-extractor-lint.json +1 -10
- package/api-extractor.json +1 -9
- package/api-report/container-runtime.api.md +18 -17
- package/dist/blobManager.d.ts +8 -3
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +15 -4
- package/dist/blobManager.js.map +1 -1
- package/dist/container-runtime-alpha.d.ts +265 -17
- package/dist/container-runtime-beta.d.ts +0 -42
- package/dist/container-runtime-public.d.ts +0 -42
- package/dist/container-runtime-untrimmed.d.ts +32 -17
- package/dist/containerRuntime.d.ts +8 -4
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +15 -29
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +5 -2
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +10 -3
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +10 -3
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +51 -8
- package/dist/dataStores.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +15 -4
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +26 -19
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +29 -6
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +5 -3
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +13 -6
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +18 -9
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/index.d.ts +1 -1
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +2 -1
- package/dist/gc/index.js.map +1 -1
- package/dist/messageTypes.d.ts +1 -1
- package/dist/messageTypes.js +1 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +1 -1
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +4 -4
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +4 -1
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +5 -0
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +46 -17
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +1 -1
- package/dist/summary/summarizer.js +1 -1
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +3 -1
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +7 -7
- package/dist/summary/summaryCollection.js +1 -1
- package/dist/summary/summaryCollection.js.map +1 -1
- package/lib/{batchTracker.d.ts → batchTracker.d.mts} +1 -1
- package/lib/batchTracker.d.mts.map +1 -0
- package/lib/{batchTracker.js → batchTracker.mjs} +1 -1
- package/lib/batchTracker.mjs.map +1 -0
- package/lib/{blobManager.d.ts → blobManager.d.mts} +9 -4
- package/lib/blobManager.d.mts.map +1 -0
- package/lib/{blobManager.js → blobManager.mjs} +17 -6
- package/lib/blobManager.mjs.map +1 -0
- package/lib/{connectionTelemetry.d.ts → connectionTelemetry.d.mts} +1 -1
- package/lib/connectionTelemetry.d.mts.map +1 -0
- package/lib/{connectionTelemetry.js → connectionTelemetry.mjs} +1 -1
- package/lib/connectionTelemetry.mjs.map +1 -0
- package/lib/{container-runtime-alpha.d.ts → container-runtime-alpha.d.mts} +265 -17
- package/lib/{container-runtime-beta.d.ts → container-runtime-beta.d.mts} +0 -42
- package/lib/{container-runtime-public.d.ts → container-runtime-public.d.mts} +0 -42
- package/lib/{container-runtime-untrimmed.d.ts → container-runtime-untrimmed.d.mts} +32 -17
- package/lib/{containerHandleContext.d.ts → containerHandleContext.d.mts} +2 -2
- package/lib/containerHandleContext.d.mts.map +1 -0
- package/lib/{containerHandleContext.js → containerHandleContext.mjs} +1 -1
- package/lib/containerHandleContext.mjs.map +1 -0
- package/lib/{containerRuntime.d.ts → containerRuntime.d.mts} +14 -14
- package/lib/containerRuntime.d.mts.map +1 -0
- package/lib/{containerRuntime.js → containerRuntime.mjs} +31 -22
- package/lib/containerRuntime.mjs.map +1 -0
- package/lib/{dataStore.d.ts → dataStore.d.mts} +3 -3
- package/lib/dataStore.d.mts.map +1 -0
- package/lib/{dataStore.js → dataStore.mjs} +1 -1
- package/lib/dataStore.mjs.map +1 -0
- package/lib/{dataStoreContext.d.ts → dataStoreContext.d.mts} +7 -4
- package/lib/dataStoreContext.d.mts.map +1 -0
- package/lib/{dataStoreContext.js → dataStoreContext.mjs} +13 -6
- package/lib/dataStoreContext.mjs.map +1 -0
- package/lib/{dataStoreContexts.d.ts → dataStoreContexts.d.mts} +2 -2
- package/lib/dataStoreContexts.d.mts.map +1 -0
- package/lib/{dataStoreContexts.js → dataStoreContexts.mjs} +1 -1
- package/lib/dataStoreContexts.mjs.map +1 -0
- package/lib/{dataStoreRegistry.d.ts → dataStoreRegistry.d.mts} +1 -1
- package/lib/dataStoreRegistry.d.mts.map +1 -0
- package/lib/{dataStoreRegistry.js → dataStoreRegistry.mjs} +1 -5
- package/lib/dataStoreRegistry.mjs.map +1 -0
- package/lib/{dataStores.d.ts → dataStores.d.mts} +17 -10
- package/lib/dataStores.d.mts.map +1 -0
- package/lib/{dataStores.js → dataStores.mjs} +58 -16
- package/lib/dataStores.mjs.map +1 -0
- package/lib/{deltaManagerProxyBase.d.ts → deltaManagerProxyBase.d.mts} +1 -1
- package/lib/deltaManagerProxyBase.d.mts.map +1 -0
- package/lib/{deltaManagerProxyBase.js → deltaManagerProxyBase.mjs} +1 -1
- package/lib/deltaManagerProxyBase.mjs.map +1 -0
- package/lib/{deltaManagerSummarizerProxy.d.ts → deltaManagerSummarizerProxy.d.mts} +2 -2
- package/lib/deltaManagerSummarizerProxy.d.mts.map +1 -0
- package/lib/{deltaManagerSummarizerProxy.js → deltaManagerSummarizerProxy.mjs} +3 -3
- package/lib/deltaManagerSummarizerProxy.mjs.map +1 -0
- package/lib/{deltaScheduler.d.ts → deltaScheduler.d.mts} +1 -1
- package/lib/deltaScheduler.d.mts.map +1 -0
- package/lib/{deltaScheduler.js → deltaScheduler.mjs} +1 -1
- package/lib/deltaScheduler.mjs.map +1 -0
- package/lib/{error.d.ts → error.d.mts} +1 -1
- package/lib/error.d.mts.map +1 -0
- package/lib/{error.js → error.mjs} +1 -1
- package/lib/error.mjs.map +1 -0
- package/lib/gc/{garbageCollection.d.ts → garbageCollection.d.mts} +5 -5
- package/lib/gc/garbageCollection.d.mts.map +1 -0
- package/lib/gc/{garbageCollection.js → garbageCollection.mjs} +28 -17
- package/lib/gc/garbageCollection.mjs.map +1 -0
- package/lib/gc/{gcConfigs.d.ts → gcConfigs.d.mts} +3 -3
- package/lib/gc/gcConfigs.d.mts.map +1 -0
- package/lib/gc/{gcConfigs.js → gcConfigs.mjs} +29 -22
- package/lib/gc/gcConfigs.mjs.map +1 -0
- package/lib/gc/{gcDefinitions.d.ts → gcDefinitions.d.mts} +33 -10
- package/lib/gc/gcDefinitions.d.mts.map +1 -0
- package/lib/gc/{gcDefinitions.js → gcDefinitions.mjs} +5 -3
- package/lib/gc/gcDefinitions.mjs.map +1 -0
- package/lib/gc/{gcHelpers.d.ts → gcHelpers.d.mts} +3 -3
- package/lib/gc/{gcHelpers.d.ts.map → gcHelpers.d.mts.map} +1 -1
- package/lib/gc/{gcHelpers.js → gcHelpers.mjs} +1 -1
- package/lib/gc/gcHelpers.mjs.map +1 -0
- package/lib/gc/{gcReferenceGraphAlgorithm.d.ts → gcReferenceGraphAlgorithm.d.mts} +2 -2
- package/lib/gc/gcReferenceGraphAlgorithm.d.mts.map +1 -0
- package/lib/gc/{gcReferenceGraphAlgorithm.js → gcReferenceGraphAlgorithm.mjs} +1 -1
- package/lib/gc/gcReferenceGraphAlgorithm.mjs.map +1 -0
- package/lib/gc/{gcSummaryDefinitions.d.ts → gcSummaryDefinitions.d.mts} +1 -1
- package/lib/gc/gcSummaryDefinitions.d.mts.map +1 -0
- package/lib/gc/{gcSummaryDefinitions.js → gcSummaryDefinitions.mjs} +1 -1
- package/lib/gc/gcSummaryDefinitions.mjs.map +1 -0
- package/lib/gc/{gcSummaryStateTracker.d.ts → gcSummaryStateTracker.d.mts} +4 -4
- package/lib/gc/gcSummaryStateTracker.d.mts.map +1 -0
- package/lib/gc/{gcSummaryStateTracker.js → gcSummaryStateTracker.mjs} +2 -2
- package/lib/gc/gcSummaryStateTracker.mjs.map +1 -0
- package/lib/gc/{gcTelemetry.d.ts → gcTelemetry.d.mts} +18 -11
- package/lib/gc/gcTelemetry.d.mts.map +1 -0
- package/lib/gc/{gcTelemetry.js → gcTelemetry.mjs} +20 -11
- package/lib/gc/gcTelemetry.mjs.map +1 -0
- package/lib/gc/{gcUnreferencedStateTracker.d.ts → gcUnreferencedStateTracker.d.mts} +2 -2
- package/lib/gc/gcUnreferencedStateTracker.d.mts.map +1 -0
- package/lib/gc/{gcUnreferencedStateTracker.js → gcUnreferencedStateTracker.mjs} +2 -2
- package/lib/gc/gcUnreferencedStateTracker.mjs.map +1 -0
- package/lib/gc/{index.d.ts → index.d.mts} +9 -9
- package/lib/gc/index.d.mts.map +1 -0
- package/lib/gc/{index.js → index.mjs} +8 -8
- package/lib/gc/index.mjs.map +1 -0
- package/lib/{index.d.ts → index.d.mts} +8 -8
- package/lib/index.d.mts.map +1 -0
- package/lib/{index.js → index.mjs} +7 -9
- package/lib/index.mjs.map +1 -0
- package/lib/{messageTypes.d.ts → messageTypes.d.mts} +5 -5
- package/lib/messageTypes.d.mts.map +1 -0
- package/lib/{messageTypes.js → messageTypes.mjs} +2 -2
- package/lib/messageTypes.mjs.map +1 -0
- package/lib/{metadata.d.ts → metadata.d.mts} +1 -1
- package/lib/metadata.d.mts.map +1 -0
- package/lib/{metadata.js → metadata.mjs} +1 -1
- package/lib/metadata.mjs.map +1 -0
- package/lib/opLifecycle/{batchManager.d.ts → batchManager.d.mts} +3 -3
- package/lib/opLifecycle/batchManager.d.mts.map +1 -0
- package/lib/opLifecycle/{batchManager.js → batchManager.mjs} +1 -1
- package/lib/opLifecycle/batchManager.mjs.map +1 -0
- package/lib/opLifecycle/{definitions.d.ts → definitions.d.mts} +3 -3
- package/lib/opLifecycle/definitions.d.mts.map +1 -0
- package/lib/opLifecycle/{definitions.js → definitions.mjs} +1 -1
- package/lib/opLifecycle/definitions.mjs.map +1 -0
- package/lib/opLifecycle/index.d.mts +13 -0
- package/lib/opLifecycle/index.d.mts.map +1 -0
- package/lib/opLifecycle/index.mjs +12 -0
- package/lib/opLifecycle/index.mjs.map +1 -0
- package/lib/opLifecycle/{opCompressor.d.ts → opCompressor.d.mts} +2 -2
- package/lib/opLifecycle/opCompressor.d.mts.map +1 -0
- package/lib/opLifecycle/{opCompressor.js → opCompressor.mjs} +3 -3
- package/lib/opLifecycle/opCompressor.mjs.map +1 -0
- package/lib/opLifecycle/{opDecompressor.d.ts → opDecompressor.d.mts} +2 -2
- package/lib/opLifecycle/opDecompressor.d.mts.map +1 -0
- package/lib/opLifecycle/{opDecompressor.js → opDecompressor.mjs} +2 -2
- package/lib/opLifecycle/opDecompressor.mjs.map +1 -0
- package/lib/opLifecycle/{opGroupingManager.d.ts → opGroupingManager.d.mts} +2 -2
- package/lib/opLifecycle/opGroupingManager.d.mts.map +1 -0
- package/lib/opLifecycle/{opGroupingManager.js → opGroupingManager.mjs} +1 -1
- package/lib/opLifecycle/opGroupingManager.mjs.map +1 -0
- package/lib/opLifecycle/{opSplitter.d.ts → opSplitter.d.mts} +2 -2
- package/lib/opLifecycle/opSplitter.d.mts.map +1 -0
- package/lib/opLifecycle/{opSplitter.js → opSplitter.mjs} +3 -3
- package/lib/opLifecycle/opSplitter.mjs.map +1 -0
- package/lib/opLifecycle/{outbox.d.ts → outbox.d.mts} +11 -11
- package/lib/opLifecycle/outbox.d.mts.map +1 -0
- package/lib/opLifecycle/{outbox.js → outbox.mjs} +6 -3
- package/lib/opLifecycle/outbox.mjs.map +1 -0
- package/lib/opLifecycle/{remoteMessageProcessor.d.ts → remoteMessageProcessor.d.mts} +5 -5
- package/lib/opLifecycle/remoteMessageProcessor.d.mts.map +1 -0
- package/lib/opLifecycle/{remoteMessageProcessor.js → remoteMessageProcessor.mjs} +2 -2
- package/lib/opLifecycle/remoteMessageProcessor.mjs.map +1 -0
- package/lib/{opProperties.d.ts → opProperties.d.mts} +1 -1
- package/lib/opProperties.d.mts.map +1 -0
- package/lib/{opProperties.js → opProperties.mjs} +1 -1
- package/lib/opProperties.mjs.map +1 -0
- package/lib/{packageVersion.d.ts → packageVersion.d.mts} +2 -2
- package/lib/packageVersion.d.mts.map +1 -0
- package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
- package/lib/packageVersion.mjs.map +1 -0
- package/lib/{pendingStateManager.d.ts → pendingStateManager.d.mts} +2 -2
- package/lib/pendingStateManager.d.mts.map +1 -0
- package/lib/{pendingStateManager.js → pendingStateManager.mjs} +2 -2
- package/lib/pendingStateManager.mjs.map +1 -0
- package/lib/{scheduleManager.d.ts → scheduleManager.d.mts} +1 -5
- package/lib/scheduleManager.d.mts.map +1 -0
- package/lib/{scheduleManager.js → scheduleManager.mjs} +3 -3
- package/lib/scheduleManager.mjs.map +1 -0
- package/lib/{storageServiceWithAttachBlobs.d.ts → storageServiceWithAttachBlobs.d.mts} +1 -1
- package/lib/storageServiceWithAttachBlobs.d.mts.map +1 -0
- package/lib/{storageServiceWithAttachBlobs.js → storageServiceWithAttachBlobs.mjs} +1 -1
- package/lib/storageServiceWithAttachBlobs.mjs.map +1 -0
- package/lib/summary/{index.d.ts → index.d.mts} +13 -13
- package/lib/summary/index.d.mts.map +1 -0
- package/lib/summary/{index.js → index.mjs} +12 -12
- package/lib/summary/index.mjs.map +1 -0
- package/lib/summary/{orderedClientElection.d.ts → orderedClientElection.d.mts} +1 -5
- package/lib/summary/orderedClientElection.d.mts.map +1 -0
- package/lib/summary/{orderedClientElection.js → orderedClientElection.mjs} +2 -2
- package/lib/summary/orderedClientElection.mjs.map +1 -0
- package/lib/summary/{runWhileConnectedCoordinator.d.ts → runWhileConnectedCoordinator.d.mts} +3 -3
- package/lib/summary/runWhileConnectedCoordinator.d.mts.map +1 -0
- package/lib/summary/{runWhileConnectedCoordinator.js → runWhileConnectedCoordinator.mjs} +1 -1
- package/lib/summary/runWhileConnectedCoordinator.mjs.map +1 -0
- package/lib/summary/{runningSummarizer.d.ts → runningSummarizer.d.mts} +10 -5
- package/lib/summary/runningSummarizer.d.mts.map +1 -0
- package/lib/summary/{runningSummarizer.js → runningSummarizer.mjs} +50 -21
- package/lib/summary/runningSummarizer.mjs.map +1 -0
- package/lib/summary/{summarizer.d.ts → summarizer.d.mts} +6 -6
- package/lib/summary/summarizer.d.mts.map +1 -0
- package/lib/summary/{summarizer.js → summarizer.mjs} +5 -5
- package/lib/summary/summarizer.mjs.map +1 -0
- package/lib/summary/{summarizerClientElection.d.ts → summarizerClientElection.d.mts} +3 -3
- package/lib/summary/summarizerClientElection.d.mts.map +1 -0
- package/lib/summary/{summarizerClientElection.js → summarizerClientElection.mjs} +1 -1
- package/lib/summary/summarizerClientElection.mjs.map +1 -0
- package/lib/summary/{summarizerHeuristics.d.ts → summarizerHeuristics.d.mts} +4 -4
- package/lib/summary/summarizerHeuristics.d.mts.map +1 -0
- package/lib/summary/{summarizerHeuristics.js → summarizerHeuristics.mjs} +1 -1
- package/lib/summary/summarizerHeuristics.mjs.map +1 -0
- package/lib/summary/summarizerNode/{index.d.ts → index.d.mts} +4 -4
- package/lib/summary/summarizerNode/index.d.mts.map +1 -0
- package/lib/summary/summarizerNode/{index.js → index.mjs} +3 -3
- package/lib/summary/summarizerNode/index.mjs.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNode.d.ts → summarizerNode.d.mts} +2 -2
- package/lib/summary/summarizerNode/summarizerNode.d.mts.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNode.js → summarizerNode.mjs} +2 -2
- package/lib/summary/summarizerNode/summarizerNode.mjs.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeUtils.d.ts → summarizerNodeUtils.d.mts} +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.mts.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeUtils.js → summarizerNodeUtils.mjs} +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.mjs.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeWithGc.d.ts → summarizerNodeWithGc.d.mts} +3 -3
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.mts.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeWithGc.js → summarizerNodeWithGc.mjs} +4 -4
- package/lib/summary/summarizerNode/summarizerNodeWithGc.mjs.map +1 -0
- package/lib/summary/{summarizerTypes.d.ts → summarizerTypes.d.mts} +7 -5
- package/lib/summary/summarizerTypes.d.mts.map +1 -0
- package/lib/summary/{summarizerTypes.js → summarizerTypes.mjs} +1 -1
- package/lib/summary/summarizerTypes.mjs.map +1 -0
- package/lib/summary/{summaryCollection.d.ts → summaryCollection.d.mts} +8 -8
- package/lib/summary/summaryCollection.d.mts.map +1 -0
- package/lib/summary/{summaryCollection.js → summaryCollection.mjs} +2 -2
- package/lib/summary/summaryCollection.mjs.map +1 -0
- package/lib/summary/{summaryFormat.d.ts → summaryFormat.d.mts} +2 -2
- package/lib/summary/summaryFormat.d.mts.map +1 -0
- package/lib/summary/{summaryFormat.js → summaryFormat.mjs} +1 -1
- package/lib/summary/summaryFormat.mjs.map +1 -0
- package/lib/summary/{summaryGenerator.d.ts → summaryGenerator.d.mts} +3 -3
- package/lib/summary/summaryGenerator.d.mts.map +1 -0
- package/lib/summary/{summaryGenerator.js → summaryGenerator.mjs} +1 -1
- package/lib/summary/summaryGenerator.mjs.map +1 -0
- package/lib/summary/{summaryManager.d.ts → summaryManager.d.mts} +5 -5
- package/lib/summary/summaryManager.d.mts.map +1 -0
- package/lib/summary/{summaryManager.js → summaryManager.mjs} +2 -2
- package/lib/summary/summaryManager.mjs.map +1 -0
- package/lib/{throttler.d.ts → throttler.d.mts} +1 -1
- package/lib/throttler.d.mts.map +1 -0
- package/lib/{throttler.js → throttler.mjs} +1 -1
- package/lib/throttler.mjs.map +1 -0
- package/package.json +145 -39
- package/src/blobManager.ts +15 -4
- package/src/containerRuntime.ts +15 -4
- package/src/dataStoreContext.ts +11 -4
- package/src/dataStores.ts +61 -7
- package/src/gc/garbageCollection.ts +18 -4
- package/src/gc/gcConfigs.ts +28 -20
- package/src/gc/gcDefinitions.ts +30 -6
- package/src/gc/gcTelemetry.ts +19 -9
- package/src/gc/index.ts +3 -0
- package/src/messageTypes.ts +1 -1
- package/src/opLifecycle/definitions.ts +1 -1
- package/src/opLifecycle/outbox.ts +5 -2
- package/src/packageVersion.ts +1 -1
- package/src/summary/runWhileConnectedCoordinator.ts +1 -1
- package/src/summary/runningSummarizer.ts +58 -25
- package/src/summary/summarizer.ts +1 -1
- package/src/summary/summarizerTypes.ts +3 -1
- package/src/summary/summaryCollection.ts +7 -7
- package/tsconfig.json +6 -4
- package/lib/batchTracker.d.ts.map +0 -1
- package/lib/batchTracker.js.map +0 -1
- package/lib/blobManager.d.ts.map +0 -1
- package/lib/blobManager.js.map +0 -1
- package/lib/connectionTelemetry.d.ts.map +0 -1
- package/lib/connectionTelemetry.js.map +0 -1
- package/lib/containerHandleContext.d.ts.map +0 -1
- package/lib/containerHandleContext.js.map +0 -1
- package/lib/containerRuntime.d.ts.map +0 -1
- package/lib/containerRuntime.js.map +0 -1
- package/lib/dataStore.d.ts.map +0 -1
- package/lib/dataStore.js.map +0 -1
- package/lib/dataStoreContext.d.ts.map +0 -1
- package/lib/dataStoreContext.js.map +0 -1
- package/lib/dataStoreContexts.d.ts.map +0 -1
- package/lib/dataStoreContexts.js.map +0 -1
- package/lib/dataStoreRegistry.d.ts.map +0 -1
- package/lib/dataStoreRegistry.js.map +0 -1
- package/lib/dataStores.d.ts.map +0 -1
- package/lib/dataStores.js.map +0 -1
- package/lib/deltaManagerProxyBase.d.ts.map +0 -1
- package/lib/deltaManagerProxyBase.js.map +0 -1
- package/lib/deltaManagerSummarizerProxy.d.ts.map +0 -1
- package/lib/deltaManagerSummarizerProxy.js.map +0 -1
- package/lib/deltaScheduler.d.ts.map +0 -1
- package/lib/deltaScheduler.js.map +0 -1
- package/lib/error.d.ts.map +0 -1
- package/lib/error.js.map +0 -1
- package/lib/gc/garbageCollection.d.ts.map +0 -1
- package/lib/gc/garbageCollection.js.map +0 -1
- package/lib/gc/gcConfigs.d.ts.map +0 -1
- package/lib/gc/gcConfigs.js.map +0 -1
- package/lib/gc/gcDefinitions.d.ts.map +0 -1
- package/lib/gc/gcDefinitions.js.map +0 -1
- package/lib/gc/gcHelpers.js.map +0 -1
- package/lib/gc/gcReferenceGraphAlgorithm.d.ts.map +0 -1
- package/lib/gc/gcReferenceGraphAlgorithm.js.map +0 -1
- package/lib/gc/gcSummaryDefinitions.d.ts.map +0 -1
- package/lib/gc/gcSummaryDefinitions.js.map +0 -1
- package/lib/gc/gcSummaryStateTracker.d.ts.map +0 -1
- package/lib/gc/gcSummaryStateTracker.js.map +0 -1
- package/lib/gc/gcTelemetry.d.ts.map +0 -1
- package/lib/gc/gcTelemetry.js.map +0 -1
- package/lib/gc/gcUnreferencedStateTracker.d.ts.map +0 -1
- package/lib/gc/gcUnreferencedStateTracker.js.map +0 -1
- package/lib/gc/index.d.ts.map +0 -1
- package/lib/gc/index.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/messageTypes.d.ts.map +0 -1
- package/lib/messageTypes.js.map +0 -1
- package/lib/metadata.d.ts.map +0 -1
- package/lib/metadata.js.map +0 -1
- package/lib/opLifecycle/batchManager.d.ts.map +0 -1
- package/lib/opLifecycle/batchManager.js.map +0 -1
- package/lib/opLifecycle/definitions.d.ts.map +0 -1
- package/lib/opLifecycle/definitions.js.map +0 -1
- package/lib/opLifecycle/index.d.ts +0 -13
- package/lib/opLifecycle/index.d.ts.map +0 -1
- package/lib/opLifecycle/index.js +0 -12
- package/lib/opLifecycle/index.js.map +0 -1
- package/lib/opLifecycle/opCompressor.d.ts.map +0 -1
- package/lib/opLifecycle/opCompressor.js.map +0 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +0 -1
- package/lib/opLifecycle/opDecompressor.js.map +0 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +0 -1
- package/lib/opLifecycle/opGroupingManager.js.map +0 -1
- package/lib/opLifecycle/opSplitter.d.ts.map +0 -1
- package/lib/opLifecycle/opSplitter.js.map +0 -1
- package/lib/opLifecycle/outbox.d.ts.map +0 -1
- package/lib/opLifecycle/outbox.js.map +0 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +0 -1
- package/lib/opLifecycle/remoteMessageProcessor.js.map +0 -1
- package/lib/opProperties.d.ts.map +0 -1
- package/lib/opProperties.js.map +0 -1
- package/lib/packageVersion.d.ts.map +0 -1
- package/lib/packageVersion.js.map +0 -1
- package/lib/pendingStateManager.d.ts.map +0 -1
- package/lib/pendingStateManager.js.map +0 -1
- package/lib/scheduleManager.d.ts.map +0 -1
- package/lib/scheduleManager.js.map +0 -1
- package/lib/storageServiceWithAttachBlobs.d.ts.map +0 -1
- package/lib/storageServiceWithAttachBlobs.js.map +0 -1
- package/lib/summary/index.d.ts.map +0 -1
- package/lib/summary/index.js.map +0 -1
- package/lib/summary/orderedClientElection.d.ts.map +0 -1
- package/lib/summary/orderedClientElection.js.map +0 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +0 -1
- package/lib/summary/runWhileConnectedCoordinator.js.map +0 -1
- package/lib/summary/runningSummarizer.d.ts.map +0 -1
- package/lib/summary/runningSummarizer.js.map +0 -1
- package/lib/summary/summarizer.d.ts.map +0 -1
- package/lib/summary/summarizer.js.map +0 -1
- package/lib/summary/summarizerClientElection.d.ts.map +0 -1
- package/lib/summary/summarizerClientElection.js.map +0 -1
- package/lib/summary/summarizerHeuristics.d.ts.map +0 -1
- package/lib/summary/summarizerHeuristics.js.map +0 -1
- package/lib/summary/summarizerNode/index.d.ts.map +0 -1
- package/lib/summary/summarizerNode/index.js.map +0 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +0 -1
- package/lib/summary/summarizerNode/summarizerNode.js.map +0 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +0 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +0 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +0 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +0 -1
- package/lib/summary/summarizerTypes.d.ts.map +0 -1
- package/lib/summary/summarizerTypes.js.map +0 -1
- package/lib/summary/summaryCollection.d.ts.map +0 -1
- package/lib/summary/summaryCollection.js.map +0 -1
- package/lib/summary/summaryFormat.d.ts.map +0 -1
- package/lib/summary/summaryFormat.js.map +0 -1
- package/lib/summary/summaryGenerator.d.ts.map +0 -1
- package/lib/summary/summaryGenerator.js.map +0 -1
- package/lib/summary/summaryManager.d.ts.map +0 -1
- package/lib/summary/summaryManager.js.map +0 -1
- package/lib/throttler.d.ts.map +0 -1
- package/lib/throttler.js.map +0 -1
- package/tsconfig.esnext.json +0 -7
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"garbageCollection.js","sourceRoot":"","sources":["../../src/gc/garbageCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExE,OAAO,EACN,SAAS,GAKT,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EACN,iBAAiB,EACjB,4BAA4B,EAC5B,mBAAmB,EAGnB,gBAAgB,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACN,yBAAyB,EAEzB,0BAA0B,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAA6B,MAAM,iBAAiB,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACN,UAAU,EAMV,iBAAiB,EAMjB,4BAA4B,GAC5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,WAAW,EACX,iCAAiC,EACjC,2BAA2B,EAC3B,qBAAqB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,gBAAgB;IACrB,MAAM,CAAC,MAAM,CAAC,YAA2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EAAE;YACrC,eAAe,CAAC,gBAAgB,EAAE,CAAC;YACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAClD,IAAI,QAAQ,KAAK,UAAU,CAAC,SAAS,EAAE;gBACtC,eAAe,CAAC,qBAAqB,EAAE,CAAC;aACxC;iBAAM,IAAI,QAAQ,KAAK,UAAU,CAAC,IAAI,EAAE;gBACxC,eAAe,CAAC,0BAA0B,EAAE,CAAC;aAC7C;SACD;QACD,OAAO,eAAe,CAAC;IACxB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, LazyPromise, Timer } from \"@fluidframework/core-utils\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport {\n\tgcTreeKey,\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n\tISummarizeResult,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { createResponseError, responseToException } from \"@fluidframework/runtime-utils\";\nimport {\n\tcreateChildLogger,\n\tcreateChildMonitoringContext,\n\tDataProcessingError,\n\tITelemetryLoggerExt,\n\tMonitoringContext,\n\tPerformanceEvent,\n} from \"@fluidframework/telemetry-utils\";\nimport { BlobManager } from \"../blobManager\";\nimport {\n\tInactiveResponseHeaderKey,\n\tRuntimeHeaderData,\n\tTombstoneResponseHeaderKey,\n} from \"../containerRuntime\";\nimport { ClientSessionExpiredError } from \"../error\";\nimport { ContainerMessageType, ContainerRuntimeGCMessage } from \"../messageTypes\";\nimport { IRefreshSummaryResult } from \"../summary\";\nimport { generateGCConfigs } from \"./gcConfigs\";\nimport {\n\tGCNodeType,\n\tIGarbageCollector,\n\tIGarbageCollectorCreateParams,\n\tIGarbageCollectionRuntime,\n\tIGCResult,\n\tIGCStats,\n\tUnreferencedState,\n\tIGCMetadata,\n\tIGarbageCollectorConfigs,\n\tIMarkPhaseStats,\n\tISweepPhaseStats,\n\tGarbageCollectionMessage,\n\tGarbageCollectionMessageType,\n} from \"./gcDefinitions\";\nimport {\n\tcloneGCData,\n\tcompatBehaviorAllowsGCMessageType,\n\tconcatGarbageCollectionData,\n\tgetGCDataFromSnapshot,\n} from \"./gcHelpers\";\nimport { runGarbageCollection } from \"./gcReferenceGraphAlgorithm\";\nimport { IGarbageCollectionSnapshotData, IGarbageCollectionState } from \"./gcSummaryDefinitions\";\nimport { GCSummaryStateTracker } from \"./gcSummaryStateTracker\";\nimport { UnreferencedStateTracker } from \"./gcUnreferencedStateTracker\";\nimport { GCTelemetryTracker } from \"./gcTelemetry\";\n\n/**\n * The garbage collector for the container runtime. It consolidates the garbage collection functionality and maintains\n * its state across summaries.\n *\n * Node - represented as nodeId, it's a node on the GC graph\n *\n * Outbound Route - a path from one node to another node, think `nodeA` -\\> `nodeB`\n *\n * Graph - all nodes with their respective routes\n *\n * ```\n *\t\t\t GC Graph\n *\n *\t\t\t Node\n *\t\tNodeId = \"datastore1\"\n *\t\t /\t\t\t \\\\\n *\tOutboundRoute OutboundRoute\n *\t\t /\t\t\t\t \\\\\n *\t Node\t\t\t Node\n * NodeId = \"dds1\"\t NodeId = \"dds2\"\n * ```\n */\nexport class GarbageCollector implements IGarbageCollector {\n\tpublic static create(createParams: IGarbageCollectorCreateParams): IGarbageCollector {\n\t\treturn new GarbageCollector(createParams);\n\t}\n\n\tprivate readonly mc: MonitoringContext;\n\n\tprivate readonly configs: IGarbageCollectorConfigs;\n\n\tpublic get shouldRunGC(): boolean {\n\t\treturn this.configs.shouldRunGC;\n\t}\n\n\t// Keeps track of the GC state from the last run.\n\tprivate gcDataFromLastRun: IGarbageCollectionData | undefined;\n\t// Keeps a list of references (edges in the GC graph) between GC runs. Each entry has a node id and a list of\n\t// outbound routes from that node.\n\tprivate readonly newReferencesSinceLastRun: Map<string, string[]> = new Map();\n\t// A list of nodes that have been tombstoned.\n\tprivate tombstones: string[] = [];\n\t// A list of nodes that have been deleted during sweep phase.\n\tprivate deletedNodes: Set<string> = new Set();\n\n\t// Promise when resolved returns the GC data data in the base snapshot.\n\tprivate readonly baseSnapshotDataP: Promise<IGarbageCollectionSnapshotData | undefined>;\n\t// Promise when resolved initializes the GC state from the data in the base snapshot.\n\tprivate readonly initializeGCStateFromBaseSnapshotP: Promise<void>;\n\t// The GC details generated from the base snapshot.\n\tprivate readonly baseGCDetailsP: Promise<IGarbageCollectionDetailsBase>;\n\t// Map of node ids to their unreferenced state tracker.\n\tprivate readonly unreferencedNodesState: Map<string, UnreferencedStateTracker> = new Map();\n\t// The Timer responsible for closing the container when the session has expired\n\tprivate sessionExpiryTimer: Timer | undefined;\n\n\t// The number of times GC has successfully completed on this instance of GarbageCollector.\n\tprivate completedRuns = 0;\n\n\tprivate readonly runtime: IGarbageCollectionRuntime;\n\tprivate readonly isSummarizerClient: boolean;\n\n\tprivate readonly summaryStateTracker: GCSummaryStateTracker;\n\tprivate readonly telemetryTracker: GCTelemetryTracker;\n\n\t/** If false, loading or using a Tombstoned object should merely log, not fail */\n\tpublic get tombstoneEnforcementAllowed(): boolean {\n\t\treturn this.configs.sweepEnabled;\n\t}\n\t/** If true, throw an error when a tombstone data store is retrieved */\n\tpublic get throwOnTombstoneLoad(): boolean {\n\t\treturn this.configs.throwOnTombstoneLoad;\n\t}\n\t/** If true, throw an error when a tombstone data store is used */\n\tpublic get throwOnTombstoneUsage(): boolean {\n\t\treturn this.configs.throwOnTombstoneUsage;\n\t}\n\n\t/** For a given node path, returns the node's package path. */\n\tprivate readonly getNodePackagePath: (\n\t\tnodePath: string,\n\t) => Promise<readonly string[] | undefined>;\n\t/** Returns the timestamp of the last summary generated for this container. */\n\tprivate readonly getLastSummaryTimestampMs: () => number | undefined;\n\n\tprivate readonly submitMessage: (message: ContainerRuntimeGCMessage) => void;\n\n\tpublic get summaryStateNeedsReset(): boolean {\n\t\treturn this.summaryStateTracker.doesSummaryStateNeedReset;\n\t}\n\n\t/** Returns the count of data stores whose GC state updated since the last summary. */\n\tpublic get updatedDSCountSinceLastSummary(): number {\n\t\treturn this.summaryStateTracker.updatedDSCountSinceLastSummary;\n\t}\n\n\tprotected constructor(createParams: IGarbageCollectorCreateParams) {\n\t\tthis.runtime = createParams.runtime;\n\t\tthis.isSummarizerClient = createParams.isSummarizerClient;\n\t\tthis.getNodePackagePath = createParams.getNodePackagePath;\n\t\tthis.getLastSummaryTimestampMs = createParams.getLastSummaryTimestampMs;\n\t\tthis.submitMessage = createParams.submitMessage;\n\n\t\tconst baseSnapshot = createParams.baseSnapshot;\n\t\tconst readAndParseBlob = createParams.readAndParseBlob;\n\n\t\tthis.mc = createChildMonitoringContext({\n\t\t\tlogger: createParams.baseLogger,\n\t\t\tnamespace: \"GarbageCollector\",\n\t\t\tproperties: {\n\t\t\t\tall: { completedGCRuns: () => this.completedRuns },\n\t\t\t},\n\t\t});\n\n\t\tthis.configs = generateGCConfigs(this.mc, createParams);\n\n\t\t// If session expiry is enabled, we need to close the container when the session expiry timeout expires.\n\t\tif (this.configs.sessionExpiryTimeoutMs !== undefined) {\n\t\t\t// If Test Override config is set, override Session Expiry timeout.\n\t\t\tconst overrideSessionExpiryTimeoutMs = this.mc.config.getNumber(\n\t\t\t\t\"Fluid.GarbageCollection.TestOverride.SessionExpiryMs\",\n\t\t\t);\n\t\t\tconst timeoutMs = overrideSessionExpiryTimeoutMs ?? this.configs.sessionExpiryTimeoutMs;\n\n\t\t\tthis.sessionExpiryTimer = new Timer(timeoutMs, () => {\n\t\t\t\tthis.runtime.closeFn(\n\t\t\t\t\tnew ClientSessionExpiredError(`Client session expired.`, timeoutMs),\n\t\t\t\t);\n\t\t\t});\n\t\t\tthis.sessionExpiryTimer.start();\n\t\t}\n\n\t\tthis.summaryStateTracker = new GCSummaryStateTracker(\n\t\t\tthis.configs,\n\t\t\tbaseSnapshot?.trees[gcTreeKey] !== undefined /* wasGCRunInBaseSnapshot */,\n\t\t);\n\n\t\tthis.telemetryTracker = new GCTelemetryTracker(\n\t\t\tthis.mc,\n\t\t\tthis.configs,\n\t\t\tthis.isSummarizerClient,\n\t\t\tcreateParams.createContainerMetadata,\n\t\t\t(nodeId: string) => this.runtime.getNodeType(nodeId),\n\t\t\t(nodeId: string) => this.unreferencedNodesState.get(nodeId),\n\t\t\tthis.getNodePackagePath,\n\t\t);\n\n\t\t// Get the GC data from the base snapshot. Use LazyPromise because we only want to do this once since it\n\t\t// it involves fetching blobs from storage which is expensive.\n\t\tthis.baseSnapshotDataP = new LazyPromise<IGarbageCollectionSnapshotData | undefined>(\n\t\t\tasync () => {\n\t\t\t\tif (baseSnapshot === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\t// For newer documents, GC data should be present in the GC tree in the root of the snapshot.\n\t\t\t\t\tconst gcSnapshotTree = baseSnapshot.trees[gcTreeKey];\n\t\t\t\t\tif (gcSnapshotTree === undefined) {\n\t\t\t\t\t\t// back-compat - Older documents get their gc data reset for simplicity as there are few of them\n\t\t\t\t\t\t// incremental gc summary will not work with older gc data as well\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst snapshotData = await getGCDataFromSnapshot(\n\t\t\t\t\t\tgcSnapshotTree,\n\t\t\t\t\t\treadAndParseBlob,\n\t\t\t\t\t);\n\n\t\t\t\t\t// If the GC version in base snapshot does not match the GC version currently in effect, the GC data\n\t\t\t\t\t// in the snapshot cannot be interpreted correctly. Set everything to undefined except for\n\t\t\t\t\t// deletedNodes because irrespective of GC versions, these nodes have been deleted and cannot be\n\t\t\t\t\t// brought back. The deletedNodes info is needed to identify when these nodes are used.\n\t\t\t\t\tif (this.configs.gcVersionInEffect !== this.configs.gcVersionInBaseSnapshot) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tgcState: undefined,\n\t\t\t\t\t\t\ttombstones: undefined,\n\t\t\t\t\t\t\tdeletedNodes: snapshotData.deletedNodes,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\treturn snapshotData;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst dpe = DataProcessingError.wrapIfUnrecognized(\n\t\t\t\t\t\terror,\n\t\t\t\t\t\t\"FailedToInitializeGC\",\n\t\t\t\t\t);\n\t\t\t\t\tdpe.addTelemetryProperties({\n\t\t\t\t\t\tgcConfigs: JSON.stringify(this.configs),\n\t\t\t\t\t});\n\t\t\t\t\tthrow dpe;\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\t/**\n\t\t * Set up the initializer which initializes the GC state from the data in base snapshot. It sets up GC data\n\t\t * from the base GC state and starts tracking the state of unreferenced nodes.\n\t\t *\n\t\t * Must only be called if there is a current reference timestamp.\n\t\t */\n\t\tthis.initializeGCStateFromBaseSnapshotP = new LazyPromise<void>(async () => {\n\t\t\tconst currentReferenceTimestampMs = this.runtime.getCurrentReferenceTimestampMs();\n\t\t\tassert(\n\t\t\t\tcurrentReferenceTimestampMs !== undefined,\n\t\t\t\t\"Trying to initialize GC state without current timestamp\",\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * The base snapshot data will not be present if the container is loaded from:\n\t\t\t * 1. The first summary created by the detached container.\n\t\t\t * 2. A summary that was generated with GC disabled.\n\t\t\t * 3. A summary that was generated before GC even existed.\n\t\t\t */\n\t\t\tconst baseSnapshotData = await this.baseSnapshotDataP;\n\t\t\tthis.summaryStateTracker.initializeBaseState(baseSnapshotData);\n\n\t\t\tif (baseSnapshotData?.gcState === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Update unreferenced state tracking as per the GC state in the snapshot data and update gcDataFromLastRun\n\t\t\t// to the GC data from the snapshot data.\n\t\t\tconst gcNodes: { [id: string]: string[] } = {};\n\t\t\tfor (const [nodeId, nodeData] of Object.entries(baseSnapshotData.gcState.gcNodes)) {\n\t\t\t\tif (nodeData.unreferencedTimestampMs !== undefined) {\n\t\t\t\t\tthis.unreferencedNodesState.set(\n\t\t\t\t\t\tnodeId,\n\t\t\t\t\t\tnew UnreferencedStateTracker(\n\t\t\t\t\t\t\tnodeData.unreferencedTimestampMs,\n\t\t\t\t\t\t\tthis.configs.inactiveTimeoutMs,\n\t\t\t\t\t\t\tcurrentReferenceTimestampMs,\n\t\t\t\t\t\t\tthis.configs.sweepTimeoutMs,\n\t\t\t\t\t\t\tthis.configs.sweepGracePeriodMs,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tgcNodes[nodeId] = Array.from(nodeData.outboundRoutes);\n\t\t\t}\n\t\t\tthis.gcDataFromLastRun = { gcNodes };\n\t\t});\n\n\t\t// Get the GC details from the GC state in the base summary. This is returned in getBaseGCDetails which is\n\t\t// used to initialize the GC state of all the nodes in the container.\n\t\tthis.baseGCDetailsP = new LazyPromise<IGarbageCollectionDetailsBase>(async () => {\n\t\t\tconst baseSnapshotData = await this.baseSnapshotDataP;\n\t\t\tif (baseSnapshotData?.gcState === undefined) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst gcNodes: { [id: string]: string[] } = {};\n\t\t\tfor (const [nodeId, nodeData] of Object.entries(baseSnapshotData.gcState.gcNodes)) {\n\t\t\t\tgcNodes[nodeId] = Array.from(nodeData.outboundRoutes);\n\t\t\t}\n\t\t\t// Run GC on the nodes in the base summary to get the routes used in each node in the container.\n\t\t\t// This is an optimization for space (vs performance) wherein we don't need to store the used routes of\n\t\t\t// each node in the summary.\n\t\t\tconst usedRoutes = runGarbageCollection(gcNodes, [\"/\"]).referencedNodeIds;\n\n\t\t\treturn { gcData: { gcNodes }, usedRoutes };\n\t\t});\n\n\t\t// Log all the GC options and the state determined by the garbage collector.\n\t\t// This is useful even for interactive clients since they track unreferenced nodes and log errors.\n\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\teventName: \"GarbageCollectorLoaded\",\n\t\t\tgcConfigs: JSON.stringify(this.configs),\n\t\t\tgcOptions: JSON.stringify(createParams.gcOptions),\n\t\t\t...createParams.createContainerMetadata,\n\t\t});\n\t}\n\n\t/**\n\t * Called during container initialization. Initializes the tombstone and deleted nodes state from the base snapshot.\n\t * Also, initializes the GC state including unreferenced nodes tracking if a current reference timestamp exists.\n\t * Note that if there is any GC state in the base snapshot, then there will definitely be a reference timestamp\n\t * to work with - The GC state would have been generated using a timestamp which is part of the snapshot.\n\t */\n\tpublic async initializeBaseState(): Promise<void> {\n\t\tconst baseSnapshotData = await this.baseSnapshotDataP;\n\t\t/**\n\t\t * The base snapshot data will not be present if the container is loaded from:\n\t\t * 1. The first summary created by the detached container.\n\t\t * 2. A summary that was generated with GC disabled.\n\t\t * 3. A summary that was generated before GC even existed.\n\t\t */\n\t\tif (baseSnapshotData === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Initialize the deleted nodes from the snapshot. This is done irrespective of whether sweep is enabled or not\n\t\t// to identify deleted nodes' usage.\n\t\tif (baseSnapshotData.deletedNodes !== undefined) {\n\t\t\tthis.deletedNodes = new Set(baseSnapshotData.deletedNodes);\n\t\t}\n\n\t\t// If running in tombstone mode, initialize the tombstone state from the snapshot. Also, notify the runtime of\n\t\t// tombstone routes.\n\t\tif (this.configs.tombstoneMode && baseSnapshotData.tombstones !== undefined) {\n\t\t\t// Create a copy since we are writing from a source we don't control\n\t\t\tthis.tombstones = Array.from(baseSnapshotData.tombstones);\n\t\t\tthis.runtime.updateTombstonedRoutes(this.tombstones);\n\t\t}\n\n\t\tawait this.initializeOrUpdateGCState();\n\t}\n\n\t/**\n\t * Initialize the GC state if not already initialized. If GC state is already initialized, update the unreferenced\n\t * state tracking as per the current reference timestamp.\n\t */\n\tprivate async initializeOrUpdateGCState() {\n\t\tconst currentReferenceTimestampMs = this.runtime.getCurrentReferenceTimestampMs();\n\t\tif (currentReferenceTimestampMs === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the GC state hasn't been initialized yet, initialize it and return.\n\t\tif (this.gcDataFromLastRun === undefined) {\n\t\t\tawait this.initializeGCStateFromBaseSnapshotP;\n\t\t\treturn;\n\t\t}\n\n\t\t// If the GC state has been initialized, update the tracking of unreferenced nodes as per the current\n\t\t// reference timestamp.\n\t\tfor (const [, nodeStateTracker] of this.unreferencedNodesState) {\n\t\t\tnodeStateTracker.updateTracking(currentReferenceTimestampMs);\n\t\t}\n\t}\n\n\t/**\n\t * Called when the connection state of the runtime changes, i.e., it connects or disconnects. GC subscribes to this\n\t * to initialize or update the unreference state tracking.\n\t * @param connected - Whether the runtime connected / disconnected.\n\t * @param clientId - The clientId of this runtime.\n\t */\n\tpublic setConnectionState(connected: boolean, clientId?: string | undefined): void {\n\t\t/**\n\t\t * When the client connects (or reconnects), attempt to initialize or update the GC state. This will keep\n\t\t * the unreferenced state tracking updated as per the reference timestamp at the time of connection.\n\t\t *\n\t\t * During GC initialization and during connections in read mode, it is possible that either no ops are\n\t\t * processed or only trailing ops are processed. This means that the GC state is not initialized or initialized\n\t\t * with an older reference timestamp. So, doing this on every connection will keep the unreferenced state\n\t\t * tracking up-to-date.\n\t\t */\n\t\tif (connected && this.configs.shouldRunGC) {\n\t\t\tthis.initializeOrUpdateGCState().catch((error) => {\n\t\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"GCInitializationOrUpdateFailed\",\n\t\t\t\t\t\tgcConfigs: JSON.stringify(this.configs),\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Returns a the GC details generated from the base summary. This is used to initialize the GC state of the nodes\n\t * in the container.\n\t */\n\tpublic async getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase> {\n\t\treturn this.baseGCDetailsP;\n\t}\n\n\t/**\n\t * Runs garbage collection and updates the reference / used state of the nodes in the container.\n\t * @returns stats of the GC run or undefined if GC did not run.\n\t */\n\tpublic async collectGarbage(\n\t\toptions: {\n\t\t\t/** Logger to use for logging GC events */\n\t\t\tlogger?: ITelemetryLoggerExt;\n\t\t\t/** True to run GC sweep phase after the mark phase */\n\t\t\trunSweep?: boolean;\n\t\t\t/** True to generate full GC data */\n\t\t\tfullGC?: boolean;\n\t\t},\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<IGCStats | undefined> {\n\t\tconst fullGC =\n\t\t\toptions.fullGC ??\n\t\t\t(this.configs.runFullGC === true || this.summaryStateTracker.doesSummaryStateNeedReset);\n\n\t\t// Add the options that are used to run GC to the telemetry context.\n\t\ttelemetryContext?.setMultiple(\"fluid_GC\", \"Options\", {\n\t\t\tfullGC,\n\t\t\trunSweep: options.runSweep,\n\t\t});\n\n\t\tconst logger = options.logger\n\t\t\t? createChildLogger({\n\t\t\t\t\tlogger: options.logger,\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tall: { completedGCRuns: () => this.completedRuns },\n\t\t\t\t\t},\n\t\t\t })\n\t\t\t: this.mc.logger;\n\n\t\t/**\n\t\t * If there is no current reference timestamp, skip running GC. We need the current timestamp to track\n\t\t * how long objects have been unreferenced and if they should be deleted.\n\t\t *\n\t\t * Note that the only scenario where GC is called and there is no reference timestamp is when no ops have ever\n\t\t * been processed for this container and it is in read mode. In this scenario, there is no point in running GC\n\t\t * anyway because references in the container do not change without any ops, i.e., there is nothing to collect.\n\t\t */\n\t\tconst currentReferenceTimestampMs = this.runtime.getCurrentReferenceTimestampMs();\n\t\tif (currentReferenceTimestampMs === undefined) {\n\t\t\t// Log an event so we can evaluate how often we run into this scenario.\n\t\t\tlogger.sendErrorEvent({\n\t\t\t\teventName: \"CollectGarbageCalledWithoutTimestamp\",\n\t\t\t\tgcConfigs: JSON.stringify(this.configs),\n\t\t\t});\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tlogger,\n\t\t\t{ eventName: \"GarbageCollection\" },\n\t\t\tasync (event) => {\n\t\t\t\t/** Pre-GC steps */\n\t\t\t\t// Ensure that state has been initialized from the base snapshot data.\n\t\t\t\tawait this.initializeGCStateFromBaseSnapshotP;\n\t\t\t\t// Let the runtime update its pending state before GC runs.\n\t\t\t\tawait this.runtime.updateStateBeforeGC();\n\n\t\t\t\t/** GC step */\n\t\t\t\tconst gcStats = await this.runGC(fullGC, currentReferenceTimestampMs, logger);\n\t\t\t\tevent.end({\n\t\t\t\t\t...gcStats,\n\t\t\t\t\tdetails: {\n\t\t\t\t\t\ttimestamp: currentReferenceTimestampMs,\n\t\t\t\t\t\tsweep: this.configs.shouldRunSweep,\n\t\t\t\t\t\ttombstone: this.configs.throwOnTombstoneLoad,\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t\t/** Post-GC steps */\n\t\t\t\t// Log pending unreferenced events such as a node being used after inactive. This is done after GC runs and\n\t\t\t\t// updates its state so that we don't send false positives based on intermediate state. For example, we may get\n\t\t\t\t// reference to an unreferenced node from another unreferenced node which means the node wasn't revived.\n\t\t\t\tawait this.telemetryTracker.logPendingEvents(logger);\n\t\t\t\t// Update the state of summary state tracker from this run's stats.\n\t\t\t\tthis.summaryStateTracker.updateStateFromGCRunStats(gcStats);\n\t\t\t\tthis.newReferencesSinceLastRun.clear();\n\t\t\t\tthis.completedRuns++;\n\n\t\t\t\treturn gcStats;\n\t\t\t},\n\t\t\t{ end: true, cancel: \"error\" },\n\t\t);\n\t}\n\n\t/**\n\t * Runs garbage collection. It does the following:\n\t *\n\t * 1. It generates / analyzes the runtime's reference graph.\n\t *\n\t * 2. Generates mark phase stats.\n\t *\n\t * 3. Runs Mark phase.\n\t *\n\t * 4. Runs Sweep phase.\n\t *\n\t * 5. Generates sweep phase stats.\n\t */\n\tprivate async runGC(\n\t\tfullGC: boolean,\n\t\tcurrentReferenceTimestampMs: number,\n\t\tlogger: ITelemetryLoggerExt,\n\t): Promise<IGCStats> {\n\t\t// 1. Generate / analyze the runtime's reference graph.\n\t\t// Get the reference graph (gcData) and run GC algorithm to get referenced / unreferenced nodes.\n\t\tconst gcData = await this.runtime.getGCData(fullGC);\n\t\tconst gcResult = runGarbageCollection(gcData.gcNodes, [\"/\"]);\n\t\t// Get all referenced nodes - References in this run + references between the previous and current runs.\n\t\tconst allReferencedNodeIds =\n\t\t\tthis.findAllNodesReferencedBetweenGCs(gcData, this.gcDataFromLastRun, logger) ??\n\t\t\tgcResult.referencedNodeIds;\n\n\t\t// 2. Get the mark phase stats based on the previous / current GC state.\n\t\t// This is done before running mark phase because we need the previous GC state before it is updated.\n\t\tconst markPhaseStats = this.getMarkPhaseStats(gcResult);\n\n\t\t// 3. Run the Mark phase.\n\t\t// It will mark nodes as referenced / unreferenced and return lists of tombstone-ready and sweep-ready nodes.\n\t\tconst { tombstoneReadyNodeIds, sweepReadyNodeIds } = this.runMarkPhase(\n\t\t\tgcResult,\n\t\t\tallReferencedNodeIds,\n\t\t\tcurrentReferenceTimestampMs,\n\t\t);\n\n\t\t// 4. Run the Sweep phase.\n\t\t// It will tombstone any tombstone-ready nodes, and initiate the deletion of sweep-ready nodes by sending a\n\t\t// sweep op. All clients, including this one, will delete these nodes once it processes the op.\n\t\tthis.runSweepPhase(gcResult, tombstoneReadyNodeIds, sweepReadyNodeIds);\n\n\t\tthis.gcDataFromLastRun = cloneGCData(gcData);\n\n\t\t// 5. Get the sweep phase stats.\n\t\tconst sweepPhaseStats = this.getSweepPhaseStats(\n\t\t\tthis.deletedNodes,\n\t\t\tsweepReadyNodeIds,\n\t\t\tmarkPhaseStats,\n\t\t);\n\n\t\treturn { ...markPhaseStats, ...sweepPhaseStats };\n\t}\n\n\t/**\n\t * Runs the GC Mark phase. It does the following:\n\t *\n\t * 1. Marks all referenced nodes in this run by clearing tracking for them.\n\t *\n\t * 2. Marks unreferenced nodes in this run by starting tracking for them.\n\t *\n\t * 3. Calls the runtime to update nodes that were marked referenced.\n\t *\n\t * @param gcResult - The result of the GC run on the gcData.\n\t * @param allReferencedNodeIds - Nodes referenced in this GC run + referenced between previous and current GC run.\n\t * @param currentReferenceTimestampMs - The timestamp to be used for unreferenced nodes' timestamp.\n\t * @returns The sets of tombstone-ready and sweep-ready nodes, i.e., nodes that ready to be tombstoned or deleted.\n\t */\n\tprivate runMarkPhase(\n\t\tgcResult: IGCResult,\n\t\tallReferencedNodeIds: string[],\n\t\tcurrentReferenceTimestampMs: number,\n\t): { tombstoneReadyNodeIds: Set<string>; sweepReadyNodeIds: Set<string> } {\n\t\t// 1. Marks all referenced nodes by clearing their unreferenced tracker, if any.\n\t\tfor (const nodeId of allReferencedNodeIds) {\n\t\t\tconst nodeStateTracker = this.unreferencedNodesState.get(nodeId);\n\t\t\tif (nodeStateTracker !== undefined) {\n\t\t\t\t// Stop tracking so as to clear out any running timers.\n\t\t\t\tnodeStateTracker.stopTracking();\n\t\t\t\t// Delete the node as we don't need to track it any more.\n\t\t\t\tthis.unreferencedNodesState.delete(nodeId);\n\t\t\t}\n\t\t}\n\n\t\t// 2. Mark unreferenced nodes in this run by starting unreferenced tracking for them.\n\t\tconst tombstoneReadyNodeIds: Set<string> = new Set();\n\t\tconst sweepReadyNodeIds: Set<string> = new Set();\n\t\tfor (const nodeId of gcResult.deletedNodeIds) {\n\t\t\tconst nodeStateTracker = this.unreferencedNodesState.get(nodeId);\n\t\t\tif (nodeStateTracker === undefined) {\n\t\t\t\tthis.unreferencedNodesState.set(\n\t\t\t\t\tnodeId,\n\t\t\t\t\tnew UnreferencedStateTracker(\n\t\t\t\t\t\tcurrentReferenceTimestampMs,\n\t\t\t\t\t\tthis.configs.inactiveTimeoutMs,\n\t\t\t\t\t\tcurrentReferenceTimestampMs,\n\t\t\t\t\t\tthis.configs.sweepTimeoutMs,\n\t\t\t\t\t\tthis.configs.sweepGracePeriodMs,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// If a node was already unreferenced, update its tracking information. Since the current reference time\n\t\t\t\t// is from the ops seen, this will ensure that we keep updating unreferenced state as time moves forward.\n\t\t\t\tnodeStateTracker.updateTracking(currentReferenceTimestampMs);\n\n\t\t\t\t// If a node is tombstone or sweep-ready, store it so it can be returned.\n\t\t\t\tif (nodeStateTracker.state === UnreferencedState.TombstoneReady) {\n\t\t\t\t\ttombstoneReadyNodeIds.add(nodeId);\n\t\t\t\t}\n\t\t\t\tif (nodeStateTracker.state === UnreferencedState.SweepReady) {\n\t\t\t\t\tsweepReadyNodeIds.add(nodeId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// 3. Call the runtime to update referenced nodes in this run.\n\t\tthis.runtime.updateUsedRoutes(gcResult.referencedNodeIds);\n\n\t\treturn { tombstoneReadyNodeIds, sweepReadyNodeIds };\n\t}\n\n\t/**\n\t * Runs the GC Sweep phase. It does the following:\n\t *\n\t * 1. Marks tombstone-ready nodes as tombstones.\n\t *\n\t * 2. Sends a sweep op to delete nodes that are sweep-ready. Once the op is ack'd, these nodes will be deleted.\n\t *\n\t * @param gcResult - The result of the GC run on the gcData.\n\t * @param tombstoneReadyNodes - List of nodes that are tombstone-ready.\n\t * @param sweepReadyNodes - List of nodes that are sweep-ready.\n\t */\n\tprivate runSweepPhase(\n\t\tgcResult: IGCResult,\n\t\ttombstoneReadyNodes: Set<string>,\n\t\tsweepReadyNodes: Set<string>,\n\t) {\n\t\t/**\n\t\t * Under \"Test Mode\", unreferenced nodes are immediately deleted without waiting for them to be sweep-ready.\n\t\t *\n\t\t * Otherwise, depending on how long it's been since the node was unreferenced, it will either be\n\t\t * marked as Tombstone, or deleted by Sweep.\n\t\t */\n\n\t\tif (this.configs.testMode) {\n\t\t\t// If we are running in GC test mode, unreferenced nodes (gcResult.deletedNodeIds) are deleted.\n\t\t\tthis.runtime.updateUnusedRoutes(gcResult.deletedNodeIds);\n\t\t\treturn;\n\t\t}\n\n\t\t// If sweep is disabled, we'll tombstone both tombstone-ready and sweep-ready nodes.\n\t\t// This is important because a container may never load during a node's Sweep Grace Period,\n\t\t// so that node would directly become sweep-ready skipping over tombstone-ready state,\n\t\t// but should be Tombstoned since Sweep is disabled.\n\t\tconst { nodesToTombstone, nodesToDelete } = this.configs.shouldRunSweep\n\t\t\t? {\n\t\t\t\t\tnodesToTombstone: [...tombstoneReadyNodes],\n\t\t\t\t\tnodesToDelete: [...sweepReadyNodes],\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tnodesToTombstone: [...tombstoneReadyNodes, ...sweepReadyNodes],\n\t\t\t\t\tnodesToDelete: [],\n\t\t\t };\n\n\t\tif (this.configs.tombstoneMode) {\n\t\t\tthis.tombstones = nodesToTombstone;\n\t\t\t// If we are running in GC tombstone mode, update tombstoned routes.\n\t\t\tthis.runtime.updateTombstonedRoutes(this.tombstones);\n\t\t}\n\n\t\tif (this.configs.shouldRunSweep && nodesToDelete.length > 0) {\n\t\t\t// Do not send DDS node ids in the GC op. This is an optimization to reduce its size. Since GC applies to\n\t\t\t// to data store only, all its DDSes are deleted along with it. The DDS ids will be retrieved from the\n\t\t\t// local state when processing the op.\n\t\t\tconst sweepReadyDSAndBlobs = nodesToDelete.filter((nodeId) => {\n\t\t\t\tconst nodeType = this.runtime.getNodeType(nodeId);\n\t\t\t\treturn nodeType === GCNodeType.DataStore || nodeType === GCNodeType.Blob;\n\t\t\t});\n\t\t\tconst contents: GarbageCollectionMessage = {\n\t\t\t\ttype: GarbageCollectionMessageType.Sweep,\n\t\t\t\tdeletedNodeIds: sweepReadyDSAndBlobs,\n\t\t\t};\n\n\t\t\t// Its fine for older clients to ignore this op because it doesn't have any functional impact. This op\n\t\t\t// is an optimization to ensure that all clients are in sync when it comes to deleted nodes to prevent their\n\t\t\t// accidental usage. The clients will sync without the delete op too but it may take longer.\n\t\t\tconst containerGCMessage: ContainerRuntimeGCMessage = {\n\t\t\t\ttype: ContainerMessageType.GC,\n\t\t\t\tcontents,\n\t\t\t\tcompatDetails: { behavior: \"Ignore\" },\n\t\t\t};\n\t\t\tthis.submitMessage(containerGCMessage);\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/**\n\t * Since GC runs periodically, the GC data that is generated only tells us the state of the world at that point in\n\t * time. There can be nodes that were referenced in between two runs and their unreferenced state needs to be\n\t * updated. For example, in the following scenarios not updating the unreferenced timestamp can lead to deletion of\n\t * these objects while there can be in-memory referenced to it:\n\t * 1. A node transitions from `unreferenced -> referenced -> unreferenced` between two runs. When the reference is\n\t * added, the object may have been accessed and in-memory reference to it added.\n\t * 2. A reference is added from one unreferenced node to one or more unreferenced nodes. Even though the node[s] were\n\t * unreferenced, they could have been accessed and in-memory reference to them added.\n\t *\n\t * This function identifies nodes that were referenced since the last run.\n\t * If these nodes are currently unreferenced, they will be assigned new unreferenced state by the current run.\n\t *\n\t * @returns A list of all nodes referenced from the last local summary until now.\n\t */\n\tprivate findAllNodesReferencedBetweenGCs(\n\t\tcurrentGCData: IGarbageCollectionData,\n\t\tpreviousGCData: IGarbageCollectionData | undefined,\n\t\tlogger: ITelemetryLoggerExt,\n\t): string[] | undefined {\n\t\t// If we haven't run GC before there is nothing to do.\n\t\t// No previousGCData, means nothing is unreferenced, and there are no reference state trackers to clear\n\t\tif (previousGCData === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t/**\n\t\t * If there are references that were not explicitly notified to GC, log an error because this should never happen.\n\t\t * If it does, this may result in the unreferenced timestamps of these nodes not updated when they were referenced.\n\t\t */\n\t\tthis.telemetryTracker.logIfMissingExplicitReferences(\n\t\t\tcurrentGCData,\n\t\t\tpreviousGCData,\n\t\t\tthis.newReferencesSinceLastRun,\n\t\t\tlogger,\n\t\t);\n\n\t\t// No references were added since the last run so we don't have to update reference states of any unreferenced\n\t\t// nodes. There is no in between state at this point.\n\t\tif (this.newReferencesSinceLastRun.size === 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t/**\n\t\t * Generate a super set of the GC data that contains the nodes and edges from last run, plus any new node and\n\t\t * edges that have been added since then. To do this, combine the GC data from the last run and the current\n\t\t * run, and then add the references since last run.\n\t\t *\n\t\t * Note on why we need to combine the data from previous run, current run and all references in between -\n\t\t * 1. We need data from last run because some of its references may have been deleted since then. If those\n\t\t * references added new outbound references before they were deleted, we need to detect them.\n\t\t *\n\t\t * 2. We need new outbound references since last run because some of them may have been deleted later. If those\n\t\t * references added new outbound references before they were deleted, we need to detect them.\n\t\t *\n\t\t * 3. We need data from the current run because currently we may not detect when DDSes are referenced:\n\t\t * - We don't require DDSes handles to be stored in a referenced DDS.\n\t\t * - A new data store may have \"root\" DDSes already created and we don't detect them today.\n\t\t */\n\t\tconst gcDataSuperSet = concatGarbageCollectionData(previousGCData, currentGCData);\n\t\tconst newOutboundRoutesSinceLastRun: string[] = [];\n\t\tthis.newReferencesSinceLastRun.forEach((outboundRoutes: string[], sourceNodeId: string) => {\n\t\t\tif (gcDataSuperSet.gcNodes[sourceNodeId] === undefined) {\n\t\t\t\tgcDataSuperSet.gcNodes[sourceNodeId] = outboundRoutes;\n\t\t\t} else {\n\t\t\t\tgcDataSuperSet.gcNodes[sourceNodeId].push(...outboundRoutes);\n\t\t\t}\n\t\t\tnewOutboundRoutesSinceLastRun.push(...outboundRoutes);\n\t\t});\n\n\t\t/**\n\t\t * Run GC on the above reference graph starting with root and all new outbound routes. This will generate a\n\t\t * list of all nodes that could have been referenced since the last run. If any of these nodes are unreferenced,\n\t\t * unreferenced, stop tracking them and remove from unreferenced list.\n\t\t * Note that some of these nodes may be unreferenced now and if so, the current run will mark them as\n\t\t * unreferenced and add unreferenced state.\n\t\t */\n\t\tconst gcResult = runGarbageCollection(gcDataSuperSet.gcNodes, [\n\t\t\t\"/\",\n\t\t\t...newOutboundRoutesSinceLastRun,\n\t\t]);\n\t\treturn gcResult.referencedNodeIds;\n\t}\n\n\t/**\n\t * Summarizes the GC data and returns it as a summary tree.\n\t * We current write the entire GC state in a single blob. This can be modified later to write multiple\n\t * blobs. All the blob keys should start with `gcBlobPrefix`.\n\t */\n\tpublic summarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummarizeResult | undefined {\n\t\tif (!this.configs.shouldRunGC || this.gcDataFromLastRun === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst gcState: IGarbageCollectionState = { gcNodes: {} };\n\t\tfor (const [nodeId, outboundRoutes] of Object.entries(this.gcDataFromLastRun.gcNodes)) {\n\t\t\tgcState.gcNodes[nodeId] = {\n\t\t\t\toutboundRoutes,\n\t\t\t\tunreferencedTimestampMs:\n\t\t\t\t\tthis.unreferencedNodesState.get(nodeId)?.unreferencedTimestampMs,\n\t\t\t};\n\t\t}\n\n\t\treturn this.summaryStateTracker.summarize(\n\t\t\tfullTree,\n\t\t\ttrackState,\n\t\t\tgcState,\n\t\t\tthis.deletedNodes,\n\t\t\tthis.tombstones,\n\t\t);\n\t}\n\n\tpublic getMetadata(): IGCMetadata {\n\t\treturn {\n\t\t\t/**\n\t\t\t * If GC is enabled, the GC data is written using the GC version in effect and that is the gcFeature that goes\n\t\t\t * into the metadata blob. If GC is disabled, the gcFeature is 0.\n\t\t\t */\n\t\t\tgcFeature: this.configs.gcEnabled ? this.configs.gcVersionInEffect : 0,\n\t\t\tgcFeatureMatrix: this.configs.persistedGcFeatureMatrix,\n\t\t\tsessionExpiryTimeoutMs: this.configs.sessionExpiryTimeoutMs,\n\t\t\tsweepEnabled: false, // DEPRECATED - to be removed\n\t\t\tsweepTimeoutMs: this.configs.sweepTimeoutMs,\n\t\t};\n\t}\n\n\t/**\n\t * Called to refresh the latest summary state. This happens when either a pending summary is acked.\n\t */\n\tpublic async refreshLatestSummary(result: IRefreshSummaryResult): Promise<void> {\n\t\treturn this.summaryStateTracker.refreshLatestSummary(result);\n\t}\n\n\t/**\n\t * Process a GC message.\n\t * @param message - The GC message from the container runtime.\n\t * @param local - Whether it was send by this client.\n\t */\n\tpublic processMessage(message: ContainerRuntimeGCMessage, local: boolean) {\n\t\tswitch (message.contents.type) {\n\t\t\tcase \"Sweep\": {\n\t\t\t\t// Delete the nodes whose ids are present in the contents.\n\t\t\t\tthis.deleteSweepReadyNodes(message.contents.deletedNodeIds);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tif (\n\t\t\t\t\t!compatBehaviorAllowsGCMessageType(\n\t\t\t\t\t\tmessage.contents.type,\n\t\t\t\t\t\tmessage.compatDetails?.behavior,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tconst error = DataProcessingError.create(\n\t\t\t\t\t\t`Garbage collection message of unknown type ${message.contents.type}`,\n\t\t\t\t\t\t\"processMessage\",\n\t\t\t\t\t);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Delete nodes that are sweep-ready. Call the runtime to delete these nodes and clear the unreferenced state\n\t * tracking for nodes that are actually deleted by the runtime.\n\t * @param sweepReadyNodeIds - The ids of nodes that are ready to be deleted.\n\t */\n\tprivate deleteSweepReadyNodes(sweepReadyNodeIds: readonly string[]) {\n\t\t// Use a set for lookup because its much faster than array or map.\n\t\tconst sweepReadyNodesSet: Set<string> = new Set(sweepReadyNodeIds);\n\n\t\t// The ids in the sweep-ready nodes do not contain DDS node ids. This is an optimization to reduce the size\n\t\t// of the GC op. Since GC applies to data store only, all its DDSes are deleted along with it. So, get the\n\t\t// DDS nodes ID from the unreferenced nodes state.\n\t\tconst allSweepReadyNodeIds = Array.from(sweepReadyNodeIds);\n\t\tfor (const [id] of this.unreferencedNodesState) {\n\t\t\t// Ignore data store nodes since they would already be in the list.\n\t\t\tconst pathParts = id.split(\"/\");\n\t\t\tif (pathParts.length <= 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get the data store id part. Note that this may include blobs but that's okay since the part would just\n\t\t\t// be \"_blobs\" and it won't be found.\n\t\t\tconst dsId = `/${pathParts[1]}`;\n\t\t\tif (sweepReadyNodesSet.has(dsId)) {\n\t\t\t\tallSweepReadyNodeIds.push(id);\n\t\t\t}\n\t\t}\n\t\tconst deletedNodeIds = this.runtime.deleteSweepReadyNodes(allSweepReadyNodeIds);\n\n\t\t// Clear unreferenced state tracking for deleted nodes.\n\t\tfor (const nodeId of deletedNodeIds) {\n\t\t\tconst nodeStateTracker = this.unreferencedNodesState.get(nodeId);\n\t\t\tif (nodeStateTracker !== undefined) {\n\t\t\t\t// Stop tracking so as to clear out any running timers.\n\t\t\t\tnodeStateTracker.stopTracking();\n\t\t\t\t// Delete the node as we don't need to track it any more.\n\t\t\t\tthis.unreferencedNodesState.delete(nodeId);\n\t\t\t}\n\t\t\tthis.deletedNodes.add(nodeId);\n\t\t}\n\t}\n\n\t/**\n\t * Called when a node with the given id is updated. If the node is inactive or tombstoned, this will log an error\n\t * or throw an error if failing on incorrect usage is configured.\n\t * @param nodePath - The path of the node that changed.\n\t * @param reason - Whether the node was loaded or changed.\n\t * @param timestampMs - The timestamp when the node changed.\n\t * @param packagePath - The package path of the node. This may not be available if the node hasn't been loaded yet.\n\t * @param request - The original request for loads to preserve it in telemetry.\n\t * @param requestHeaders - If the node was loaded via request path, the headers in the request.\n\t */\n\tpublic nodeUpdated(\n\t\tnodePath: string,\n\t\treason: \"Loaded\" | \"Changed\",\n\t\ttimestampMs?: number,\n\t\tpackagePath?: readonly string[],\n\t\trequest?: IRequest,\n\t\theaderData?: RuntimeHeaderData,\n\t) {\n\t\tif (!this.configs.shouldRunGC) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isTombstoned = this.tombstones.includes(nodePath);\n\n\t\t// This will log if appropriate\n\t\tthis.telemetryTracker.nodeUsed({\n\t\t\tid: nodePath,\n\t\t\tusageType: reason,\n\t\t\tcurrentReferenceTimestampMs:\n\t\t\t\ttimestampMs ?? this.runtime.getCurrentReferenceTimestampMs(),\n\t\t\tpackagePath,\n\t\t\tcompletedGCRuns: this.completedRuns,\n\t\t\tisTombstoned,\n\t\t\tlastSummaryTime: this.getLastSummaryTimestampMs(),\n\t\t\theaders: headerData,\n\t\t});\n\n\t\tconst nodeType = this.runtime.getNodeType(nodePath);\n\n\t\t// Unless this is a Loaded event for a Blob or DataStore, we're done after telemetry tracking\n\t\tif (reason !== \"Loaded\" || ![GCNodeType.Blob, GCNodeType.DataStore].includes(nodeType)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst errorRequest: IRequest = request ?? { url: nodePath };\n\t\t// If the object is tombstoned and tombstone enforcement is configured, throw an error.\n\t\tif (isTombstoned && this.throwOnTombstoneLoad && headerData?.allowTombstone !== true) {\n\t\t\t// The requested data store is removed by gc. Create a 404 gc response exception.\n\t\t\tthrow responseToException(\n\t\t\t\tcreateResponseError(404, `${nodeType} was tombstoned`, errorRequest, {\n\t\t\t\t\t[TombstoneResponseHeaderKey]: true,\n\t\t\t\t}),\n\t\t\t\terrorRequest,\n\t\t\t);\n\t\t}\n\n\t\t// If the object is inactive and inactive enforcement is configured, throw an error.\n\t\tif (this.unreferencedNodesState.get(nodePath)?.state === \"Inactive\") {\n\t\t\tconst shouldThrowOnInactiveLoad =\n\t\t\t\t!this.isSummarizerClient &&\n\t\t\t\tthis.configs.throwOnInactiveLoad === true &&\n\t\t\t\theaderData?.allowInactive !== true;\n\t\t\tif (shouldThrowOnInactiveLoad) {\n\t\t\t\tthrow responseToException(\n\t\t\t\t\tcreateResponseError(404, `${nodeType} is inactive`, errorRequest, {\n\t\t\t\t\t\t[InactiveResponseHeaderKey]: true,\n\t\t\t\t\t}),\n\t\t\t\t\terrorRequest,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Called when an outbound reference is added to a node. This is used to identify all nodes that have been\n\t * referenced between summaries so that their unreferenced timestamp can be reset.\n\t *\n\t * @param fromNodePath - The node from which the reference is added.\n\t * @param toNodePath - The node to which the reference is added.\n\t */\n\tpublic addedOutboundReference(fromNodePath: string, toNodePath: string) {\n\t\tif (!this.configs.shouldRunGC) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst outboundRoutes = this.newReferencesSinceLastRun.get(fromNodePath) ?? [];\n\t\toutboundRoutes.push(toNodePath);\n\t\tthis.newReferencesSinceLastRun.set(fromNodePath, outboundRoutes);\n\n\t\tthis.telemetryTracker.nodeUsed({\n\t\t\tid: toNodePath,\n\t\t\tusageType: \"Revived\",\n\t\t\tcurrentReferenceTimestampMs: this.runtime.getCurrentReferenceTimestampMs(),\n\t\t\tpackagePath: undefined,\n\t\t\tcompletedGCRuns: this.completedRuns,\n\t\t\tisTombstoned: this.tombstones.includes(toNodePath),\n\t\t\tlastSummaryTime: this.getLastSummaryTimestampMs(),\n\t\t\tfromId: fromNodePath,\n\t\t});\n\t}\n\n\t/**\n\t * Returns whether a node with the given path has been deleted or not. This can be used by the runtime to identify\n\t * cases where objects are used after they are deleted and throw / log errors accordingly.\n\t */\n\tpublic isNodeDeleted(nodePath: string): boolean {\n\t\treturn this.deletedNodes.has(nodePath);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.sessionExpiryTimer?.clear();\n\t\tthis.sessionExpiryTimer = undefined;\n\t}\n\n\t/**\n\t * Generates the stats of a garbage collection mark phase run.\n\t * @param gcResult - The result of the current GC run.\n\t * @returns the stats of the mark phase run.\n\t */\n\tprivate getMarkPhaseStats(gcResult: IGCResult): IMarkPhaseStats {\n\t\tconst markPhaseStats: IMarkPhaseStats = {\n\t\t\tnodeCount: 0,\n\t\t\tdataStoreCount: 0,\n\t\t\tattachmentBlobCount: 0,\n\t\t\tunrefNodeCount: 0,\n\t\t\tunrefDataStoreCount: 0,\n\t\t\tunrefAttachmentBlobCount: 0,\n\t\t\tupdatedNodeCount: 0,\n\t\t\tupdatedDataStoreCount: 0,\n\t\t\tupdatedAttachmentBlobCount: 0,\n\t\t};\n\n\t\tconst updateNodeStats = (nodeId: string, referenced: boolean) => {\n\t\t\tmarkPhaseStats.nodeCount++;\n\t\t\t// If there is no previous GC data, every node's state is generated and is considered as updated.\n\t\t\t// Otherwise, find out if any node went from referenced to unreferenced or vice-versa.\n\t\t\tconst stateUpdated =\n\t\t\t\tthis.gcDataFromLastRun === undefined ||\n\t\t\t\tthis.unreferencedNodesState.has(nodeId) === referenced;\n\t\t\tif (stateUpdated) {\n\t\t\t\tmarkPhaseStats.updatedNodeCount++;\n\t\t\t}\n\t\t\tif (!referenced) {\n\t\t\t\tmarkPhaseStats.unrefNodeCount++;\n\t\t\t}\n\n\t\t\tif (this.runtime.getNodeType(nodeId) === GCNodeType.DataStore) {\n\t\t\t\tmarkPhaseStats.dataStoreCount++;\n\t\t\t\tif (stateUpdated) {\n\t\t\t\t\tmarkPhaseStats.updatedDataStoreCount++;\n\t\t\t\t}\n\t\t\t\tif (!referenced) {\n\t\t\t\t\tmarkPhaseStats.unrefDataStoreCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.runtime.getNodeType(nodeId) === GCNodeType.Blob) {\n\t\t\t\tmarkPhaseStats.attachmentBlobCount++;\n\t\t\t\tif (stateUpdated) {\n\t\t\t\t\tmarkPhaseStats.updatedAttachmentBlobCount++;\n\t\t\t\t}\n\t\t\t\tif (!referenced) {\n\t\t\t\t\tmarkPhaseStats.unrefAttachmentBlobCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tfor (const nodeId of gcResult.referencedNodeIds) {\n\t\t\tupdateNodeStats(nodeId, true /* referenced */);\n\t\t}\n\n\t\tfor (const nodeId of gcResult.deletedNodeIds) {\n\t\t\tupdateNodeStats(nodeId, false /* referenced */);\n\t\t}\n\n\t\treturn markPhaseStats;\n\t}\n\n\t/**\n\t * Generates the stats of a garbage collection sweep phase run.\n\t * @param deletedNodes - The nodes that have been deleted until this run.\n\t * @param sweepReadyNodes - The nodes that are sweep-ready in this GC run.\n\t * @param markPhaseStats - The stats of the mark phase run.\n\t * @returns the stats of the sweep phase run.\n\t */\n\tprivate getSweepPhaseStats(\n\t\tdeletedNodes: Set<string>,\n\t\tsweepReadyNodes: Set<string>,\n\t\tmarkPhaseStats: IMarkPhaseStats,\n\t): ISweepPhaseStats {\n\t\t// Initialize the life time node counts to the mark phase node counts. If sweep is not enabled,\n\t\t// these will be the life time node count for this container.\n\t\tconst sweepPhaseStats: ISweepPhaseStats = {\n\t\t\tlifetimeNodeCount: markPhaseStats.nodeCount,\n\t\t\tlifetimeDataStoreCount: markPhaseStats.dataStoreCount,\n\t\t\tlifetimeAttachmentBlobCount: markPhaseStats.attachmentBlobCount,\n\t\t\tdeletedNodeCount: 0,\n\t\t\tdeletedDataStoreCount: 0,\n\t\t\tdeletedAttachmentBlobCount: 0,\n\t\t};\n\n\t\t// The runtime can't reliably identify the type of deleted nodes. So, get the type here. This should\n\t\t// be good enough because the only types that participate in GC today are data stores, DDSes and blobs.\n\t\tconst getDeletedNodeType = (nodeId: string): GCNodeType => {\n\t\t\tconst pathParts = nodeId.split(\"/\");\n\t\t\tif (pathParts[1] === BlobManager.basePath) {\n\t\t\t\treturn GCNodeType.Blob;\n\t\t\t}\n\t\t\tif (pathParts.length === 2) {\n\t\t\t\treturn GCNodeType.DataStore;\n\t\t\t}\n\t\t\tif (pathParts.length === 3) {\n\t\t\t\treturn GCNodeType.SubDataStore;\n\t\t\t}\n\t\t\treturn GCNodeType.Other;\n\t\t};\n\n\t\tfor (const nodeId of deletedNodes) {\n\t\t\tsweepPhaseStats.deletedNodeCount++;\n\t\t\tconst nodeType = getDeletedNodeType(nodeId);\n\t\t\tif (nodeType === GCNodeType.DataStore) {\n\t\t\t\tsweepPhaseStats.deletedDataStoreCount++;\n\t\t\t} else if (nodeType === GCNodeType.Blob) {\n\t\t\t\tsweepPhaseStats.deletedAttachmentBlobCount++;\n\t\t\t}\n\t\t}\n\n\t\t// If sweep is enabled, the counts from the mark phase stats do not include nodes that have been\n\t\t// deleted in previous runs. So, add the deleted node counts to life time stats.\n\t\tsweepPhaseStats.lifetimeNodeCount += sweepPhaseStats.deletedNodeCount;\n\t\tsweepPhaseStats.lifetimeDataStoreCount += sweepPhaseStats.deletedDataStoreCount;\n\t\tsweepPhaseStats.lifetimeAttachmentBlobCount += sweepPhaseStats.deletedAttachmentBlobCount;\n\n\t\tif (this.configs.shouldRunSweep) {\n\t\t\treturn sweepPhaseStats;\n\t\t}\n\n\t\t// If sweep is not enabled, the current sweep-ready node stats should be added to deleted stats since this\n\t\t// is the final state the node will be in.\n\t\t// If sweep is enabled, this will happen in the run after the GC op round trips back.\n\t\tfor (const nodeId of sweepReadyNodes) {\n\t\t\tsweepPhaseStats.deletedNodeCount++;\n\t\t\tconst nodeType = this.runtime.getNodeType(nodeId);\n\t\t\tif (nodeType === GCNodeType.DataStore) {\n\t\t\t\tsweepPhaseStats.deletedDataStoreCount++;\n\t\t\t} else if (nodeType === GCNodeType.Blob) {\n\t\t\t\tsweepPhaseStats.deletedAttachmentBlobCount++;\n\t\t\t}\n\t\t}\n\t\treturn sweepPhaseStats;\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcConfigs.d.ts","sourceRoot":"","sources":["../../src/gc/gcConfigs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,iBAAiB,EAGjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EASN,wBAAwB,EACxB,iBAAiB,EAYjB,MAAM,iBAAiB,CAAC;AAGzB;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAChC,EAAE,EAAE,iBAAiB,EACrB,YAAY,EAAE;IACb,SAAS,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,EAAE,yBAAyB,GAAG,SAAS,CAAC;IAChD,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;CAC5B,GACC,wBAAwB,CAqJ1B"}
|
package/lib/gc/gcConfigs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcConfigs.js","sourceRoot":"","sources":["../../src/gc/gcConfigs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,UAAU,EACV,oBAAoB,GACpB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACN,aAAa,EACb,wBAAwB,EACxB,8BAA8B,EAC9B,mBAAmB,EAEnB,aAAa,EAEb,uBAAuB,E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;QACR,aAAa;QACb,sBAAsB;QACtB,cAAc;QACd,kBAAkB;QAClB,iBAAiB;QACjB,wBAAwB;QACxB,uBAAuB;QACvB,iBAAiB;QACjB,mBAAmB;QACnB,oBAAoB;QACpB,qBAAqB;KACrB,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,mBAAmB,CAAC,sBAA0C;IACtE,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC1B,OAAO,sBAAsB,IAAI,sBAAsB,GAAG,wBAAwB,GAAG,QAAQ,CAAC;AAC/F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tMonitoringContext,\n\tUsageError,\n\tvalidatePrecondition,\n} from \"@fluidframework/telemetry-utils\";\nimport { IContainerRuntimeMetadata } from \"../summary\";\nimport {\n\tnextGCVersion,\n\tdefaultInactiveTimeoutMs,\n\tdefaultSessionExpiryDurationMs,\n\tdisableTombstoneKey,\n\tGCFeatureMatrix,\n\tgcTestModeKey,\n\tGCVersion,\n\tgcVersionUpgradeToV4Key,\n\tIGarbageCollectorConfigs,\n\tIGCRuntimeOptions,\n\tmaxSnapshotCacheExpiryMs,\n\toneDayMs,\n\trunGCKey,\n\trunSessionExpiryKey,\n\trunSweepKey,\n\tstableGCVersion,\n\tthrowOnTombstoneLoadOverrideKey,\n\tthrowOnTombstoneUsageKey,\n\tgcDisableThrowOnTombstoneLoadOptionName,\n\tdefaultSweepGracePeriodMs,\n\tgcGenerationOptionName,\n} from \"./gcDefinitions\";\nimport { getGCVersion, shouldAllowGcSweep } from \"./gcHelpers\";\n\n/**\n * Generates configurations for the Garbage Collector that it uses to determine what to run and how.\n * @param mc - The monitoring context for reading configs from the config provider.\n * @param createParams - The creation params:\n * gcOptions - The garbage collector runtime options.\n * metadata - The container runtime's createParams.metadata.\n * existing - Whether the container is new or an existing one.\n * @returns The garbage collector configurations.\n */\nexport function generateGCConfigs(\n\tmc: MonitoringContext,\n\tcreateParams: {\n\t\tgcOptions: IGCRuntimeOptions;\n\t\tmetadata: IContainerRuntimeMetadata | undefined;\n\t\texisting: boolean;\n\t\tisSummarizerClient: boolean;\n\t},\n): IGarbageCollectorConfigs {\n\tlet gcEnabled: boolean;\n\tlet sessionExpiryTimeoutMs: number | undefined;\n\tlet sweepTimeoutMs: number | undefined;\n\tlet persistedGcFeatureMatrix: GCFeatureMatrix | undefined;\n\tlet gcVersionInBaseSnapshot: GCVersion | undefined;\n\n\t/**\n\t * The following GC state is enabled during container creation and cannot be changed throughout its lifetime:\n\t * 1. Whether running GC mark phase is allowed or not.\n\t * 2. Whether running GC sweep phase is allowed or not.\n\t * 3. Whether GC session expiry is enabled or not.\n\t * For existing containers, we get this information from the createParams.metadata blob of its summary.\n\t */\n\tif (createParams.existing) {\n\t\tgcVersionInBaseSnapshot = getGCVersion(createParams.metadata);\n\t\t// Existing documents which did not have createParams.metadata blob or had GC disabled have version as 0. For all\n\t\t// other existing documents, GC is enabled.\n\t\tgcEnabled = gcVersionInBaseSnapshot > 0;\n\t\tsessionExpiryTimeoutMs = createParams.metadata?.sessionExpiryTimeoutMs;\n\t\tsweepTimeoutMs =\n\t\t\tcreateParams.metadata?.sweepTimeoutMs ?? computeSweepTimeout(sessionExpiryTimeoutMs); // Backfill old documents that didn't persist this\n\t\tpersistedGcFeatureMatrix = createParams.metadata?.gcFeatureMatrix;\n\t} else {\n\t\t// This Test Override only applies for new containers\n\t\tconst testOverrideSweepTimeoutMs = mc.config.getNumber(\n\t\t\t\"Fluid.GarbageCollection.TestOverride.SweepTimeoutMs\",\n\t\t);\n\n\t\t// For new documents, GC is enabled by default. It can be explicitly disabled by setting the gcAllowed\n\t\t// flag in GC options to false.\n\t\tgcEnabled = createParams.gcOptions.gcAllowed !== false;\n\n\t\t// Set the Session Expiry if GC is enabled and session expiry flag isn't explicitly set to false.\n\t\tif (gcEnabled && mc.config.getBoolean(runSessionExpiryKey) !== false) {\n\t\t\tsessionExpiryTimeoutMs =\n\t\t\t\tcreateParams.gcOptions.sessionExpiryTimeoutMs ?? defaultSessionExpiryDurationMs;\n\t\t}\n\t\tsweepTimeoutMs = testOverrideSweepTimeoutMs ?? computeSweepTimeout(sessionExpiryTimeoutMs);\n\n\t\tconst gcGeneration = createParams.gcOptions[gcGenerationOptionName];\n\t\tif (gcGeneration !== undefined) {\n\t\t\tpersistedGcFeatureMatrix = { gcGeneration };\n\t\t}\n\t}\n\n\t// The persisted GC generation must indicate Sweep is allowed for this document,\n\t// according to the GC Generation option provided this session.\n\t// Note that if no generation option is provided, Sweep is allowed for any document.\n\tconst sweepAllowed = shouldAllowGcSweep(\n\t\tpersistedGcFeatureMatrix ?? {} /* featureMatrix */,\n\t\tcreateParams.gcOptions[gcGenerationOptionName] /* currentGeneration */,\n\t);\n\n\t// If version upgrade is not enabled, fall back to the stable GC version.\n\tconst gcVersionInEffect =\n\t\tmc.config.getBoolean(gcVersionUpgradeToV4Key) === true ? nextGCVersion : stableGCVersion;\n\n\t// The GC version is up-to-date if the GC version in effect is at least equal to the GC version in base snapshot.\n\t// If it is not up-to-date, there is a newer version of GC out there which is more reliable than this. So, GC\n\t// should not run as it may produce incorrect / unreliable state.\n\tconst isGCVersionUpToDate =\n\t\tgcVersionInBaseSnapshot === undefined || gcVersionInEffect >= gcVersionInBaseSnapshot;\n\n\t/**\n\t * Whether GC should run or not. The following conditions have to be met to run sweep:\n\t * 1. GC should be enabled for this container.\n\t * 2. GC should not be disabled via disableGC GC option.\n\t * 3. The current GC version should be greater or equal to the GC version in the base snapshot.\n\t *\n\t * These conditions can be overridden via the RunGC feature flag.\n\t */\n\tconst shouldRunGC =\n\t\tmc.config.getBoolean(runGCKey) ??\n\t\t(gcEnabled && !createParams.gcOptions.disableGC && isGCVersionUpToDate);\n\n\t/**\n\t * Whether sweep should run or not. This refers to whether Tombstones should fail on load and whether\n\t * sweep-ready nodes should be deleted.\n\t *\n\t * Assuming overall GC is enabled and sweepTimeout is provided, the following conditions have to be met to run sweep:\n\t *\n\t * 1. Sweep should be enabled for this container.\n\t * 2. Sweep should be enabled for this session.\n\t *\n\t * These conditions can be overridden via the RunSweep feature flag.\n\t */\n\tconst shouldRunSweep =\n\t\t!shouldRunGC || sweepTimeoutMs === undefined\n\t\t\t? false\n\t\t\t: mc.config.getBoolean(runSweepKey) ??\n\t\t\t (sweepAllowed && createParams.gcOptions.enableGCSweep === true);\n\n\t// Override inactive timeout if test config or gc options to override it is set.\n\tconst inactiveTimeoutMs =\n\t\tmc.config.getNumber(\"Fluid.GarbageCollection.TestOverride.InactiveTimeoutMs\") ??\n\t\tcreateParams.gcOptions.inactiveTimeoutMs ??\n\t\tdefaultInactiveTimeoutMs;\n\n\t// Inactive timeout must be greater than sweep timeout since a node goes from active -> inactive -> sweep ready.\n\tif (sweepTimeoutMs !== undefined && inactiveTimeoutMs > sweepTimeoutMs) {\n\t\tthrow new UsageError(\"inactive timeout should not be greater than the sweep timeout\");\n\t}\n\n\t// Whether we are running in test mode. In this mode, unreferenced nodes are immediately deleted.\n\tconst testMode =\n\t\tmc.config.getBoolean(gcTestModeKey) ?? createParams.gcOptions.runGCInTestMode === true;\n\t// Whether we are running in tombstone mode. If disabled, tombstone data will not be written to or read from snapshots,\n\t// and objects will not be marked as tombstoned even if they pass to the \"TombstoneReady\" state during the session.\n\tconst tombstoneMode = mc.config.getBoolean(disableTombstoneKey) !== true;\n\tconst runFullGC = createParams.gcOptions.runFullGC;\n\n\tconst sweepGracePeriodMs =\n\t\tcreateParams.gcOptions.sweepGracePeriodMs ?? defaultSweepGracePeriodMs;\n\tvalidatePrecondition(sweepGracePeriodMs >= 0, \"sweepGracePeriodMs must be non-negative\", {\n\t\tsweepGracePeriodMs,\n\t});\n\n\tconst throwOnInactiveLoad: boolean | undefined = createParams.gcOptions.throwOnInactiveLoad;\n\n\tconst throwOnTombstoneLoadConfig =\n\t\tmc.config.getBoolean(throwOnTombstoneLoadOverrideKey) ??\n\t\tcreateParams.gcOptions[gcDisableThrowOnTombstoneLoadOptionName] !== true;\n\tconst throwOnTombstoneLoad =\n\t\tthrowOnTombstoneLoadConfig && sweepAllowed && !createParams.isSummarizerClient;\n\tconst throwOnTombstoneUsage =\n\t\tmc.config.getBoolean(throwOnTombstoneUsageKey) === true &&\n\t\tsweepAllowed &&\n\t\t!createParams.isSummarizerClient;\n\n\treturn {\n\t\tgcEnabled, // For this document\n\t\tsweepEnabled: sweepAllowed, // For this document (based on current GC Generation option)\n\t\tshouldRunGC, // For this session\n\t\tshouldRunSweep, // For this session\n\t\trunFullGC,\n\t\ttestMode,\n\t\ttombstoneMode,\n\t\tsessionExpiryTimeoutMs,\n\t\tsweepTimeoutMs,\n\t\tsweepGracePeriodMs,\n\t\tinactiveTimeoutMs,\n\t\tpersistedGcFeatureMatrix,\n\t\tgcVersionInBaseSnapshot,\n\t\tgcVersionInEffect,\n\t\tthrowOnInactiveLoad,\n\t\tthrowOnTombstoneLoad,\n\t\tthrowOnTombstoneUsage,\n\t};\n}\n\n/**\n * Sweep timeout is the time after which unreferenced content can be swept.\n * Sweep timeout = session expiry timeout + snapshot cache expiry timeout + one day buffer.\n *\n * The snapshot cache expiry timeout cannot be known precisely but the upper bound is 5 days.\n * The buffer is added to account for any clock skew or other edge cases.\n * We use server timestamps throughout so the skew should be minimal but make it 1 day to be safe.\n */\nfunction computeSweepTimeout(sessionExpiryTimeoutMs: number | undefined): number | undefined {\n\tconst bufferMs = oneDayMs;\n\treturn sessionExpiryTimeoutMs && sessionExpiryTimeoutMs + maxSnapshotCacheExpiryMs + bufferMs;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcDefinitions.d.ts","sourceRoot":"","sources":["../../src/gc/gcDefinitions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,aAAa,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ErD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,SAAS;AAC/D,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,GAAG,QAAQ,CAAC,CAAC,UAAU;AACvE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,QAAQ;AAkH/D;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,kCAAkC;IAClC,SAAS,EAAE,WAAW;IACtB,8DAA8D;IAC9D,YAAY,EAAE,cAAc;IAC5B,6EAA6E;IAC7E,IAAI,EAAE,MAAM;IACZ,+DAA+D;IAC/D,KAAK,EAAE,OAAO;CACd,CAAC;AAOF;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC3C,0DAA0D;IAC1D,KAAK,EAAE,OAAO;CACL,CAAC;AAyPX,8CAA8C;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,gEAAgE;IAChE,MAAM,EAAE,QAAQ;IAChB,mEAAmE;IACnE,QAAQ,EAAE,UAAU;IACpB,yCAAyC;IACzC,cAAc,EAAE,gBAAgB;IAChC,0DAA0D;IAC1D,UAAU,EAAE,YAAY;CACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n\tISummarizeResult,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { ReadAndParseBlob } from \"@fluidframework/runtime-utils\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport {\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tIRefreshSummaryResult,\n} from \"../summary\";\nimport { RuntimeHeaderData } from \"../containerRuntime\";\nimport { ContainerRuntimeGCMessage } from \"../messageTypes\";\n\n/**\n * @alpha\n */\nexport type GCVersion = number;\n\n/** The stable/default version of GC Data */\nexport const stableGCVersion: GCVersion = 3;\n/** The next version of GC Data, to bump to in case we need to regenerate all GC Data across all files. */\nexport const nextGCVersion: GCVersion = 4;\n\n/**\n * This undocumented GC Option (on ContainerRuntime Options) allows an app to disable throwing an error when tombstone\n * object is loaded (requested), merely logging a message instead.\n *\n * By default, attempting to load a Tombstoned object will result in an error.\n */\nexport const gcDisableThrowOnTombstoneLoadOptionName = \"gcDisableThrowOnTombstoneLoad\";\n\n/**\n * This undocumented GC Option (on ContainerRuntime Options) allows configuring which documents can have Sweep enabled.\n * This provides a way to disable both Tombstone Enforcement and Sweep.\n *\n * If unset, Tombstone Enforcement + Sweep will operate as otherwise configured.\n * Otherwise, the Sweep Phase will be disabled for documents where persisted value doesn't match what is passed into this session.\n * This provides a way to disallow Sweep for old documents that may be too difficult for an app to repair,\n * in case a bug is found that violates GC's assumptions.\n *\n * @see GCFeatureMatrix (gcGeneration)\n */\nexport const gcGenerationOptionName = \"gcGeneration\";\n\n/** Config key to turn GC on / off. */\nexport const runGCKey = \"Fluid.GarbageCollection.RunGC\";\n/** Config key to turn GC sweep on / off. */\nexport const runSweepKey = \"Fluid.GarbageCollection.RunSweep\";\n/** Config key to turn GC test mode on / off. */\nexport const gcTestModeKey = \"Fluid.GarbageCollection.GCTestMode\";\n/** Config key to expire a session after a set period of time. Defaults to true. */\nexport const runSessionExpiryKey = \"Fluid.GarbageCollection.RunSessionExpiry\";\n/** Config key to disable the tombstone feature, i.e., tombstone information is not read / written into summary. */\nexport const disableTombstoneKey = \"Fluid.GarbageCollection.DisableTombstone\";\n/** Config key to override throwing an error when tombstone object is loaded (requested). */\nexport const throwOnTombstoneLoadOverrideKey =\n\t\"Fluid.GarbageCollection.ThrowOnTombstoneLoadOverride\";\n/** Config key to enable throwing an error when tombstone object is used (e.g. outgoing or incoming ops). */\nexport const throwOnTombstoneUsageKey = \"Fluid.GarbageCollection.ThrowOnTombstoneUsage\";\n/** Config key to enable GC version upgrade. */\nexport const gcVersionUpgradeToV4Key = \"Fluid.GarbageCollection.GCVersionUpgradeToV4\";\n/** Config key to disable GC sweep for datastores. */\nexport const disableDatastoreSweepKey = \"Fluid.GarbageCollection.DisableDataStoreSweep\";\n/** Config key to disable GC sweep for attachment blobs. */\nexport const disableAttachmentBlobSweepKey = \"Fluid.GarbageCollection.DisableAttachmentBlobSweep\";\n\n// One day in milliseconds.\nexport const oneDayMs = 1 * 24 * 60 * 60 * 1000;\n\n/**\n * The maximum snapshot cache expiry in the driver. This is used to calculate the sweep timeout.\n * Sweep timeout = session expiry timeout + snapshot cache expiry timeout + a buffer.\n * The snapshot cache expiry timeout cannot be known precisely but the upper bound is 5 days, i.e., any snapshot\n * in cache will be invalidated before 5 days.\n */\nexport const maxSnapshotCacheExpiryMs = 5 * oneDayMs;\n\nexport const defaultInactiveTimeoutMs = 7 * oneDayMs; // 7 days\nexport const defaultSessionExpiryDurationMs = 30 * oneDayMs; // 30 days\nexport const defaultSweepGracePeriodMs = 1 * oneDayMs; // 1 day\n\n/**\n * @see IGCMetadata.gcFeatureMatrix and @see gcGenerationOptionName\n * @alpha\n */\nexport type GCFeatureMatrix =\n\t| {\n\t\t\t/**\n\t\t\t * The GC Generation value in effect when this file was created.\n\t\t\t * Gives a way for an app to disqualify old files from GC Sweep.\n\t\t\t * Provided via Container Runtime Options.\n\t\t\t */\n\t\t\tgcGeneration?: number;\n\t\t\t/** Deprecated property from legacy type. Will not be set concurrently with gcGeneration */\n\t\t\ttombstoneGeneration?: undefined;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The Tombstone Generation value in effect when this file was created.\n\t\t\t * Legacy - new containers would get gcGeneration instead (if anything)\n\t\t\t */\n\t\t\ttombstoneGeneration: number;\n\t };\n\n/**\n * @alpha\n */\nexport interface IGCMetadata {\n\t/**\n\t * The version of the GC code that was run to generate the GC data that is written in the summary.\n\t * If the persisted value doesn't match the current value in the code, saved GC data will be discarded and regenerated from scratch.\n\t * Also, used to determine whether GC is enabled for this container or not:\n\t * - A value of 0 or undefined means GC is disabled.\n\t * - A value greater than 0 means GC is enabled.\n\t */\n\treadonly gcFeature?: GCVersion;\n\n\t/**\n\t * A collection of different numerical \"Generations\" for different features,\n\t * used to determine feature availability over time.\n\t * This info may come from multiple sources (FF code, config service, app via Container Runtime Options),\n\t * and pertains to aspects of the document that may be fixed for its lifetime.\n\t *\n\t * For each dimension, if the persisted value doesn't match the currently provided value,\n\t * then this file does not support the corresponding feature as currently implemented.\n\t *\n\t * Guidance is that if no value is provided at runtime, it should result in the current default behavior.\n\t */\n\treadonly gcFeatureMatrix?: GCFeatureMatrix;\n\t/**\n\t * Tells whether the GC sweep phase is enabled for this container.\n\t * - True means sweep phase is enabled.\n\t * - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.\n\t *\n\t * @deprecated use GCFeatureMatrix.gcGeneration instead. @see GCFeatureMatrix.gcGeneration\n\t */\n\treadonly sweepEnabled?: boolean;\n\t/** If this is present, the session for this container will expire after this time and the container will close */\n\treadonly sessionExpiryTimeoutMs?: number;\n\t/** How long to wait after an object is unreferenced before deleting it via GC Sweep */\n\treadonly sweepTimeoutMs?: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection mark phase run.\n * @alpha\n */\nexport interface IMarkPhaseStats {\n\t/** The number of nodes in the container. */\n\tnodeCount: number;\n\t/** The number of data stores in the container. */\n\tdataStoreCount: number;\n\t/** The number of attachment blobs in the container. */\n\tattachmentBlobCount: number;\n\t/** The number of unreferenced nodes in the container. */\n\tunrefNodeCount: number;\n\t/** The number of unreferenced data stores in the container. */\n\tunrefDataStoreCount: number;\n\t/** The number of unreferenced attachment blobs in the container. */\n\tunrefAttachmentBlobCount: number;\n\t/** The number of nodes whose reference state updated since last GC run. */\n\tupdatedNodeCount: number;\n\t/** The number of data stores whose reference state updated since last GC run. */\n\tupdatedDataStoreCount: number;\n\t/** The number of attachment blobs whose reference state updated since last GC run. */\n\tupdatedAttachmentBlobCount: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection sweep phase run.\n * @alpha\n */\nexport interface ISweepPhaseStats {\n\t/** The number of nodes in the lifetime of the container. */\n\tlifetimeNodeCount: number;\n\t/** The number of data stores in the lifetime of the container. */\n\tlifetimeDataStoreCount: number;\n\t/** The number of attachment blobs in the lifetime of the container. */\n\tlifetimeAttachmentBlobCount: number;\n\t/** The number of deleted nodes in the container. */\n\tdeletedNodeCount: number;\n\t/** The number of deleted data stores in the container. */\n\tdeletedDataStoreCount: number;\n\t/** The number of deleted attachment blobs in the container. */\n\tdeletedAttachmentBlobCount: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection run.\n * @alpha\n */\nexport interface IGCStats extends IMarkPhaseStats, ISweepPhaseStats {}\n\n/**\n * The types of GC nodes in the GC reference graph.\n * @alpha\n */\nexport const GCNodeType = {\n\t// Nodes that are for data stores.\n\tDataStore: \"DataStore\",\n\t// Nodes that are within a data store. For example, DDS nodes.\n\tSubDataStore: \"SubDataStore\",\n\t// Nodes that are for attachment blobs, i.e., blobs uploaded via BlobManager.\n\tBlob: \"Blob\",\n\t// Nodes that are neither of the above. For example, root node.\n\tOther: \"Other\",\n};\n\n/**\n * @alpha\n */\nexport type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];\n\n/**\n * The type of a garbage collection message.\n * @internal\n */\nexport const GarbageCollectionMessageType = {\n\t/** Message sent directing GC to delete the given nodes */\n\tSweep: \"Sweep\",\n} as const;\n\n/**\n * @internal\n */\nexport type GarbageCollectionMessageType =\n\t(typeof GarbageCollectionMessageType)[keyof typeof GarbageCollectionMessageType];\n\n/**\n * The garbage collection sweep message.\n * @internal\n */\nexport interface ISweepMessage {\n\ttype: \"Sweep\";\n\t// The ids of nodes that are deleted.\n\tdeletedNodeIds: string[];\n}\n\n/**\n * Type for a message to be used for sending / received garbage collection messages.\n * @internal\n */\nexport type GarbageCollectionMessage = ISweepMessage;\n\n/**\n * Defines the APIs for the runtime object to be passed to the garbage collector.\n */\nexport interface IGarbageCollectionRuntime {\n\t/** Before GC runs, called to notify the runtime to update any pending GC state. */\n\tupdateStateBeforeGC(): Promise<void>;\n\t/** Returns the garbage collection data of the runtime. */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\t/** After GC has run, called to notify the runtime of routes that are used in it. */\n\tupdateUsedRoutes(usedRoutes: readonly string[]): void;\n\t/** After GC has run, called to notify the runtime of routes that are unused in it. */\n\tupdateUnusedRoutes(unusedRoutes: readonly string[]): void;\n\t/**\n\t * After GC has run and identified nodes that are sweep ready, called to delete the sweep ready nodes. The runtime\n\t * should return the routes of nodes that were deleted.\n\t * @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.\n\t */\n\tdeleteSweepReadyNodes(sweepReadyRoutes: readonly string[]): readonly string[];\n\t/** Called to notify the runtime of routes that are tombstones. */\n\tupdateTombstonedRoutes(tombstoneRoutes: readonly string[]): void;\n\t/** Returns a referenced timestamp to be used to track unreferenced nodes. */\n\tgetCurrentReferenceTimestampMs(): number | undefined;\n\t/** Returns the type of the GC node. */\n\tgetNodeType(nodePath: string): GCNodeType;\n\t/** Called when the runtime should close because of an error. */\n\tcloseFn: (error?: ICriticalContainerError) => void;\n}\n\n/** Defines the contract for the garbage collector. */\nexport interface IGarbageCollector {\n\t/** Tells whether GC should run or not. */\n\treadonly shouldRunGC: boolean;\n\t/** Tells whether the GC state in summary needs to be reset in the next summary. */\n\treadonly summaryStateNeedsReset: boolean;\n\t/** The count of data stores whose GC state updated since the last summary. */\n\treadonly updatedDSCountSinceLastSummary: number;\n\t/** Tells whether tombstone feature is enabled and enforced. */\n\treadonly tombstoneEnforcementAllowed: boolean;\n\t/** Tells whether loading a tombstone object should fail or merely log. */\n\treadonly throwOnTombstoneLoad: boolean;\n\t/** Tells whether using a tombstone object should fail or merely log. */\n\treadonly throwOnTombstoneUsage: boolean;\n\t/** Initialize the state from the base snapshot after its creation. */\n\tinitializeBaseState(): Promise<void>;\n\t/** Run garbage collection and update the reference / used state of the system. */\n\tcollectGarbage(\n\t\toptions: {\n\t\t\tlogger?: ITelemetryLoggerExt;\n\t\t\trunSweep?: boolean;\n\t\t\tfullGC?: boolean;\n\t\t},\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<IGCStats | undefined>;\n\t/** Summarizes the GC data and returns it as a summary tree. */\n\tsummarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummarizeResult | undefined;\n\t/** Returns the garbage collector specific metadata to be written into the summary. */\n\tgetMetadata(): IGCMetadata;\n\t/** Returns the GC details generated from the base snapshot. */\n\tgetBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n\t/** Called when the latest summary of the system has been refreshed. */\n\trefreshLatestSummary(result: IRefreshSummaryResult): Promise<void>;\n\t/**\n\t * Called when a node with the given path is updated. If the node is inactive or tombstoned, this will log an error\n\t * or throw an error if failing on incorrect usage is configured.\n\t */\n\tnodeUpdated(\n\t\tnodePath: string,\n\t\treason: \"Loaded\" | \"Changed\",\n\t\ttimestampMs?: number,\n\t\tpackagePath?: readonly string[],\n\t\trequest?: IRequest,\n\t\theaderData?: RuntimeHeaderData,\n\t): void;\n\t/** Called when a reference is added to a node. Used to identify nodes that were referenced between summaries. */\n\taddedOutboundReference(fromNodePath: string, toNodePath: string): void;\n\t/** Called to process a garbage collection message. */\n\tprocessMessage(message: ContainerRuntimeGCMessage, local: boolean): void;\n\t/** Returns true if this node has been deleted by GC during sweep phase. */\n\tisNodeDeleted(nodePath: string): boolean;\n\tsetConnectionState(connected: boolean, clientId?: string): void;\n\tdispose(): void;\n}\n\n/** Parameters necessary for creating a GarbageCollector. */\nexport interface IGarbageCollectorCreateParams {\n\treadonly runtime: IGarbageCollectionRuntime;\n\treadonly gcOptions: IGCRuntimeOptions;\n\treadonly baseLogger: ITelemetryLoggerExt;\n\treadonly existing: boolean;\n\treadonly metadata: IContainerRuntimeMetadata | undefined;\n\treadonly createContainerMetadata: ICreateContainerMetadata;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\treadonly isSummarizerClient: boolean;\n\treadonly getNodePackagePath: (nodePath: string) => Promise<readonly string[] | undefined>;\n\treadonly getLastSummaryTimestampMs: () => number | undefined;\n\treadonly readAndParseBlob: ReadAndParseBlob;\n\treadonly submitMessage: (message: ContainerRuntimeGCMessage) => void;\n}\n\n/**\n * @alpha\n */\nexport interface IGCRuntimeOptions {\n\t/**\n\t * Flag that if true, will enable running garbage collection (GC) for a new container.\n\t *\n\t * GC has mark phase and sweep phase. In mark phase, unreferenced objects are identified\n\t * and marked as such in the summary. This option enables the mark phase.\n\t * In sweep phase, unreferenced objects are eventually deleted from the container if they meet certain conditions.\n\t * Sweep phase can be enabled using the \"enableGCSweep\" option.\n\t *\n\t * Note: This setting is persisted in the container's summary and cannot be changed.\n\t */\n\tgcAllowed?: boolean;\n\n\t/**\n\t * Flag that if true, will disable garbage collection for the session.\n\t * Can be used to disable running GC on containers where it is allowed via the gcAllowed option.\n\t */\n\tdisableGC?: boolean;\n\n\t/**\n\t * Flag that if true, will enable the full Sweep Phase of garbage collection for this session,\n\t * where Tombstoned objects are permanently deleted from the container.\n\t *\n\t * IMPORTANT: This only applies if this document is allowed to run Sweep Phase.\n\t *\n\t * Current default behavior is for Sweep Phase not to delete Tombstoned objects,\n\t * but merely to prevent them from being loaded.\n\t */\n\tenableGCSweep?: true;\n\n\t/**\n\t * Flag that will bypass optimizations and generate GC data for all nodes irrespective of whether a node\n\t * changed or not.\n\t */\n\trunFullGC?: boolean;\n\n\t/**\n\t * Maximum session duration for a new container. If not present, a default value will be used.\n\t *\n\t * Note: This setting is persisted in the container's summary and cannot be changed.\n\t */\n\tsessionExpiryTimeoutMs?: number;\n\n\t/**\n\t * Delay between when Tombstone should run and when the object should be deleted.\n\t * This grace period gives a chance to intervene to recover if needed, before Sweep deletes the object.\n\t * If not present, a default (non-zero) value will be used.\n\t */\n\tsweepGracePeriodMs?: number;\n\n\t/**\n\t * Allows additional GC options to be passed.\n\t */\n\t[key: string]: any;\n}\n\n/**\n * The configurations for Garbage Collector that determines what runs and how.\n */\nexport interface IGarbageCollectorConfigs {\n\t/**\n\t * Tracks if GC is enabled for this document. This is specified during document creation and doesn't change\n\t * throughout its lifetime.\n\t */\n\treadonly gcEnabled: boolean;\n\t/**\n\t * Tracks if sweep phase is enabled for this document. This is specified during document creation and doesn't change\n\t * throughout its lifetime.\n\t */\n\treadonly sweepEnabled: boolean;\n\t/**\n\t * Tracks if GC should run or not. Even if GC is enabled for a document (see gcEnabled), it can be explicitly\n\t * disabled via runtime options or feature flags.\n\t */\n\treadonly shouldRunGC: boolean;\n\t/**\n\t * Tracks if sweep phase should run or not. Even if the sweep phase is enabled for a document (see sweepEnabled), it\n\t * can be explicitly disabled via feature flags. It also won't run if session expiry is not enabled.\n\t */\n\treadonly shouldRunSweep: boolean;\n\t/**\n\t * If true, bypass optimizations and generate GC data for all nodes irrespective of whether a node changed or not.\n\t */\n\treadonly runFullGC: boolean | undefined;\n\t/** The time in ms to expire a session for a client for gc. */\n\treadonly sessionExpiryTimeoutMs: number | undefined;\n\t/** The time after which an unreferenced node is ready to be swept. */\n\treadonly sweepTimeoutMs: number | undefined;\n\t/**\n\t * The delay between tombstone and sweep. Not persisted, so concurrent sessions may use different values.\n\t * Sweep is implemented in an eventually-consistent way so this is acceptable.\n\t */\n\treadonly sweepGracePeriodMs: number;\n\t/** The time after which an unreferenced node is inactive. */\n\treadonly inactiveTimeoutMs: number;\n\t/** Tracks whether GC should run in test mode. In this mode, unreferenced objects are deleted immediately. */\n\treadonly testMode: boolean;\n\t/**\n\t * Tracks whether GC should run in tombstone mode. In this mode, objects are marked as tombstones as a step along the\n\t * way before they are fully deleted.\n\t * In interactive (non-summarizer) clients, tombstone objects behave as if they are deleted, i.e., access to them\n\t * is not allowed. However, these objects can be accessed after referencing them first. It is used as a \"warning\"\n\t * step before sweep, where objects wrongly marked as unreferenced can be recovered.\n\t */\n\treadonly tombstoneMode: boolean;\n\t/** @see GCFeatureMatrix. */\n\treadonly persistedGcFeatureMatrix: GCFeatureMatrix | undefined;\n\t/** The version of GC in the base snapshot. */\n\treadonly gcVersionInBaseSnapshot: GCVersion | undefined;\n\t/** The current version of GC data in the running code */\n\treadonly gcVersionInEffect: GCVersion;\n\t/** It is easier for users to diagnose InactiveObject usage if we throw on load, which this option enables */\n\treadonly throwOnInactiveLoad: boolean | undefined;\n\t/** If true, throw an error when a tombstone data store is retrieved */\n\treadonly throwOnTombstoneLoad: boolean;\n\t/** If true, throw an error when a tombstone data store is used. */\n\treadonly throwOnTombstoneUsage: boolean;\n}\n\n/** The state of node that is unreferenced. */\nexport const UnreferencedState = {\n\t/** The node is active, i.e., it can become referenced again. */\n\tActive: \"Active\",\n\t/** The node is inactive, i.e., it should not become referenced. */\n\tInactive: \"Inactive\",\n\t/** The node is ready to be tombstoned */\n\tTombstoneReady: \"TombstoneReady\",\n\t/** The node is ready to be deleted by the sweep phase. */\n\tSweepReady: \"SweepReady\",\n} as const;\nexport type UnreferencedState = (typeof UnreferencedState)[keyof typeof UnreferencedState];\n\n/**\n * Represents the result of a GC run.\n */\nexport interface IGCResult {\n\t/** The ids of nodes that are referenced in the referenced graph */\n\treferencedNodeIds: string[];\n\t/** The ids of nodes that are not-referenced or deleted in the referenced graph */\n\tdeletedNodeIds: string[];\n}\n"]}
|
package/lib/gc/gcHelpers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcHelpers.js","sourceRoot":"","sources":["../../src/gc/gcHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EACN,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,GAGlB,MAAM,qCAAqC,CAAC;AAQ7C,MAAM,U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,CAAC;QACpC,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAEvD,MAAM,cAAc,GAAG,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACtD,MAAM,CACL,cAAc,EAAE,UAAU,KAAK,SAAS,EACxC,KAAK,CAAC,kEAAkE,CACxE,CAAC;QAEF,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC/C,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC/C;IACD,OAAO,iBAAiB,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAAC,GAAW;IACxD,OAAO,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AACtC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iCAAiC,CAChD,qBAA4B,EAC5B,cAAsD;IAEtD,yDAAyD;IACzD,OAAO,cAAc,KAAK,QAAQ,CAAC;AACpC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tgcBlobPrefix,\n\tgcDeletedBlobKey,\n\tgcTombstoneBlobKey,\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n} from \"@fluidframework/runtime-definitions\";\nimport { GCFeatureMatrix, GCVersion, IGCMetadata } from \"./gcDefinitions\";\nimport {\n\tIGarbageCollectionNodeData,\n\tIGarbageCollectionSnapshotData,\n\tIGarbageCollectionState,\n} from \"./gcSummaryDefinitions\";\n\nexport function getGCVersion(metadata?: IGCMetadata): GCVersion {\n\tif (!metadata) {\n\t\t// Force to 0/disallowed in prior versions\n\t\treturn 0;\n\t}\n\treturn metadata.gcFeature ?? 0;\n}\n\n/**\n * Indicates whether Sweep is allowed for this document based on the persisted GC Feature Matrix and current gcGeneration.\n * This applies to the entire Sweep Phase the same - both Tombstone Enforcement (i.e. should loading a Tombstone fail?) and Deletion.\n *\n * In order to protect old documents that were created at a time when known bugs exist that violate GC's invariants\n * such that enforcing GC Sweep would cause legitimate data loss, the container author may increment the generation value for Sweep\n * such that containers created with a different value will not be subjected to GC Sweep.\n *\n * If no generation is provided, Sweep will be enabled for all documents.\n *\n * For backwards compatibility, the current generation value is also compared against the persisted gcTombstoneGeneration if present.\n *\n * @param featureMatrix - The GC Feature Matrix, containing the persisted generation value\n * @param currentGeneration - The current app-provided gcGeneration value\n * @returns true if GC Sweep should be allowed for this document\n */\nexport function shouldAllowGcSweep(\n\tfeatureMatrix: GCFeatureMatrix,\n\tcurrentGeneration: number | undefined,\n): boolean {\n\t// If no Generation value is provided for this session, default to true\n\tif (currentGeneration === undefined) {\n\t\treturn true;\n\t}\n\n\t// tombstoneGeneration is the predecessor and needs to be supported for back-compat reasons\n\tconst targetGeneration = featureMatrix.tombstoneGeneration ?? featureMatrix.gcGeneration;\n\n\treturn currentGeneration === targetGeneration;\n}\n\n/**\n * Sorts the given GC state as per the id of the GC nodes. It also sorts the outbound routes array of each node.\n */\nexport function generateSortedGCState(gcState: IGarbageCollectionState): IGarbageCollectionState {\n\tconst sortableArray: [string, IGarbageCollectionNodeData][] = Object.entries(gcState.gcNodes);\n\tsortableArray.sort(([a], [b]) => a.localeCompare(b));\n\tconst sortedGCState: IGarbageCollectionState = { gcNodes: {} };\n\tfor (const [nodeId, nodeData] of sortableArray) {\n\t\tnodeData.outboundRoutes.sort();\n\t\tsortedGCState.gcNodes[nodeId] = nodeData;\n\t}\n\treturn sortedGCState;\n}\n\n/**\n * Concatenates the given GC states and returns the concatenated GC state.\n */\nexport function concatGarbageCollectionStates(\n\tgcState1: IGarbageCollectionState,\n\tgcState2: IGarbageCollectionState,\n): IGarbageCollectionState {\n\tconst combinedGCNodes: { [id: string]: IGarbageCollectionNodeData } = {};\n\tfor (const [nodeId, nodeData] of Object.entries(gcState1.gcNodes)) {\n\t\tcombinedGCNodes[nodeId] = {\n\t\t\toutboundRoutes: Array.from(nodeData.outboundRoutes),\n\t\t\tunreferencedTimestampMs: nodeData.unreferencedTimestampMs,\n\t\t};\n\t}\n\n\tfor (const [nodeId, nodeData] of Object.entries(gcState2.gcNodes)) {\n\t\tlet combineNodeData = combinedGCNodes[nodeId];\n\t\tif (combineNodeData === undefined) {\n\t\t\tcombineNodeData = {\n\t\t\t\toutboundRoutes: Array.from(nodeData.outboundRoutes),\n\t\t\t\tunreferencedTimestampMs: nodeData.unreferencedTimestampMs,\n\t\t\t};\n\t\t} else {\n\t\t\t// Validate that same node doesn't have different unreferenced timestamp.\n\t\t\tif (\n\t\t\t\tnodeData.unreferencedTimestampMs !== undefined &&\n\t\t\t\tcombineNodeData.unreferencedTimestampMs !== undefined\n\t\t\t) {\n\t\t\t\tassert(\n\t\t\t\t\tnodeData.unreferencedTimestampMs === combineNodeData.unreferencedTimestampMs,\n\t\t\t\t\t0x5d7 /* Two entries for the same GC node with different unreferenced timestamp */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tcombineNodeData = {\n\t\t\t\toutboundRoutes: [\n\t\t\t\t\t...new Set([...nodeData.outboundRoutes, ...combineNodeData.outboundRoutes]),\n\t\t\t\t],\n\t\t\t\tunreferencedTimestampMs:\n\t\t\t\t\tnodeData.unreferencedTimestampMs ?? combineNodeData.unreferencedTimestampMs,\n\t\t\t};\n\t\t}\n\t\tcombinedGCNodes[nodeId] = combineNodeData;\n\t}\n\treturn { gcNodes: combinedGCNodes };\n}\n\n/**\n * Helper function that clones the GC data.\n * @param gcData - The GC data to clone.\n * @returns a clone of the given GC data.\n */\nexport function cloneGCData(gcData: IGarbageCollectionData): IGarbageCollectionData {\n\tconst clonedGCNodes: { [id: string]: string[] } = {};\n\tfor (const [id, outboundRoutes] of Object.entries(gcData.gcNodes)) {\n\t\tclonedGCNodes[id] = Array.from(outboundRoutes);\n\t}\n\treturn {\n\t\tgcNodes: clonedGCNodes,\n\t};\n}\n\n/**\n * Concatenates the given GC data and returns the concatenated GC data.\n */\nexport function concatGarbageCollectionData(\n\tgcData1: IGarbageCollectionData,\n\tgcData2: IGarbageCollectionData,\n) {\n\tconst combinedGCData: IGarbageCollectionData = cloneGCData(gcData1);\n\tfor (const [id, routes] of Object.entries(gcData2.gcNodes)) {\n\t\tif (combinedGCData.gcNodes[id] === undefined) {\n\t\t\tcombinedGCData.gcNodes[id] = Array.from(routes);\n\t\t} else {\n\t\t\tconst combinedRoutes = [...routes, ...combinedGCData.gcNodes[id]];\n\t\t\tcombinedGCData.gcNodes[id] = [...new Set(combinedRoutes)];\n\t\t}\n\t}\n\treturn combinedGCData;\n}\n\n/**\n * Gets the base garbage collection state from the given snapshot tree. It contains GC state, deleted nodes and\n * tombstones. The GC state may be written into multiple blobs. Merge the GC state from all such blobs into one.\n */\nexport async function getGCDataFromSnapshot(\n\tgcSnapshotTree: ISnapshotTree,\n\treadAndParseBlob: <T>(id: string) => Promise<T>,\n): Promise<IGarbageCollectionSnapshotData> {\n\tlet rootGCState: IGarbageCollectionState = { gcNodes: {} };\n\tlet tombstones: string[] | undefined;\n\tlet deletedNodes: string[] | undefined;\n\tfor (const key of Object.keys(gcSnapshotTree.blobs)) {\n\t\t// Update deleted nodes blob.\n\t\tif (key === gcDeletedBlobKey) {\n\t\t\tdeletedNodes = await readAndParseBlob<string[]>(gcSnapshotTree.blobs[key]);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Update tombstone blob.\n\t\tif (key === gcTombstoneBlobKey) {\n\t\t\ttombstones = await readAndParseBlob<string[]>(gcSnapshotTree.blobs[key]);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Skip blobs that do not start with the GC prefix.\n\t\tif (!key.startsWith(gcBlobPrefix)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst blobId = gcSnapshotTree.blobs[key];\n\t\tif (blobId === undefined) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst gcState = await readAndParseBlob<IGarbageCollectionState>(blobId);\n\t\tassert(gcState !== undefined, 0x5d8 /* GC blob missing from snapshot */);\n\t\t// Merge the GC state of this blob into the root GC state.\n\t\trootGCState = concatGarbageCollectionStates(rootGCState, gcState);\n\t}\n\treturn { gcState: rootGCState, tombstones, deletedNodes };\n}\n\n/**\n * Helper function that unpacks the GC details of the children from a given node's GC details.\n * @param gcDetails - The GC details of a node.\n * @returns A map of GC details of each children of the the given node.\n */\nexport function unpackChildNodesGCDetails(gcDetails: IGarbageCollectionDetailsBase) {\n\tconst childGCDetailsMap: Map<string, IGarbageCollectionDetailsBase> = new Map();\n\n\t// If GC data is not available, bail out.\n\tif (gcDetails.gcData === undefined) {\n\t\treturn childGCDetailsMap;\n\t}\n\n\tconst gcNodes = gcDetails.gcData.gcNodes;\n\tfor (const [id, outboundRoutes] of Object.entries(gcNodes)) {\n\t\t// Skip self-node since only children GC data is to be generated.\n\t\tif (id === \"/\") {\n\t\t\tcontinue;\n\t\t}\n\n\t\tassert(id.startsWith(\"/\"), 0x5d9 /* node id should always be an absolute route */);\n\t\tconst childId = id.split(\"/\")[1];\n\t\tlet childGCNodeId = id.slice(childId.length + 1);\n\t\t// GC node id always begins with \"/\". Handle the special case where a child's id in the parent's GC nodes is\n\t\t// of format `/root`. In this case, the childId is root and childGCNodeId is \"\". Make childGCNodeId = \"/\".\n\t\tif (childGCNodeId === \"\") {\n\t\t\tchildGCNodeId = \"/\";\n\t\t}\n\n\t\tlet childGCDetails = childGCDetailsMap.get(childId);\n\t\tif (childGCDetails === undefined) {\n\t\t\tchildGCDetails = { gcData: { gcNodes: {} }, usedRoutes: [] };\n\t\t}\n\t\t// gcData should not undefined as its always at least initialized as empty above.\n\t\tassert(\n\t\t\tchildGCDetails.gcData !== undefined,\n\t\t\t0x5da /* Child GC data should have been initialized */,\n\t\t);\n\t\tchildGCDetails.gcData.gcNodes[childGCNodeId] = [...new Set(outboundRoutes)];\n\t\tchildGCDetailsMap.set(childId, childGCDetails);\n\t}\n\n\tif (gcDetails.usedRoutes === undefined) {\n\t\treturn childGCDetailsMap;\n\t}\n\n\t// Remove the node's self used route, if any, and generate the children used routes.\n\tconst usedRoutes = gcDetails.usedRoutes.filter((route) => route !== \"\" && route !== \"/\");\n\tfor (const route of usedRoutes) {\n\t\tassert(route.startsWith(\"/\"), 0x5db /* Used route should always be an absolute route */);\n\t\tconst childId = route.split(\"/\")[1];\n\t\tconst childUsedRoute = route.slice(childId.length + 1);\n\n\t\tconst childGCDetails = childGCDetailsMap.get(childId);\n\t\tassert(\n\t\t\tchildGCDetails?.usedRoutes !== undefined,\n\t\t\t0x5dc /* This should have be initialized when generate GC nodes above */,\n\t\t);\n\n\t\tchildGCDetails.usedRoutes.push(childUsedRoute);\n\t\tchildGCDetailsMap.set(childId, childGCDetails);\n\t}\n\treturn childGCDetailsMap;\n}\n\n/**\n * Trims the leading and trailing slashes from the given string.\n * @param str - A string that may contain leading and / or trailing slashes.\n * @returns A new string without leading and trailing slashes.\n */\nexport function trimLeadingAndTrailingSlashes(str: string) {\n\treturn str.replace(/^\\/+|\\/+$/g, \"\");\n}\n\n/**\n * Utility to implement compat behaviors given an unknown message type\n * The parameters are typed to support compile-time enforcement of handling all known types/behaviors\n *\n * @param _unknownGCMessageType - Typed as never to ensure all known types have been\n * handled before calling this function (e.g. in a switch statement).\n * @param compatBehavior - Typed redundantly with CompatModeBehavior to ensure handling is added when updating that type\n */\nexport function compatBehaviorAllowsGCMessageType(\n\t_unknownGCMessageType: never,\n\tcompatBehavior: \"Ignore\" | \"FailToProcess\" | undefined,\n): boolean {\n\t// undefined defaults to same behavior as \"FailToProcess\"\n\treturn compatBehavior === \"Ignore\";\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcReferenceGraphAlgorithm.d.ts","sourceRoot":"","sources":["../../src/gc/gcReferenceGraphAlgorithm.ts"],"names":[],"mappings":"AA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AAC,CAAC;SAC3B;aAAM;YACN,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACxB;KACD;IACD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC;AAC9C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IGCResult } from \"./gcDefinitions\";\n\n/**\n * Runs garbage collection on the given reference graph.\n * @param referenceGraph - The reference graph to run GC on. It's a list of nodes where each node has an id and set of\n * routes to other nodes in the graph.\n * @param rootIds - The ids of root nodes that are considered referenced.\n * @returns the ids of referenced nodes and the ids of deleted nodes in the referenced graph.\n */\nexport function runGarbageCollection(\n\treferenceGraph: { [id: string]: string[] },\n\trootIds: string[],\n): IGCResult {\n\t// This set keeps track of nodes that we have visited. It is used to detect cycles in the graph.\n\tconst visited: Set<string> = new Set();\n\n\t// This tracks the ids of referenced nodes. The nodes corresponding to rootIds are always considered\n\t// referenced so we start with those.\n\tconst referencedIds: string[] = [...rootIds];\n\tfor (const id of referencedIds) {\n\t\t// If we have already seen this node, ignore and continue. Else, add it to visited list.\n\t\tif (visited.has(id)) {\n\t\t\tcontinue;\n\t\t}\n\t\tvisited.add(id);\n\n\t\t// Get the node for the referenced id and add its outbound routes to referencedIds since they are\n\t\t// also referenced.\n\t\tconst routes = referenceGraph[id];\n\t\tif (routes !== undefined) {\n\t\t\treferencedIds.push(...routes);\n\t\t}\n\t}\n\n\tconst referencedNodeIds: string[] = [];\n\tconst deletedNodeIds: string[] = [];\n\tfor (const id of Object.keys(referenceGraph)) {\n\t\t// The nodes from the reference graph whose ids are in the visited list are referenced.\n\t\t// The rest of the nodes are deleted.\n\t\tif (visited.has(id)) {\n\t\t\treferencedNodeIds.push(id);\n\t\t} else {\n\t\t\tdeletedNodeIds.push(id);\n\t\t}\n\t}\n\treturn { referencedNodeIds, deletedNodeIds };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcSummaryDefinitions.d.ts","sourceRoot":"","sources":["../../src/gc/gcSummaryDefinitions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;OAEG;IACH,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACvC,OAAO,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,0BAA0B,CAAA;KAAE,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC9C,8FAA8F;IAC9F,OAAO,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAC7C,uDAAuD;IACvD,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACjC,oDAAoD;IACpD,YAAY,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,sCAAsC;IACtD,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,gCAAgC;IAChC,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcSummaryDefinitions.js","sourceRoot":"","sources":["../../src/gc/gcSummaryDefinitions.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IGarbageCollectionData } from \"@fluidframework/runtime-definitions\";\n\n/**\n * The garbage collection data of each node in the reference graph. Each node's GC data is written in the summary\n * in this format.\n */\nexport interface IGarbageCollectionNodeData {\n\t/**\n\t * The set of routes to other nodes in the graph.\n\t */\n\toutboundRoutes: string[];\n\t/**\n\t * If the node is unreferenced, the timestamp of when it was marked unreferenced.\n\t */\n\tunreferencedTimestampMs?: number;\n}\n\n/**\n * The garbage collection state of the reference graph. It contains a list of all the nodes in the graph and their\n * GC data. The GC data is written in the summary in this format.\n */\nexport interface IGarbageCollectionState {\n\tgcNodes: { [id: string]: IGarbageCollectionNodeData };\n}\n\n/**\n * The GC data that is read from a snapshot. It contains the Garbage CollectionState state and tombstone state.\n */\nexport interface IGarbageCollectionSnapshotData {\n\t/** The garbage collection state. It is a list of nodes in the container and their GC data. */\n\tgcState: IGarbageCollectionState | undefined;\n\t/** A list of nodes that have been tombstoned by GC. */\n\ttombstones: string[] | undefined;\n\t/** A list of nodes that have been deleted by GC. */\n\tdeletedNodes: string[] | undefined;\n}\n\n/**\n * @deprecated IGarbageCollectionState is written in the root of the summary now.\n * Legacy GC details from when the GC details were written at the data store's summary tree.\n */\nexport interface IGarbageCollectionSummaryDetailsLegacy {\n\t/** A list of routes to Fluid objects that are used in this node. */\n\tusedRoutes?: string[];\n\t/** The GC data of this node. */\n\tgcData?: IGarbageCollectionData;\n\t/** If this node is unreferenced, the time when it was marked as such. */\n\tunrefTimestamp?: number;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcSummaryStateTracker.d.ts","sourceRoot":"","sources":["../../src/gc/gcSummaryStateTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAKN,gBAAgB,EAEhB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAa,wBAAwB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhF,OAAO,EAAE,8BAA8B,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjG,eAAO,MAAM,cAAc,QAAyB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,iBAAiB,EAA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OAEG;IACI,yBAAyB,CAAC,KAAe;QAC/C,IAAI,CAAC,8BAA8B,IAAI,KAAK,CAAC,qBAAqB,CAAC;IACpE,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SummaryType } from \"@fluidframework/protocol-definitions\";\nimport {\n\tgcBlobPrefix,\n\tgcDeletedBlobKey,\n\tgcTombstoneBlobKey,\n\tgcTreeKey,\n\tISummarizeResult,\n\tISummaryTreeWithStats,\n} from \"@fluidframework/runtime-definitions\";\nimport { mergeStats, SummaryTreeBuilder } from \"@fluidframework/runtime-utils\";\nimport { IRefreshSummaryResult } from \"../summary\";\nimport { GCVersion, IGarbageCollectorConfigs, IGCStats } from \"./gcDefinitions\";\nimport { generateSortedGCState } from \"./gcHelpers\";\nimport { IGarbageCollectionSnapshotData, IGarbageCollectionState } from \"./gcSummaryDefinitions\";\n\nexport const gcStateBlobKey = `${gcBlobPrefix}_root`;\n\n/**\n * The GC data that is tracked for a summary.\n */\nexport interface IGCSummaryTrackingData {\n\tserializedGCState: string | undefined;\n\tserializedTombstones: string | undefined;\n\tserializedDeletedNodes: string | undefined;\n}\n\n/**\n * Encapsulates the garbage collection state that is tracked across summaries.\n * It maintains the GC state as per the latest summary in by the server. It updates state when a summary tracked by this\n * client is acked by the server or from a snapshot is downloaded from the server.\n * On summarize, it decides whether to write new state or re-use previous summary's state.\n */\nexport class GCSummaryStateTracker {\n\t// This is the version of GC data in the latest summary being tracked.\n\tprivate latestSummaryGCVersion: GCVersion;\n\n\t// Keeps track of the GC data from the latest summary successfully acked by the server.\n\tprivate latestSummaryData: IGCSummaryTrackingData | undefined;\n\t// Keeps track of the GC data from the last summary submitted to the server but not yet acked.\n\tprivate pendingSummaryData: IGCSummaryTrackingData | undefined;\n\n\t// Tracks whether there was GC was run in latest summary being tracked.\n\tprivate wasGCRunInLatestSummary: boolean;\n\n\t// Tracks the count of data stores whose state updated since the last summary, i.e., they went from referenced\n\t// to unreferenced or vice-versa.\n\tpublic updatedDSCountSinceLastSummary: number = 0;\n\n\tconstructor(\n\t\t// Tells whether GC should run or not.\n\t\tprivate readonly configs: Pick<\n\t\t\tIGarbageCollectorConfigs,\n\t\t\t\"shouldRunGC\" | \"tombstoneMode\" | \"gcVersionInBaseSnapshot\" | \"gcVersionInEffect\"\n\t\t>,\n\t\t// Tells whether GC was run in the base snapshot this container loaded from.\n\t\twasGCRunInBaseSnapshot: boolean,\n\t) {\n\t\tthis.wasGCRunInLatestSummary = wasGCRunInBaseSnapshot;\n\t\t// For existing document, the latest summary is the one that we loaded from. So, use its GC version as the\n\t\t// latest tracked GC version. For new documents, we will be writing the first summary with the current version.\n\t\tthis.latestSummaryGCVersion =\n\t\t\tthis.configs.gcVersionInBaseSnapshot ?? this.configs.gcVersionInEffect;\n\t}\n\n\t/**\n\t * Tells whether the GC state needs to be reset. This can happen under 3 conditions:\n\t *\n\t * 1. The base snapshot contains GC state but GC is disabled. This will happen the first time GC is disabled after\n\t * it was enabled before. GC state needs to be removed from summary and all nodes should be marked referenced.\n\t *\n\t * 2. The base snapshot does not have GC state but GC is enabled. This will happen the very first time GC runs on\n\t * a document and the first time GC is enabled after is was disabled before.\n\t *\n\t * 3. GC is enabled and the latest summary state is refreshed from a snapshot that had GC disabled and vice-versa.\n\t *\n\t * Note that the state will be reset only once for the first summary generated after this returns true. After that,\n\t * this will return false.\n\t */\n\tpublic get doesGCStateNeedReset(): boolean {\n\t\treturn this.wasGCRunInLatestSummary !== this.configs.shouldRunGC;\n\t}\n\n\t/**\n\t * Tells whether the GC state needs to be reset in the next summary. We need to do this if:\n\t *\n\t * 1. GC was enabled and is now disabled. The GC state needs to be removed and everything becomes referenced.\n\t *\n\t * 2. GC was disabled and is now enabled. The GC state needs to be regenerated and added to summary.\n\t *\n\t * 3. GC is enabled and the latest summary state is refreshed from a snapshot that had GC disabled and vice-versa.\n\t *\n\t * 4. The GC version in the latest summary is different from the current GC version. This can happen if:\n\t *\n\t * 4.1. The summary this client loaded with has data from a different GC version.\n\t *\n\t * 4.2. This client's latest summary was updated from a snapshot that has a different GC version.\n\t */\n\tpublic get doesSummaryStateNeedReset(): boolean {\n\t\treturn (\n\t\t\tthis.doesGCStateNeedReset ||\n\t\t\t(this.configs.shouldRunGC &&\n\t\t\t\tthis.latestSummaryGCVersion !== this.configs.gcVersionInEffect)\n\t\t);\n\t}\n\n\t/**\n\t * Called during GC initialization. Initialize the latest summary data from the base snapshot data.\n\t */\n\tpublic initializeBaseState(baseSnapshotData: IGarbageCollectionSnapshotData | undefined) {\n\t\tif (baseSnapshotData === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If tracking state across summaries, update latest summary data from the snapshot's GC data.\n\t\tthis.latestSummaryData = {\n\t\t\tserializedGCState: baseSnapshotData.gcState\n\t\t\t\t? JSON.stringify(generateSortedGCState(baseSnapshotData.gcState))\n\t\t\t\t: undefined,\n\t\t\tserializedTombstones: JSON.stringify(baseSnapshotData.tombstones),\n\t\t\tserializedDeletedNodes: JSON.stringify(baseSnapshotData.deletedNodes),\n\t\t};\n\t}\n\n\t/**\n\t * Summarizes three component of the GC data - GC state, tombstones and deleted nodes.\n\t * It does incremental summary, i.e., it writes summary tree / summary blob only for the component that changed.\n\t * For components that did not change, a summary handle is returned that points to the previous successful summary.\n\t * If none of the components changed, it returns a summary handle for the entire GC data.\n\t */\n\tpublic summarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\tgcState: IGarbageCollectionState,\n\t\tdeletedNodes: Set<string>,\n\t\ttombstones: string[],\n\t): ISummarizeResult | undefined {\n\t\tif (!this.configs.shouldRunGC) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst serializedGCState = JSON.stringify(generateSortedGCState(gcState));\n\t\t// Serialize and write deleted nodes, if any. This is done irrespective of whether sweep is enabled or not so\n\t\t// to identify deleted nodes' usage.\n\t\tconst serializedDeletedNodes =\n\t\t\tdeletedNodes.size > 0 ? JSON.stringify(Array.from(deletedNodes).sort()) : undefined;\n\t\t// If running in tombstone mode, serialize and write tombstones, if any.\n\t\tconst serializedTombstones = this.configs.tombstoneMode\n\t\t\t? tombstones.length > 0\n\t\t\t\t? JSON.stringify(tombstones.sort())\n\t\t\t\t: undefined\n\t\t\t: undefined;\n\n\t\t/**\n\t\t * Incremental summary of GC data - If none of GC state, deleted nodes or tombstones changed since last summary,\n\t\t * write summary handle instead of summary tree for GC.\n\t\t * Otherwise, write the GC summary tree. In the tree, for each of these that changed, write a summary blob and\n\t\t * for each of these that did not change, write a summary handle.\n\t\t */\n\t\tthis.pendingSummaryData = {\n\t\t\tserializedGCState,\n\t\t\tserializedTombstones,\n\t\t\tserializedDeletedNodes,\n\t\t};\n\n\t\tif (trackState && !fullTree && this.latestSummaryData !== undefined) {\n\t\t\t// If nothing changed since last summary, send a summary handle for the entire GC data.\n\t\t\tif (\n\t\t\t\tthis.latestSummaryData.serializedGCState === serializedGCState &&\n\t\t\t\tthis.latestSummaryData.serializedTombstones === serializedTombstones &&\n\t\t\t\tthis.latestSummaryData.serializedDeletedNodes === serializedDeletedNodes\n\t\t\t) {\n\t\t\t\tconst stats = mergeStats();\n\t\t\t\tstats.handleNodeCount++;\n\t\t\t\treturn {\n\t\t\t\t\tsummary: {\n\t\t\t\t\t\ttype: SummaryType.Handle,\n\t\t\t\t\t\thandle: `/${gcTreeKey}`,\n\t\t\t\t\t\thandleType: SummaryType.Tree,\n\t\t\t\t\t},\n\t\t\t\t\tstats,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// If some state changed, build a GC summary tree.\n\t\t\treturn this.buildGCSummaryTree(\n\t\t\t\tserializedGCState,\n\t\t\t\tserializedTombstones,\n\t\t\t\tserializedDeletedNodes,\n\t\t\t\ttrue /* trackState */,\n\t\t\t);\n\t\t}\n\t\t// If not tracking GC state, build a GC summary tree without any summary handles.\n\t\treturn this.buildGCSummaryTree(\n\t\t\tserializedGCState,\n\t\t\tserializedTombstones,\n\t\t\tserializedDeletedNodes,\n\t\t\tfalse /* trackState */,\n\t\t);\n\t}\n\n\t/**\n\t * Builds the GC summary tree which contains GC state, deleted nodes and tombstones.\n\t * If trackState is false, all of GC state, deleted nodes and tombstones are written as summary blobs.\n\t * If trackState is true, only states that changed are written. Rest are written as handles.\n\t * @param serializedGCState - The GC state serialized as string.\n\t * @param serializedTombstones - The tombstone state serialized as string.\n\t * @param serializedDeletedNodes - Deleted nodes serialized as string.\n\t * @param trackState - Whether we are tracking GC state across summaries.\n\t * @returns the GC summary tree.\n\t */\n\tprivate buildGCSummaryTree(\n\t\tserializedGCState: string,\n\t\tserializedTombstones: string | undefined,\n\t\tserializedDeletedNodes: string | undefined,\n\t\ttrackState: boolean,\n\t): ISummaryTreeWithStats {\n\t\tconst builder = new SummaryTreeBuilder();\n\n\t\t// If the GC state hasn't changed, write a summary handle, else write a summary blob for it.\n\t\tif (this.latestSummaryData?.serializedGCState === serializedGCState && trackState) {\n\t\t\tbuilder.addHandle(gcStateBlobKey, SummaryType.Blob, `/${gcTreeKey}/${gcStateBlobKey}`);\n\t\t} else {\n\t\t\tbuilder.addBlob(gcStateBlobKey, serializedGCState);\n\t\t}\n\n\t\t// If tombstones exist, write a summary handle if it hasn't changed. If it has changed, write a\n\t\t// summary blob.\n\t\tif (serializedTombstones !== undefined) {\n\t\t\tif (\n\t\t\t\tthis.latestSummaryData?.serializedTombstones === serializedTombstones &&\n\t\t\t\ttrackState\n\t\t\t) {\n\t\t\t\tbuilder.addHandle(\n\t\t\t\t\tgcTombstoneBlobKey,\n\t\t\t\t\tSummaryType.Blob,\n\t\t\t\t\t`/${gcTreeKey}/${gcTombstoneBlobKey}`,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tbuilder.addBlob(gcTombstoneBlobKey, serializedTombstones);\n\t\t\t}\n\t\t}\n\n\t\t// If there are no deleted nodes, return the summary tree.\n\t\tif (serializedDeletedNodes === undefined) {\n\t\t\treturn builder.getSummaryTree();\n\t\t}\n\n\t\t// If the deleted nodes hasn't changed, write a summary handle, else write a summary blob for it.\n\t\tif (\n\t\t\tthis.latestSummaryData?.serializedDeletedNodes === serializedDeletedNodes &&\n\t\t\ttrackState\n\t\t) {\n\t\t\tbuilder.addHandle(\n\t\t\t\tgcDeletedBlobKey,\n\t\t\t\tSummaryType.Blob,\n\t\t\t\t`/${gcTreeKey}/${gcDeletedBlobKey}`,\n\t\t\t);\n\t\t} else {\n\t\t\tbuilder.addBlob(gcDeletedBlobKey, serializedDeletedNodes);\n\t\t}\n\t\treturn builder.getSummaryTree();\n\t}\n\n\t/**\n\t * Called to refresh the latest summary state. This happens when either a pending summary is acked.\n\t */\n\tpublic async refreshLatestSummary(result: IRefreshSummaryResult): Promise<void> {\n\t\tif (!result.isSummaryTracked) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the summary is tracked, this client is the one that generated it. So, update wasGCRunInLatestSummary.\n\t\t// Note that this has to be updated if GC did not run too. Otherwise, `gcStateNeedsReset` will always return\n\t\t// true in scenarios where GC is currently disabled but enabled in the snapshot we loaded from.\n\t\tthis.wasGCRunInLatestSummary = this.configs.shouldRunGC;\n\n\t\tif (!this.configs.shouldRunGC) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.latestSummaryGCVersion = this.configs.gcVersionInEffect;\n\t\tthis.latestSummaryData = this.pendingSummaryData;\n\t\tthis.pendingSummaryData = undefined;\n\t\tthis.updatedDSCountSinceLastSummary = 0;\n\t\treturn;\n\t}\n\n\t/**\n\t * Called to update the state from a GC run's stats. Used to update the count of data stores whose state updated.\n\t */\n\tpublic updateStateFromGCRunStats(stats: IGCStats) {\n\t\tthis.updatedDSCountSinceLastSummary += stats.updatedDataStoreCount;\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcTelemetry.d.ts","sourceRoot":"","sources":["../../src/gc/gcTelemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,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jC,eAAe,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC;KAClD,CAAC,CAAC;IAEH,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryGenericEvent } from \"@fluidframework/core-interfaces\";\nimport { IGarbageCollectionData } from \"@fluidframework/runtime-definitions\";\nimport {\n\tgenerateStack,\n\tITelemetryLoggerExt,\n\tMonitoringContext,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils\";\nimport { RuntimeHeaderData } from \"../containerRuntime\";\nimport { ICreateContainerMetadata } from \"../summary\";\nimport {\n\tGCNodeType,\n\tUnreferencedState,\n\tIGarbageCollectorConfigs,\n\tdisableTombstoneKey,\n\tthrowOnTombstoneUsageKey,\n\tthrowOnTombstoneLoadOverrideKey,\n\trunSweepKey,\n\tGCFeatureMatrix,\n} from \"./gcDefinitions\";\nimport { UnreferencedStateTracker } from \"./gcUnreferencedStateTracker\";\n\ntype NodeUsageType = \"Changed\" | \"Loaded\" | \"Revived\";\n\n/** Properties that are common to IUnreferencedEventProps and INodeUsageProps */\ninterface ICommonProps {\n\tusageType: NodeUsageType;\n\tcompletedGCRuns: number;\n\tisTombstoned: boolean;\n\tlastSummaryTime?: number;\n\theaders?: RuntimeHeaderData;\n}\n\n/** The event that is logged when unreferenced node is used after a certain time. */\ninterface IUnreferencedEventProps extends ICreateContainerMetadata, ICommonProps {\n\tstate: UnreferencedState;\n\tid: {\n\t\tvalue: string;\n\t\ttag: string;\n\t};\n\ttype: GCNodeType;\n\tunrefTime: number;\n\tage: number;\n\t// Expanding GC feature matrix. Without doing this, the configs cannot be logged in telemetry directly.\n\tgcConfigs: Omit<IGarbageCollectorConfigs, \"persistedGcFeatureMatrix\"> & {\n\t\t[K in keyof GCFeatureMatrix]: GCFeatureMatrix[K];\n\t};\n\ttimeout?: number;\n\tfromId?: {\n\t\tvalue: string;\n\t\ttag: string;\n\t};\n}\n\n/** Properties passed to nodeUsed function when a node is used. */\ninterface INodeUsageProps extends ICommonProps {\n\tid: string;\n\tcurrentReferenceTimestampMs: number | undefined;\n\tpackagePath: readonly string[] | undefined;\n\tfromId?: string;\n}\n\n/**\n * Encapsulates the logic that tracks the various telemetry logged by the Garbage Collector. There are 4 types of\n * telemetry logged:\n * 1. inactiveObject telemetry - When an inactive node is used - A node that has been unreferenced for inactiveTimeoutMs.\n * 2. sweepReadyObject telemetry - When a sweep ready node is used - A node that has been unreferenced for sweepTimeoutMs.\n * 3. Tombstone telemetry - When a tombstoned node is used - A node that that has been marked as tombstone.\n * 4. Sweep / deleted telemetry - When a node is detected as sweep ready in the sweep phase.\n * 5. Unknown outbound reference telemetry - When a node is referenced but GC is not explicitly notified of it.\n */\nexport class GCTelemetryTracker {\n\t// Keeps track of unreferenced events that are logged for a node. This is used to limit the log generation to one\n\t// per event per node.\n\tprivate readonly loggedUnreferencedEvents: Set<string> = new Set();\n\t// Queue for unreferenced events that should be logged the next time GC runs.\n\tprivate pendingEventsQueue: IUnreferencedEventProps[] = [];\n\n\tconstructor(\n\t\tprivate readonly mc: MonitoringContext,\n\t\tprivate readonly configs: IGarbageCollectorConfigs,\n\t\tprivate readonly isSummarizerClient: boolean,\n\t\tprivate readonly createContainerMetadata: ICreateContainerMetadata,\n\t\tprivate readonly getNodeType: (nodeId: string) => GCNodeType,\n\t\tprivate readonly getNodeStateTracker: (\n\t\t\tnodeId: string,\n\t\t) => UnreferencedStateTracker | undefined,\n\t\tprivate readonly getNodePackagePath: (\n\t\t\tnodePath: string,\n\t\t) => Promise<readonly string[] | undefined>,\n\t) {}\n\n\t/**\n\t * Returns whether an event should be logged for a node that isn't active anymore. This does not apply to\n\t * tombstoned nodes for which an event is always logged. Some scenarios where we won't log:\n\t * 1. When a DDS is changed. The corresponding data store's event will be logged instead.\n\t * 2. An event is logged only once per container instance per event per node.\n\t */\n\tprivate shouldLogNonActiveEvent(\n\t\tnodeType: GCNodeType,\n\t\tusageType: NodeUsageType,\n\t\tnodeStateTracker: UnreferencedStateTracker,\n\t\tuniqueEventId: string,\n\t) {\n\t\tif (nodeStateTracker.state === UnreferencedState.Active) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (nodeType === GCNodeType.Other) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// For sub data store (DDS) nodes, if they are changed, its data store will also be changed,\n\t\t// so skip logging to make the telemetry less noisy.\n\t\tif (nodeType === GCNodeType.SubDataStore && usageType === \"Changed\") {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Non-tombstone events are logged once per event per node. A unique id is generated by joining\n\t\t// node state (inactive / sweep ready), node's id and usage (loaded / changed / revived).\n\t\tif (this.loggedUnreferencedEvents.has(uniqueEventId)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Called when a node is used. If the node is not active or tombstoned, log telemetry indicating object is used\n\t * when it should not have been.\n\t */\n\tpublic nodeUsed(nodeUsageProps: INodeUsageProps) {\n\t\t// If there is no reference timestamp to work with, no ops have been processed after creation. If so, skip\n\t\t// logging as nothing interesting would have happened worth logging.\n\t\tif (nodeUsageProps.currentReferenceTimestampMs === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst nodeStateTracker = this.getNodeStateTracker(nodeUsageProps.id);\n\t\tconst nodeType = this.getNodeType(nodeUsageProps.id);\n\t\tconst timeout = (() => {\n\t\t\tswitch (nodeStateTracker?.state) {\n\t\t\t\tcase UnreferencedState.Inactive:\n\t\t\t\t\treturn this.configs.inactiveTimeoutMs;\n\t\t\t\tcase UnreferencedState.TombstoneReady:\n\t\t\t\t\treturn this.configs.sweepTimeoutMs;\n\t\t\t\tcase UnreferencedState.SweepReady:\n\t\t\t\t\treturn (\n\t\t\t\t\t\tthis.configs.sweepTimeoutMs &&\n\t\t\t\t\t\tthis.configs.sweepTimeoutMs + this.configs.sweepGracePeriodMs\n\t\t\t\t\t);\n\t\t\t\tdefault:\n\t\t\t\t\treturn undefined;\n\t\t\t}\n\t\t})();\n\t\tconst {\n\t\t\tusageType,\n\t\t\tcurrentReferenceTimestampMs,\n\t\t\tpackagePath,\n\t\t\tid: untaggedId,\n\t\t\tfromId: untaggedFromId,\n\t\t\t...propsToLog\n\t\t} = nodeUsageProps;\n\t\tconst { persistedGcFeatureMatrix, ...configs } = this.configs;\n\t\tconst unrefEventProps: Omit<IUnreferencedEventProps, \"state\" | \"usageType\"> = {\n\t\t\ttype: nodeType,\n\t\t\tunrefTime: nodeStateTracker?.unreferencedTimestampMs ?? -1,\n\t\t\tage:\n\t\t\t\tnodeStateTracker !== undefined\n\t\t\t\t\t? nodeUsageProps.currentReferenceTimestampMs -\n\t\t\t\t\t nodeStateTracker.unreferencedTimestampMs\n\t\t\t\t\t: -1,\n\t\t\ttimeout,\n\t\t\t...tagCodeArtifacts({ id: untaggedId, fromId: untaggedFromId }),\n\t\t\t...propsToLog,\n\t\t\t...this.createContainerMetadata,\n\t\t\tgcConfigs: { ...configs, ...persistedGcFeatureMatrix },\n\t\t};\n\n\t\t// If the node that is used is tombstoned, log a tombstone telemetry.\n\t\t// Note that this is done before checking if \"nodeStateTracker\" is undefined below because unreferenced\n\t\t// tracking may not have yet been enabled. That happens only after the client transitions to write mode.\n\t\tif (nodeUsageProps.isTombstoned) {\n\t\t\tthis.logTombstoneUsageTelemetry(nodeUsageProps, unrefEventProps, nodeType, usageType);\n\t\t}\n\n\t\t// After logging tombstone telemetry, if the node's unreferenced state is not tracked, there is nothing\n\t\t// else to log.\n\t\tif (nodeStateTracker === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst state = nodeStateTracker.state;\n\t\tconst uniqueEventId = `${state}-${nodeUsageProps.id}-${nodeUsageProps.usageType}`;\n\n\t\tif (\n\t\t\t!this.shouldLogNonActiveEvent(\n\t\t\t\tnodeType,\n\t\t\t\tnodeUsageProps.usageType,\n\t\t\t\tnodeStateTracker,\n\t\t\t\tuniqueEventId,\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add the unique event id so that we don't generate a log for this event again in this session.\n\t\tthis.loggedUnreferencedEvents.add(uniqueEventId);\n\n\t\t// For summarizer client, queue the event so it is logged the next time GC runs if the event is still valid.\n\t\t// For non-summarizer client, log the event now since GC won't run on it. This may result in false positives\n\t\t// but it's a good signal nonetheless and we can consume it with a grain of salt.\n\t\t// Inactive errors are usages of Objects that are unreferenced for at least a period of 7 days.\n\t\t// SweepReady errors are usages of Objects that will be deleted by GC Sweep!\n\t\tif (this.isSummarizerClient) {\n\t\t\tthis.pendingEventsQueue.push({\n\t\t\t\t...unrefEventProps,\n\t\t\t\tusageType: nodeUsageProps.usageType,\n\t\t\t\tstate,\n\t\t\t});\n\t\t} else {\n\t\t\t// For non-summarizer clients, only log \"Loaded\" type events since these objects may not be loaded in the\n\t\t\t// summarizer clients if they are based off of user actions (such as scrolling to content for these objects)\n\t\t\t// Events generated:\n\t\t\t// InactiveObject_Loaded, SweepReadyObject_Loaded\n\t\t\tif (nodeUsageProps.usageType === \"Loaded\") {\n\t\t\t\tconst { id, fromId, headers, gcConfigs, ...detailedProps } = unrefEventProps;\n\t\t\t\tconst event = {\n\t\t\t\t\teventName: `${state}Object_${nodeUsageProps.usageType}`,\n\t\t\t\t\t...tagCodeArtifacts({ pkg: nodeUsageProps.packagePath?.join(\"/\") }),\n\t\t\t\t\tstack: generateStack(),\n\t\t\t\t\tid,\n\t\t\t\t\tfromId,\n\t\t\t\t\theaders: { ...headers },\n\t\t\t\t\tdetails: detailedProps,\n\t\t\t\t\tgcConfigs,\n\t\t\t\t};\n\n\t\t\t\t// These are logged as generic events and not errors because there can be false positives. The Tombstone\n\t\t\t\t// and Delete errors are separately logged and are reliable.\n\t\t\t\tthis.mc.logger.sendTelemetryEvent(event);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Logs telemetry when a tombstoned object is changed, revived or loaded.\n\t */\n\tprivate logTombstoneUsageTelemetry(\n\t\tnodeUsageProps: INodeUsageProps,\n\t\tunrefEventProps: Omit<IUnreferencedEventProps, \"state\" | \"usageType\">,\n\t\tnodeType: GCNodeType,\n\t\tusageType: NodeUsageType,\n\t) {\n\t\t// This will log the following events:\n\t\t// GC_Tombstone_DataStore_Requested, GC_Tombstone_DataStore_Changed, GC_Tombstone_DataStore_Revived\n\t\t// GC_Tombstone_SubDataStore_Requested, GC_Tombstone_SubDataStore_Changed, GC_Tombstone_SubDataStore_Revived\n\t\t// GC_Tombstone_Blob_Requested, GC_Tombstone_Blob_Changed, GC_Tombstone_Blob_Revived\n\t\tconst { id, fromId, headers, gcConfigs, ...detailedProps } = unrefEventProps;\n\t\tconst eventUsageName = usageType === \"Loaded\" ? \"Requested\" : usageType;\n\t\tconst event = {\n\t\t\teventName: `GC_Tombstone_${nodeType}_${eventUsageName}`,\n\t\t\tpkg: tagCodeArtifacts({ pkg: nodeUsageProps.packagePath?.join(\"/\") }).pkg,\n\t\t\tstack: generateStack(),\n\t\t\tid,\n\t\t\tfromId,\n\t\t\theaders: { ...headers },\n\t\t\tdetails: detailedProps,\n\t\t\tgcConfigs,\n\t\t\ttombstoneFlags: {\n\t\t\t\tDisableTombstone: this.mc.config.getBoolean(disableTombstoneKey),\n\t\t\t\tThrowOnTombstoneUsage: this.mc.config.getBoolean(throwOnTombstoneUsageKey),\n\t\t\t\tThrowOnTombstoneLoad: this.mc.config.getBoolean(throwOnTombstoneLoadOverrideKey),\n\t\t\t},\n\t\t\tsweepFlags: {\n\t\t\t\tEnableSweepFlag: this.mc.config.getBoolean(runSweepKey),\n\t\t\t},\n\t\t};\n\n\t\tif (\n\t\t\t(usageType === \"Loaded\" &&\n\t\t\t\tthis.configs.throwOnTombstoneLoad &&\n\t\t\t\t!headers?.allowTombstone) ||\n\t\t\t(usageType === \"Changed\" && this.configs.throwOnTombstoneUsage)\n\t\t) {\n\t\t\tthis.mc.logger.sendErrorEvent(event);\n\t\t} else {\n\t\t\tthis.mc.logger.sendTelemetryEvent(event);\n\t\t}\n\t}\n\n\t/**\n\t * Log all new references or outbound routes in the current graph that haven't been explicitly notified to GC.\n\t * The principle is that every new reference or outbound route must be notified to GC via the\n\t * addedOutboundReference method. It it hasn't, its a bug and we want to identify these scenarios.\n\t *\n\t * In more simple terms:\n\t * Missing Explicit References = Current References - Previous References - Explicitly Added References;\n\t *\n\t * @param currentGCData - The GC data (reference graph) from the current GC run.\n\t * @param previousGCData - The GC data (reference graph) from the previous GC run.\n\t * @param explicitReferences - New references added explicity between the previous and the current run.\n\t */\n\tpublic logIfMissingExplicitReferences(\n\t\tcurrentGCData: IGarbageCollectionData,\n\t\tpreviousGCData: IGarbageCollectionData,\n\t\texplicitReferences: Map<string, string[]>,\n\t\tlogger: ITelemetryLoggerExt,\n\t) {\n\t\tfor (const [nodeId, currentOutboundRoutes] of Object.entries(currentGCData.gcNodes)) {\n\t\t\tconst previousRoutes = previousGCData.gcNodes[nodeId] ?? [];\n\t\t\tconst explicitRoutes = explicitReferences.get(nodeId) ?? [];\n\n\t\t\t/**\n\t\t\t * 1. For routes in the current GC data, routes that were not present in previous GC data and did not have\n\t\t\t * explicit references should be added to missing explicit routes list.\n\t\t\t * 2. Only include data store and blob routes since GC only works for these two.\n\t\t\t * Note: Due to a bug with de-duped blobs, only adding data store routes for now.\n\t\t\t * 3. Ignore DDS routes to their parent datastores since those were added implicitly. So, there won't be\n\t\t\t * explicit routes to them.\n\t\t\t */\n\t\t\tconst missingExplicitRoutes: string[] = [];\n\t\t\tfor (const route of currentOutboundRoutes) {\n\t\t\t\tconst nodeType = this.getNodeType(route);\n\t\t\t\tif (\n\t\t\t\t\t(nodeType === GCNodeType.DataStore || nodeType === GCNodeType.Blob) &&\n\t\t\t\t\t!nodeId.startsWith(route) &&\n\t\t\t\t\t!previousRoutes.includes(route) &&\n\t\t\t\t\t!explicitRoutes.includes(route)\n\t\t\t\t) {\n\t\t\t\t\tmissingExplicitRoutes.push(route);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (missingExplicitRoutes.length > 0) {\n\t\t\t\tlogger.sendErrorEvent({\n\t\t\t\t\teventName: \"gcUnknownOutboundReferences\",\n\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\tid: nodeId,\n\t\t\t\t\t\troutes: JSON.stringify(missingExplicitRoutes),\n\t\t\t\t\t}),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Log events that are pending in pendingEventsQueue. This is called after GC runs in the summarizer client\n\t * so that the state of an unreferenced node is updated.\n\t */\n\tpublic async logPendingEvents(logger: ITelemetryLoggerExt) {\n\t\t// Events sent come only from the summarizer client. In between summaries, events are pushed to a queue and at\n\t\t// summary time they are then logged.\n\t\t// Events generated:\n\t\t// InactiveObject_Loaded, InactiveObject_Changed, InactiveObject_Revived\n\t\t// SweepReadyObject_Loaded, SweepReadyObject_Changed, SweepReadyObject_Revived\n\t\tfor (const eventProps of this.pendingEventsQueue) {\n\t\t\t// const { usageType, state, id, fromId, ...propsToLog } = eventProps;\n\t\t\tconst { usageType, state, id, fromId, headers, gcConfigs, ...detailedProps } =\n\t\t\t\teventProps;\n\t\t\t/**\n\t\t\t * Revived event is logged only if the node is active. If the node is not active, the reference to it was\n\t\t\t * from another unreferenced node and this scenario is not interesting to log.\n\t\t\t * Loaded and Changed events are logged only if the node is not active. If the node is active, it was\n\t\t\t * revived and a Revived event will be logged for it.\n\t\t\t */\n\t\t\tconst nodeStateTracker = this.getNodeStateTracker(eventProps.id.value);\n\t\t\tconst active =\n\t\t\t\tnodeStateTracker === undefined ||\n\t\t\t\tnodeStateTracker.state === UnreferencedState.Active;\n\t\t\tif ((usageType === \"Revived\") === active) {\n\t\t\t\tconst pkg = await this.getNodePackagePath(eventProps.id.value);\n\t\t\t\tconst fromPkg = eventProps.fromId\n\t\t\t\t\t? await this.getNodePackagePath(eventProps.fromId.value)\n\t\t\t\t\t: undefined;\n\t\t\t\tconst event = {\n\t\t\t\t\teventName: `${state}Object_${usageType}`,\n\t\t\t\t\tid,\n\t\t\t\t\tfromId,\n\t\t\t\t\theaders: { ...headers },\n\t\t\t\t\tdetails: detailedProps,\n\t\t\t\t\tgcConfigs,\n\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\tpkg: pkg?.join(\"/\"),\n\t\t\t\t\t\tfromPkg: fromPkg?.join(\"/\"),\n\t\t\t\t\t}),\n\t\t\t\t};\n\t\t\t\tlogger.sendTelemetryEvent(event);\n\t\t\t}\n\t\t}\n\t\tthis.pendingEventsQueue = [];\n\t}\n}\n\n/**\n * Consolidates info / logic for logging when we encounter unexpected usage of GC'd objects. For example, when a\n * tombstoned or deleted object is loaded.\n */\nexport function sendGCUnexpectedUsageEvent(\n\tmc: MonitoringContext,\n\tevent: ITelemetryGenericEvent & {\n\t\tcategory: \"error\" | \"generic\";\n\t\tgcTombstoneEnforcementAllowed: boolean | undefined;\n\t},\n\tpackagePath: readonly string[] | undefined,\n\terror?: unknown,\n) {\n\tevent.pkg = tagCodeArtifacts({ pkg: packagePath?.join(\"/\") })?.pkg;\n\tevent.tombstoneFlags = JSON.stringify({\n\t\tDisableTombstone: mc.config.getBoolean(disableTombstoneKey),\n\t\tThrowOnTombstoneUsage: mc.config.getBoolean(throwOnTombstoneUsageKey),\n\t\tThrowOnTombstoneLoad: mc.config.getBoolean(throwOnTombstoneLoadOverrideKey),\n\t});\n\tevent.sweepFlags = JSON.stringify({\n\t\tEnableSweepFlag: mc.config.getBoolean(runSweepKey),\n\t});\n\n\tmc.logger.sendTelemetryEvent(event, error);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcUnreferencedStateTracker.d.ts","sourceRoot":"","sources":["../../src/gc/gcUnreferencedStateTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAoBpD;;;GAGG;AACH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BAAkB,KAAK,SAAS;YACrC,sBAAsB,IAAI,IAAI,CAAC,kBAAkB,EAChD;YACD,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,cAAc,CAAC;YAE/C,IAAI,CAAC,UAAU,CAAC,OAAO,CACtB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,GAAG,sBAAsB,CAC1E,CAAC;YACF,OAAO;SACP;QAED,mFAAmF;QACnF,kEAAkE;QAClE,IAAI,sBAAsB,IAAI,IAAI,CAAC,iBAAiB,EAAE;YACrD,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,QAAQ,CAAC;YAEzC,IAAI,IAAI,CAAC,kBAAkB,KAAK,SAAS,EAAE;gBAC1C,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,GAAG,sBAAsB,CAAC,CAAC;aAC9E;YACD,OAAO;SACP;QAED,qGAAqG;QACrG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,GAAG,sBAAsB,CAAC,CAAC;IAC7E,CAAC;IAEO,WAAW;QAClB,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC5B,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IAED,gFAAgF;IACzE,YAAY;QAClB,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC;IACxC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, Timer } from \"@fluidframework/core-utils\";\nimport { validatePrecondition } from \"@fluidframework/telemetry-utils\";\nimport { UnreferencedState } from \"./gcDefinitions\";\n\n/** A wrapper around common-utils Timer that requires the timeout when calling start/restart */\nclass TimerWithNoDefaultTimeout extends Timer {\n\tconstructor(private readonly callback: () => void) {\n\t\t// The default timeout/handlers will never be used since start/restart pass overrides below\n\t\tsuper(0, () => {\n\t\t\tthrow new Error(\"DefaultHandler should not be used\");\n\t\t});\n\t}\n\n\tstart(timeoutMs: number) {\n\t\tsuper.start(timeoutMs, this.callback);\n\t}\n\n\trestart(timeoutMs: number): void {\n\t\tsuper.restart(timeoutMs, this.callback);\n\t}\n}\n\n/**\n * Helper class that tracks the state of an unreferenced node such as the time it was unreferenced and if it can\n * be tombstoned or deleted by the sweep phase.\n */\nexport class UnreferencedStateTracker {\n\tprivate _state: UnreferencedState = UnreferencedState.Active;\n\tpublic get state(): UnreferencedState {\n\t\treturn this._state;\n\t}\n\n\t/** Timer to indicate when an unreferenced object is considered Inactive */\n\tprivate readonly inactiveTimer: TimerWithNoDefaultTimeout;\n\t/** Timer to indicate when an unreferenced object is Tombstone-Ready */\n\tprivate readonly tombstoneTimer: TimerWithNoDefaultTimeout;\n\t/** Timer to indicate when an unreferenced object is Sweep-Ready */\n\tprivate readonly sweepTimer: TimerWithNoDefaultTimeout;\n\n\tconstructor(\n\t\tpublic readonly unreferencedTimestampMs: number,\n\t\t/** The time after which node transitions to Inactive state. */\n\t\tprivate readonly inactiveTimeoutMs: number,\n\t\t/** The current reference timestamp used to track how long this node has been unreferenced for. */\n\t\tcurrentReferenceTimestampMs: number,\n\t\t/** The time after which node transitions to TombstoneReady state; undefined if session expiry is disabled. */\n\t\tprivate readonly tombstoneTimeoutMs: number | undefined,\n\t\t/** The delay from TombstoneReady to SweepReady (only applies if tombstoneTimeoutMs is defined) */\n\t\tprivate readonly sweepGracePeriodMs: number,\n\t) {\n\t\tvalidatePrecondition(\n\t\t\tthis.tombstoneTimeoutMs === undefined ||\n\t\t\t\tthis.tombstoneTimeoutMs >= this.inactiveTimeoutMs,\n\t\t\t\"inactiveTimeoutMs must not be greater than the tombstoneTimeoutMs\",\n\t\t);\n\n\t\tthis.sweepTimer = new TimerWithNoDefaultTimeout(() => {\n\t\t\tthis._state = UnreferencedState.SweepReady;\n\t\t\tassert(\n\t\t\t\t!this.inactiveTimer.hasTimer && !this.tombstoneTimer.hasTimer,\n\t\t\t\t0x863 /* inactiveTimer or tombstoneTimer still running after sweepTimer fired! */,\n\t\t\t);\n\t\t});\n\n\t\tthis.tombstoneTimer = new TimerWithNoDefaultTimeout(() => {\n\t\t\tthis._state = UnreferencedState.TombstoneReady;\n\t\t\tassert(\n\t\t\t\t!this.inactiveTimer.hasTimer,\n\t\t\t\t0x864 /* inactiveTimer still running after tombstoneTimer fired! */,\n\t\t\t); // aka 0x3b1\n\n\t\t\tif (this.sweepGracePeriodMs > 0) {\n\t\t\t\t// After the node becomes tombstone ready, start the sweep timer after which the node will be ready for sweep.\n\t\t\t\tthis.sweepTimer.restart(this.sweepGracePeriodMs);\n\t\t\t} else {\n\t\t\t\tthis._state = UnreferencedState.SweepReady;\n\t\t\t}\n\t\t});\n\n\t\tthis.inactiveTimer = new TimerWithNoDefaultTimeout(() => {\n\t\t\tthis._state = UnreferencedState.Inactive;\n\n\t\t\t// After the node becomes inactive, start the tombstone timer after which the node will be ready for tombstone.\n\t\t\tif (this.tombstoneTimeoutMs !== undefined) {\n\t\t\t\tthis.tombstoneTimer.restart(this.tombstoneTimeoutMs - this.inactiveTimeoutMs);\n\t\t\t}\n\t\t});\n\n\t\tthis.updateTracking(currentReferenceTimestampMs);\n\t}\n\n\t/* Updates the unreferenced state based on the provided timestamp. */\n\tpublic updateTracking(currentReferenceTimestampMs: number) {\n\t\tconst unreferencedDurationMs = currentReferenceTimestampMs - this.unreferencedTimestampMs;\n\n\t\t// Below we will set the appropriate timer (or none). Any running timers are superceded by the new currentReferenceTimestampMs\n\t\tthis.clearTimers();\n\n\t\t// If the node has been unreferenced long enough, update the state to SweepReady.\n\t\tif (\n\t\t\tthis.tombstoneTimeoutMs !== undefined &&\n\t\t\tunreferencedDurationMs >= this.tombstoneTimeoutMs + this.sweepGracePeriodMs\n\t\t) {\n\t\t\tthis._state = UnreferencedState.SweepReady;\n\t\t\treturn;\n\t\t}\n\n\t\t// If the node has been unreferenced long enough, update the state to TombstoneReady.\n\t\t// Also, start a timer for the remainder of the sweep delay.\n\t\tif (\n\t\t\tthis.tombstoneTimeoutMs !== undefined &&\n\t\t\tunreferencedDurationMs >= this.tombstoneTimeoutMs\n\t\t) {\n\t\t\tthis._state = UnreferencedState.TombstoneReady;\n\n\t\t\tthis.sweepTimer.restart(\n\t\t\t\tthis.tombstoneTimeoutMs + this.sweepGracePeriodMs - unreferencedDurationMs,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// If the node has been unreferenced for long enough, update the state to inactive.\n\t\t// Also, start a timer for the remainder of the tombstone timeout.\n\t\tif (unreferencedDurationMs >= this.inactiveTimeoutMs) {\n\t\t\tthis._state = UnreferencedState.Inactive;\n\n\t\t\tif (this.tombstoneTimeoutMs !== undefined) {\n\t\t\t\tthis.tombstoneTimer.restart(this.tombstoneTimeoutMs - unreferencedDurationMs);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// The node is still active. Ensure the inactive timer is running with the proper remaining duration.\n\t\tthis.inactiveTimer.restart(this.inactiveTimeoutMs - unreferencedDurationMs);\n\t}\n\n\tprivate clearTimers() {\n\t\tthis.inactiveTimer.clear();\n\t\tthis.tombstoneTimer.clear();\n\t\tthis.sweepTimer.clear();\n\t}\n\n\t/** Stop tracking this node. Reset the unreferenced timers and state, if any. */\n\tpublic stopTracking() {\n\t\tthis.clearTimers();\n\t\tthis._state = UnreferencedState.Active;\n\t}\n}\n"]}
|
package/lib/gc/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gc/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACN,aAAa,EACb,wBAAwB,EACxB,yBAAyB,EACzB,8BAA8B,EAC9B,UAAU,EACV,aAAa,EACb,uCAAuC,EACvC,sBAAsB,EACtB,eAAe,EACf,SAAS,EACT,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,wBAAwB,EACxB,6BAA6B,EAC7B,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,6BAA6B,EAC7B,wBAAwB,EACxB,iBAAiB,EACjB,+BAA+B,EAC/B,wBAAwB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,WAAW,EACX,6BAA6B,EAC7B,6BAA6B,EAC7B,yBAAyB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EACN,0BAA0B,EAC1B,8BAA8B,EAC9B,uBAAuB,EACvB,sCAAsC,GACtC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,cAAc,EACd,qBAAqB,EACrB,sBAAsB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/lib/gc/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gc/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACN,aAAa,EACb,wBAAwB,EACxB,yBAAyB,EACzB,8BAA8B,EAC9B,UAAU,EACV,aAAa,EACb,uCAAuC,EACvC,sBAAsB,EAGtB,uBAAuB,EAWvB,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,6BAA6B,EAC7B,wBAAwB,EACxB,iBAAiB,EACjB,+BAA+B,GAE/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,WAAW,EACX,6BAA6B,EAC7B,6BAA6B,EAC7B,yBAAyB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAOnE,OAAO,EACN,cAAc,EACd,qBAAqB,GAErB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { GarbageCollector } from \"./garbageCollection\";\nexport {\n\tnextGCVersion,\n\tdefaultInactiveTimeoutMs,\n\tdefaultSweepGracePeriodMs,\n\tdefaultSessionExpiryDurationMs,\n\tGCNodeType,\n\tgcTestModeKey,\n\tgcDisableThrowOnTombstoneLoadOptionName,\n\tgcGenerationOptionName,\n\tGCFeatureMatrix,\n\tGCVersion,\n\tgcVersionUpgradeToV4Key,\n\tIGarbageCollectionRuntime,\n\tIGarbageCollector,\n\tIGarbageCollectorConfigs,\n\tIGarbageCollectorCreateParams,\n\tIGCMetadata,\n\tIGCResult,\n\tIGCRuntimeOptions,\n\tIMarkPhaseStats,\n\tISweepPhaseStats,\n\tIGCStats,\n\toneDayMs,\n\trunGCKey,\n\trunSessionExpiryKey,\n\trunSweepKey,\n\tstableGCVersion,\n\tdisableAttachmentBlobSweepKey,\n\tdisableDatastoreSweepKey,\n\tUnreferencedState,\n\tthrowOnTombstoneLoadOverrideKey,\n\tGarbageCollectionMessage,\n} from \"./gcDefinitions\";\nexport {\n\tcloneGCData,\n\tconcatGarbageCollectionStates,\n\ttrimLeadingAndTrailingSlashes,\n\tunpackChildNodesGCDetails,\n} from \"./gcHelpers\";\nexport { runGarbageCollection } from \"./gcReferenceGraphAlgorithm\";\nexport {\n\tIGarbageCollectionNodeData,\n\tIGarbageCollectionSnapshotData,\n\tIGarbageCollectionState,\n\tIGarbageCollectionSummaryDetailsLegacy,\n} from \"./gcSummaryDefinitions\";\nexport {\n\tgcStateBlobKey,\n\tGCSummaryStateTracker,\n\tIGCSummaryTrackingData,\n} from \"./gcSummaryStateTracker\";\nexport { GCTelemetryTracker, sendGCUnexpectedUsageEvent } from \"./gcTelemetry\";\nexport { UnreferencedStateTracker } from \"./gcUnreferencedStateTracker\";\n"]}
|
package/lib/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,sBAAsB,EACtB,yBAAyB,EACzB,+BAA+B,EAC/B,sCAAsC,EACtC,sCAAsC,EACtC,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,8BAA8B,EAC9B,6BAA6B,EAC7B,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,qCAAqC,EACrC,kBAAkB,EAClB,2CAA2C,GAC3C,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACN,UAAU,EACV,WAAW,EACX,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,QAAQ,GACR,MAAM,MAAM,CAAC;AACd,OAAO,EACN,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,yBAAyB,EACzB,0BAA0B,EAC1B,UAAU,EACV,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,EAC5B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,QAAQ,EACR,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,gCAAgC,EAChC,wBAAwB,EACxB,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAIjE,OAAO;AACN;;GAEG;AACH,gBAAgB;AAChB;;GAEG;AACH,gBAAgB;AAChB;;GAEG;AACH,UAAU,GACV,MAAM,+BAA+B,CAAC"}
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAON,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,8BAA8B,EAC9B,6BAA6B,EAC7B,0BAA0B,EAC1B,yBAAyB,EAEzB,2BAA2B,EAE3B,qBAAqB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,oBAAoB,GAKpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACN,UAAU,GAQV,MAAM,MAAM,CAAC;AACd,OAAO,EAKN,0BAA0B,EAC1B,UAAU,EAEV,iBAAiB,GAwCjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAc,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEjE,0CAA0C;AAC1C,iCAAiC;AACjC,OAAO;AACN;;GAEG;AACH,gBAAgB;AAChB;;GAEG;AACH,gBAAgB;AAChB;;GAEG;AACH,UAAU,GACV,MAAM,+BAA+B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tISummaryRuntimeOptions,\n\tISummaryBaseConfiguration,\n\tISummaryConfigurationHeuristics,\n\tISummaryConfigurationDisableSummarizer,\n\tISummaryConfigurationDisableHeuristics,\n\tIContainerRuntimeOptions,\n\tisRuntimeMessage,\n\tRuntimeMessage,\n\tagentSchedulerId,\n\tContainerRuntime,\n\tRuntimeHeaders,\n\tAllowTombstoneRequestHeaderKey,\n\tAllowInactiveRequestHeaderKey,\n\tTombstoneResponseHeaderKey,\n\tInactiveResponseHeaderKey,\n\tISummaryConfiguration,\n\tDefaultSummaryConfiguration,\n\tICompressionRuntimeOptions,\n\tCompressionAlgorithms,\n} from \"./containerRuntime\";\nexport {\n\tContainerMessageType,\n\tContainerRuntimeMessage,\n\tIContainerRuntimeMessageCompatDetails,\n\tCompatModeBehavior,\n\tRecentlyAddedContainerRuntimeMessageDetails,\n} from \"./messageTypes\";\nexport { IBlobManagerLoadInfo } from \"./blobManager\";\nexport { FluidDataStoreRegistry } from \"./dataStoreRegistry\";\nexport {\n\tGCNodeType,\n\tIGCMetadata,\n\tGCFeatureMatrix,\n\tGCVersion,\n\tIGCRuntimeOptions,\n\tIMarkPhaseStats,\n\tISweepPhaseStats,\n\tIGCStats,\n} from \"./gc\";\nexport {\n\tIAckedSummary,\n\tISummarizer,\n\tISummarizeResults,\n\tISummaryCancellationToken,\n\tneverCancelledSummaryToken,\n\tSummarizer,\n\tSummarizerStopReason,\n\tSummaryCollection,\n\tEnqueueSummarizeResult,\n\tIAckSummaryResult,\n\tIBaseSummarizeResult,\n\tIBroadcastSummaryResult,\n\tICancellationToken,\n\tIConnectableRuntime,\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tIEnqueueSummarizeOptions,\n\tIGenerateSummaryTreeResult,\n\tIGeneratedSummaryStats,\n\tINackSummaryResult,\n\tIOnDemandSummarizeOptions,\n\tIRefreshSummaryAckOptions,\n\tISubmitSummaryOpResult,\n\tISubmitSummaryOptions,\n\tISerializedElection,\n\tISummarizeOptions,\n\tISummarizerEvents,\n\tISummarizerInternalsProvider,\n\tISummarizerRuntime,\n\tISummarizingWarning,\n\tIUploadSummaryResult,\n\tSubmitSummaryResult,\n\tSummarizeResultPart,\n\tIClientSummaryWatcher,\n\tISummary,\n\tISummaryCollectionOpEvents,\n\tISummaryAckMessage,\n\tISummaryMetadataMessage,\n\tISummaryNackMessage,\n\tISummaryOpMessage,\n\tOpActionEventListener,\n\tOpActionEventName,\n\tICancellableSummarizerController,\n\tSubmitSummaryFailureData,\n\tSummaryStage,\n\tIRetriableFailureResult,\n\tISummarizeEventProps,\n} from \"./summary\";\nexport { IChunkedOp, unpackRuntimeMessage } from \"./opLifecycle\";\n\n// Re-exports for backwards compatibility.\n// Will be removed in the future.\nexport {\n\t/**\n\t * @deprecated Import from `@fluidframework/id-compressor` instead.\n\t */\n\tassertIsStableId,\n\t/**\n\t * @deprecated Import from `@fluidframework/id-compressor` instead.\n\t */\n\tgenerateStableId,\n\t/**\n\t * @deprecated Import from `@fluidframework/id-compressor` instead.\n\t */\n\tisStableId,\n} from \"@fluidframework/id-compressor\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messageTypes.d.ts","sourceRoot":"","sources":["../src/messageTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACN,SAAS,EACT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BAA4B,GAC5B,mCAAmC,GACnC,yBAAyB,CAAC;AAE7B;;;GAGG;AACH,MAAM,MAAM,uCAAuC,GAAG,IAAI,CACzD,yBAAyB,EACzB,MAAM,GAAG,UAAU,CACnB,GACA,8BAA8B,CAAC;AAEhC;;;;GAIG;AACH,KAAK,0CAA0C,GAAG,IAAI,CACrD,yBAAyB,EACzB,MAAM,GAAG,UAAU,CACnB,GAAG;IAAE,IAAI,EAAE,0CAA0C,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC;AAE5E,MAAM,MAAM,sDAAsD,GAC/D,uCAAuC,GACvC,0CAA0C,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,oDAAoD,GAAG,yBAAyB,GAC3F,OAAO,CAAC,2CAA2C,CAAC,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,uBAAuB;IACvC,2DAA2D;IAC3D,IAAI,EAAE,oBAAoB,CAAC;IAC3B,kEAAkE;IAClE,QAAQ,EAAE,GAAG,CAAC;IACd,wGAAwG;IACxG,aAAa,CAAC,EAAE,qCAAqC,CAAC;CACtD"}
|
package/lib/messageTypes.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messageTypes.js","sourceRoot":"","sources":["../src/messageTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;GAEG;AACH,MAAM,CAAN,IAAY,oBA+BX;AA/BD,WAAY,oBAAoB;IAC/B,iCAAiC;IACjC,sDAA8B,CAAA;IAE9B,sBAAsB;IACtB,yCAAiB,CAAA;IAEjB,qBAAqB;IACrB,+CAAuB,CAAA;IAEvB,yFAAyF;IACzF,iDAAyB,CAAA;IAEzB,oDAAoD;IACpD,yCAAiB,CAAA;IAEjB,sCAAsC;IACtC,uCAAe,CAAA;IAEf;;;;OAIG;IACH,qDAA6B,CAAA;IAE7B;;;OAGG;IACH,iCAAS,CAAA;AACV,CAAC,EA/BW,oBAAoB,KAApB,oBAAoB,QA+B/B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIEnvelope,\n\tInboundAttachMessage,\n\tIAttachMessage,\n} from \"@fluidframework/runtime-definitions\";\nimport type { IdCreationRange } from \"@fluidframework/id-compressor\";\nimport { IDataStoreAliasMessage } from \"./dataStore\";\nimport { GarbageCollectionMessage } from \"./gc\";\nimport { IChunkedOp } from \"./opLifecycle\";\n\n/**\n * @internal\n */\nexport enum ContainerMessageType {\n\t// An op to be delivered to store\n\tFluidDataStoreOp = \"component\",\n\n\t// Creates a new store\n\tAttach = \"attach\",\n\n\t// Chunked operation.\n\tChunkedOp = \"chunkedOp\",\n\n\t// Signifies that a blob has been attached and should not be garbage collected by storage\n\tBlobAttach = \"blobAttach\",\n\n\t// Ties our new clientId to our old one on reconnect\n\tRejoin = \"rejoin\",\n\n\t// Sets the alias of a root data store\n\tAlias = \"alias\",\n\n\t/**\n\t * An op containing an IdRange of Ids allocated using the runtime's IdCompressor since\n\t * the last allocation op was sent.\n\t * See the [IdCompressor README](./id-compressor/README.md) for more details.\n\t */\n\tIdAllocation = \"idAllocation\",\n\n\t/**\n\t * Garbage collection specific op. This is sent by the summarizer client when GC runs. It's used to synchronize GC\n\t * state across all clients.\n\t */\n\tGC = \"GC\",\n}\n\n/**\n * How should an older client handle an unrecognized remote op type?\n *\n * @internal\n */\nexport type CompatModeBehavior =\n\t/** Ignore the op. It won't be persisted if this client summarizes */\n\t| \"Ignore\"\n\t/** Fail processing immediately. (The container will close) */\n\t| \"FailToProcess\";\n\n/**\n * All the info an older client would need to know how to handle an unrecognized remote op type\n *\n * @internal\n */\nexport interface IContainerRuntimeMessageCompatDetails {\n\t/** How should an older client handle an unrecognized remote op type? */\n\tbehavior: CompatModeBehavior;\n}\n\n/**\n * The unpacked runtime message / details to be handled or dispatched by the ContainerRuntime.\n * Message type are differentiated via a `type` string and contain different contents depending on their type.\n *\n * IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.\n * This way stringified values can be compared.\n */\ninterface TypedContainerRuntimeMessage<TType extends ContainerMessageType, TContents>\n\textends Partial<RecentlyAddedContainerRuntimeMessageDetails> {\n\t/** Type of the op, within the ContainerRuntime's domain */\n\ttype: TType;\n\t/** Domain-specific contents, interpreted according to the type */\n\tcontents: TContents;\n}\n\n/**\n * Additional details expected for any recently added message.\n * @internal\n */\nexport interface RecentlyAddedContainerRuntimeMessageDetails {\n\t/** Info describing how to handle this op in case the type is unrecognized (default: fail to process) */\n\tcompatDetails: IContainerRuntimeMessageCompatDetails;\n}\n\nexport type ContainerRuntimeDataStoreOpMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.FluidDataStoreOp,\n\tIEnvelope\n>;\nexport type InboundContainerRuntimeAttachMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Attach,\n\tInboundAttachMessage\n>;\nexport type OutboundContainerRuntimeAttachMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Attach,\n\tIAttachMessage\n>;\nexport type ContainerRuntimeChunkedOpMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.ChunkedOp,\n\tIChunkedOp\n>;\nexport type ContainerRuntimeBlobAttachMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.BlobAttach,\n\tundefined\n>;\nexport type ContainerRuntimeRejoinMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Rejoin,\n\tundefined\n>;\nexport type ContainerRuntimeAliasMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Alias,\n\tIDataStoreAliasMessage\n>;\nexport type ContainerRuntimeIdAllocationMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.IdAllocation,\n\tIdCreationRange\n>;\nexport type ContainerRuntimeGCMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.GC,\n\tGarbageCollectionMessage\n>;\n\n/**\n * Represents an unrecognized {@link TypedContainerRuntimeMessage}, e.g. a message from a future version of the container runtime.\n * @internal\n */\nexport interface UnknownContainerRuntimeMessage\n\textends Partial<RecentlyAddedContainerRuntimeMessageDetails> {\n\t/** Invalid type of the op, within the ContainerRuntime's domain. This value should never exist at runtime.\n\t * This is useful for type narrowing but should never be used as an actual message type at runtime.\n\t * Actual value will not be \"__unknown...\", but the type `Exclude<string, ContainerMessageType>` is not supported.\n\t */\n\ttype: \"__unknown_container_message_type__never_use_as_value__\";\n\n\t/** Domain-specific contents, but not decipherable by an unknown op. */\n\tcontents: unknown;\n}\n\n/**\n * A {@link TypedContainerRuntimeMessage} that is received from the server and will be processed by the container runtime.\n */\nexport type InboundContainerRuntimeMessage =\n\t| ContainerRuntimeDataStoreOpMessage\n\t| InboundContainerRuntimeAttachMessage\n\t| ContainerRuntimeChunkedOpMessage\n\t| ContainerRuntimeBlobAttachMessage\n\t| ContainerRuntimeRejoinMessage\n\t| ContainerRuntimeAliasMessage\n\t| ContainerRuntimeIdAllocationMessage\n\t| ContainerRuntimeGCMessage\n\t// Inbound messages may include unknown types from other clients, so we include that as a special case here\n\t| UnknownContainerRuntimeMessage;\n\n/** A {@link TypedContainerRuntimeMessage} that has been generated by the container runtime but is not yet being sent to the server. */\nexport type LocalContainerRuntimeMessage =\n\t| ContainerRuntimeDataStoreOpMessage\n\t| OutboundContainerRuntimeAttachMessage\n\t| ContainerRuntimeChunkedOpMessage\n\t| ContainerRuntimeBlobAttachMessage\n\t| ContainerRuntimeRejoinMessage\n\t| ContainerRuntimeAliasMessage\n\t| ContainerRuntimeIdAllocationMessage\n\t| ContainerRuntimeGCMessage\n\t// In rare cases (e.g. related to stashed ops) we could have a local message of an unknown type\n\t| UnknownContainerRuntimeMessage;\n\n/** A {@link TypedContainerRuntimeMessage} that is being sent to the server from the container runtime. */\nexport type OutboundContainerRuntimeMessage =\n\t| ContainerRuntimeDataStoreOpMessage\n\t| OutboundContainerRuntimeAttachMessage\n\t| ContainerRuntimeChunkedOpMessage\n\t| ContainerRuntimeBlobAttachMessage\n\t| ContainerRuntimeRejoinMessage\n\t| ContainerRuntimeAliasMessage\n\t| ContainerRuntimeIdAllocationMessage\n\t| ContainerRuntimeGCMessage;\n\n/**\n * An unpacked ISequencedDocumentMessage with the inner TypedContainerRuntimeMessage type/contents/etc\n * promoted up to the outer object\n */\nexport type InboundSequencedContainerRuntimeMessage = Omit<\n\tISequencedDocumentMessage,\n\t\"type\" | \"contents\"\n> &\n\tInboundContainerRuntimeMessage;\n\n/** Essentially ISequencedDocumentMessage except that `type` is not `string` to enable narrowing\n * as `Exclude<string, InboundContainerRuntimeMessage['type']>` is not supported.\n * There should never be a runtime value of \"__not_a_...\".\n * Currently additionally replaces `contents` type until protocol-definitions update is taken with `unknown` instead of `any`.\n */\ntype InboundSequencedNonContainerRuntimeMessage = Omit<\n\tISequencedDocumentMessage,\n\t\"type\" | \"contents\"\n> & { type: \"__not_a_container_runtime_message_type__\"; contents: unknown };\n\nexport type InboundSequencedContainerRuntimeMessageOrSystemMessage =\n\t| InboundSequencedContainerRuntimeMessage\n\t| InboundSequencedNonContainerRuntimeMessage;\n\n/** A [loose] InboundSequencedContainerRuntimeMessage that is recent and may contain compat details.\n * It exists solely to to provide access to those details.\n */\nexport type InboundSequencedRecentlyAddedContainerRuntimeMessage = ISequencedDocumentMessage &\n\tPartial<RecentlyAddedContainerRuntimeMessageDetails>;\n\n/**\n * The unpacked runtime message / details to be handled or dispatched by the ContainerRuntime\n *\n * IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.\n * This way stringified values can be compared.\n *\n * @deprecated this is an internal type which should not be used outside of the package.\n * Internally, it is superseded by `TypedContainerRuntimeMessage`.\n *\n * @internal\n */\nexport interface ContainerRuntimeMessage {\n\t/** Type of the op, within the ContainerRuntime's domain */\n\ttype: ContainerMessageType;\n\t/** Domain-specific contents, interpreted according to the type */\n\tcontents: any;\n\t/** Info describing how to handle this op in case the type is unrecognized (default: fail to process) */\n\tcompatDetails?: IContainerRuntimeMessageCompatDetails;\n}\n"]}
|