@fluidframework/container-runtime 2.0.0-dev.6.4.0.192049 → 2.0.0-dev.7.2.0.204906
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 +119 -0
- package/api-extractor.json +1 -1
- package/api-report/container-runtime.api.md +866 -0
- package/dist/blobManager.d.ts +4 -6
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +56 -78
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +75 -42
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/container-runtime-alpha.d.ts +1744 -0
- package/dist/container-runtime-beta.d.ts +1744 -0
- package/dist/container-runtime-public.d.ts +1744 -0
- package/dist/container-runtime-untrimmed.d.ts +1805 -0
- package/dist/containerHandleContext.js +3 -3
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +94 -102
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +478 -454
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +11 -11
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +2 -4
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +56 -59
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +3 -0
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js +6 -3
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/dataStores.d.ts +0 -2
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +3 -8
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaManagerProxyBase.js +4 -4
- package/dist/deltaManagerProxyBase.js.map +1 -1
- package/dist/deltaManagerSummarizerProxy.js +6 -6
- package/dist/deltaManagerSummarizerProxy.js.map +1 -1
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +6 -0
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +36 -25
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts +1 -0
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +13 -3
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +48 -28
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +10 -7
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcSummaryDefinitions.d.ts +1 -1
- package/dist/gc/gcSummaryDefinitions.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +3 -4
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +7 -8
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +3 -3
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/gc/index.d.ts +2 -2
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +3 -7
- package/dist/gc/index.js.map +1 -1
- package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/dist/id-compressor/idCompressor.js.map +1 -1
- package/dist/id-compressor/identifiers.d.ts +3 -3
- package/dist/id-compressor/identifiers.d.ts.map +1 -1
- package/dist/id-compressor/utilities.d.ts +3 -0
- package/dist/id-compressor/utilities.d.ts.map +1 -1
- package/dist/id-compressor/utilities.js +3 -0
- package/dist/id-compressor/utilities.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/messageTypes.d.ts +137 -0
- package/dist/messageTypes.d.ts.map +1 -0
- package/dist/messageTypes.js +32 -0
- package/dist/messageTypes.js.map +1 -0
- package/dist/opLifecycle/batchManager.js +6 -6
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +7 -3
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +0 -4
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.js +3 -3
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +7 -2
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +17 -3
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +38 -25
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts +4 -20
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +36 -46
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.js +6 -2
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +7 -4
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +54 -54
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +5 -0
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +7 -6
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +40 -38
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +2 -0
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +18 -8
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.js +6 -6
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js +9 -9
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +8 -8
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +3 -3
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +107 -22
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +18 -2
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +23 -21
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +15 -6
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +3 -3
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +2 -2
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +10 -10
- package/dist/summary/summaryManager.js.map +1 -1
- package/dist/throttler.js +16 -16
- package/dist/throttler.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/blobManager.d.ts +4 -6
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +58 -80
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +76 -43
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerHandleContext.js +3 -3
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +94 -102
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +437 -418
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +11 -11
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +2 -4
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +57 -60
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts +3 -0
- package/lib/dataStoreRegistry.d.ts.map +1 -1
- package/lib/dataStoreRegistry.js +6 -3
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/dataStores.d.ts +0 -2
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +4 -9
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaManagerProxyBase.js +4 -4
- package/lib/deltaManagerProxyBase.js.map +1 -1
- package/lib/deltaManagerSummarizerProxy.js +6 -6
- package/lib/deltaManagerSummarizerProxy.js.map +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +6 -0
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +36 -25
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts +1 -0
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +15 -5
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +48 -28
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +9 -6
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcSummaryDefinitions.d.ts +1 -1
- package/lib/gc/gcSummaryDefinitions.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +3 -4
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +7 -8
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +3 -3
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/lib/gc/index.d.ts +2 -2
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +2 -2
- package/lib/gc/index.js.map +1 -1
- package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/lib/id-compressor/idCompressor.js.map +1 -1
- package/lib/id-compressor/identifiers.d.ts +3 -3
- package/lib/id-compressor/identifiers.d.ts.map +1 -1
- package/lib/id-compressor/utilities.d.ts +3 -0
- package/lib/id-compressor/utilities.d.ts.map +1 -1
- package/lib/id-compressor/utilities.js +3 -0
- package/lib/id-compressor/utilities.js.map +1 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/messageTypes.d.ts +137 -0
- package/lib/messageTypes.d.ts.map +1 -0
- package/lib/messageTypes.js +29 -0
- package/lib/messageTypes.js.map +1 -0
- package/lib/opLifecycle/batchManager.js +6 -6
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +7 -3
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +0 -4
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.js +1 -1
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +7 -2
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +17 -3
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +37 -24
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts +4 -20
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +35 -45
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.js +6 -2
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +7 -4
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +54 -54
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +5 -0
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +7 -6
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +40 -38
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +2 -0
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +19 -9
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.js +6 -6
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.js +9 -9
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +8 -8
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +3 -3
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +107 -22
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +18 -2
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +23 -21
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +15 -6
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +3 -3
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +2 -2
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +9 -9
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/throttler.js +16 -16
- package/lib/throttler.js.map +1 -1
- package/package.json +32 -29
- package/src/blobManager.ts +67 -92
- package/src/connectionTelemetry.ts +97 -52
- package/src/containerRuntime.ts +351 -351
- package/src/dataStore.ts +3 -3
- package/src/dataStoreContext.ts +9 -13
- package/src/dataStoreRegistry.ts +3 -0
- package/src/dataStores.ts +5 -17
- package/src/error.ts +4 -1
- package/src/gc/garbageCollection.ts +25 -12
- package/src/gc/gcConfigs.ts +25 -7
- package/src/gc/gcDefinitions.ts +49 -29
- package/src/gc/gcSummaryDefinitions.ts +1 -1
- package/src/gc/gcTelemetry.ts +8 -8
- package/src/gc/index.ts +2 -6
- package/src/id-compressor/utilities.ts +3 -0
- package/src/index.ts +21 -5
- package/src/messageTypes.ts +228 -0
- package/src/opLifecycle/README.md +93 -68
- package/src/opLifecycle/definitions.ts +5 -1
- package/src/opLifecycle/opDecompressor.ts +0 -8
- package/src/opLifecycle/opGroupingManager.ts +2 -4
- package/src/opLifecycle/opSplitter.ts +2 -2
- package/src/opLifecycle/outbox.ts +3 -0
- package/src/opLifecycle/remoteMessageProcessor.ts +54 -33
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +31 -52
- package/src/scheduleManager.ts +2 -0
- package/src/summary/orderedClientElection.ts +4 -1
- package/src/summary/runWhileConnectedCoordinator.ts +5 -1
- package/src/summary/runningSummarizer.ts +3 -1
- package/src/summary/summarizer.ts +21 -7
- package/src/summary/summarizerNode/summarizerNode.ts +1 -1
- package/src/summary/summarizerTypes.ts +96 -11
- package/src/summary/summaryCollection.ts +19 -1
- package/src/summary/summaryFormat.ts +11 -1
- package/src/summary/summaryGenerator.ts +3 -3
- package/src/summary/summaryManager.ts +2 -2
- package/src/gc/gcEarlyAdoption.md +0 -145
package/src/dataStore.ts
CHANGED
|
@@ -161,7 +161,7 @@ class DataStore implements IDataStore {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
/**
|
|
164
|
-
* @deprecated
|
|
164
|
+
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
165
165
|
*/
|
|
166
166
|
public async request(request: IRequest): Promise<IResponse> {
|
|
167
167
|
return this.fluidDataStoreChannel.request(request);
|
|
@@ -170,7 +170,7 @@ class DataStore implements IDataStore {
|
|
|
170
170
|
/**
|
|
171
171
|
* {@inheritDoc @fluidframework/runtime-definitions#IDataStore.entryPoint}
|
|
172
172
|
*/
|
|
173
|
-
get entryPoint(): IFluidHandle<FluidObject>
|
|
173
|
+
get entryPoint(): IFluidHandle<FluidObject> {
|
|
174
174
|
return this.fluidDataStoreChannel.entryPoint;
|
|
175
175
|
}
|
|
176
176
|
|
|
@@ -185,7 +185,7 @@ class DataStore implements IDataStore {
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
/**
|
|
188
|
-
* @deprecated
|
|
188
|
+
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
189
189
|
*/
|
|
190
190
|
public get IFluidRouter() {
|
|
191
191
|
return this.fluidDataStoreChannel;
|
package/src/dataStoreContext.ts
CHANGED
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
summarizerClientType,
|
|
79
79
|
} from "./summary";
|
|
80
80
|
import { ContainerRuntime } from "./containerRuntime";
|
|
81
|
-
import { sendGCUnexpectedUsageEvent
|
|
81
|
+
import { sendGCUnexpectedUsageEvent } from "./gc";
|
|
82
82
|
|
|
83
83
|
function createAttributes(
|
|
84
84
|
pkg: readonly string[],
|
|
@@ -325,11 +325,7 @@ export abstract class FluidDataStoreContext
|
|
|
325
325
|
this.mc.logger,
|
|
326
326
|
);
|
|
327
327
|
|
|
328
|
-
|
|
329
|
-
this.throwOnTombstoneUsage =
|
|
330
|
-
this.mc.config.getBoolean(throwOnTombstoneUsageKey) === true &&
|
|
331
|
-
this._containerRuntime.gcTombstoneEnforcementAllowed &&
|
|
332
|
-
this.clientDetails.type !== summarizerClientType;
|
|
328
|
+
this.throwOnTombstoneUsage = this._containerRuntime.gcThrowOnTombstoneUsage;
|
|
333
329
|
|
|
334
330
|
// By default, a data store can log maximum 10 local changes telemetry in summarizer.
|
|
335
331
|
this.localChangesTelemetryCount =
|
|
@@ -458,6 +454,11 @@ export abstract class FluidDataStoreContext
|
|
|
458
454
|
const channel = await factory.instantiateDataStore(this, existing);
|
|
459
455
|
assert(channel !== undefined, 0x140 /* "undefined channel on datastore context" */);
|
|
460
456
|
this.bindRuntime(channel);
|
|
457
|
+
// This data store may have been disposed before the channel is created during realization. If so,
|
|
458
|
+
// dispose the channel now.
|
|
459
|
+
if (this.disposed) {
|
|
460
|
+
channel.dispose();
|
|
461
|
+
}
|
|
461
462
|
}
|
|
462
463
|
|
|
463
464
|
/**
|
|
@@ -740,11 +741,6 @@ export abstract class FluidDataStoreContext
|
|
|
740
741
|
this.makeLocallyVisibleFn();
|
|
741
742
|
}
|
|
742
743
|
|
|
743
|
-
/** @deprecated - To be replaced by calling makeLocallyVisible directly */
|
|
744
|
-
public bindToContext() {
|
|
745
|
-
this.makeLocallyVisibleFn();
|
|
746
|
-
}
|
|
747
|
-
|
|
748
744
|
protected bindRuntime(channel: IFluidDataStoreChannel) {
|
|
749
745
|
if (this.channel) {
|
|
750
746
|
throw new Error("Runtime already bound");
|
|
@@ -820,7 +816,7 @@ export abstract class FluidDataStoreContext
|
|
|
820
816
|
}
|
|
821
817
|
|
|
822
818
|
/**
|
|
823
|
-
* @deprecated
|
|
819
|
+
* @deprecated The functionality to get base GC details has been moved to summarizer node.
|
|
824
820
|
*/
|
|
825
821
|
public async getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase> {
|
|
826
822
|
return {};
|
|
@@ -1206,7 +1202,7 @@ export class LocalDetachedFluidDataStoreContext
|
|
|
1206
1202
|
// of data store factories tends to construct the data object (at least kick off an async method that returns
|
|
1207
1203
|
// it); that code moved to the entryPoint initialization function, so we want to ensure it still executes
|
|
1208
1204
|
// before the data store is attached.
|
|
1209
|
-
await dataStoreChannel.entryPoint
|
|
1205
|
+
await dataStoreChannel.entryPoint.get();
|
|
1210
1206
|
|
|
1211
1207
|
if (await this.isRoot()) {
|
|
1212
1208
|
dataStoreChannel.makeVisibleAndAttachGraph();
|
package/src/dataStoreRegistry.ts
CHANGED
package/src/dataStores.ts
CHANGED
|
@@ -65,12 +65,7 @@ import {
|
|
|
65
65
|
} from "./dataStoreContext";
|
|
66
66
|
import { StorageServiceWithAttachBlobs } from "./storageServiceWithAttachBlobs";
|
|
67
67
|
import { IDataStoreAliasMessage, isDataStoreAliasMessage } from "./dataStore";
|
|
68
|
-
import {
|
|
69
|
-
GCNodeType,
|
|
70
|
-
disableDatastoreSweepKey,
|
|
71
|
-
throwOnTombstoneLoadKey,
|
|
72
|
-
sendGCUnexpectedUsageEvent,
|
|
73
|
-
} from "./gc";
|
|
68
|
+
import { GCNodeType, disableDatastoreSweepKey, sendGCUnexpectedUsageEvent } from "./gc";
|
|
74
69
|
import {
|
|
75
70
|
summarizerClientType,
|
|
76
71
|
IContainerRuntimeMetadata,
|
|
@@ -104,8 +99,6 @@ export class DataStores implements IDisposable {
|
|
|
104
99
|
// Stores the ids of new data stores between two GC runs. This is used to notify the garbage collector of new
|
|
105
100
|
// root data stores that are added.
|
|
106
101
|
private dataStoresSinceLastGC: string[] = [];
|
|
107
|
-
/** If true, throw an error when a tombstone data store is retrieved. */
|
|
108
|
-
private readonly throwOnTombstoneLoad: boolean;
|
|
109
102
|
// The handle to the container runtime. This is used mainly for GC purposes to represent outbound reference from
|
|
110
103
|
// the container runtime to other nodes.
|
|
111
104
|
private readonly containerRuntimeHandle: IFluidHandle;
|
|
@@ -140,12 +133,6 @@ export class DataStores implements IDisposable {
|
|
|
140
133
|
this.runtime.IFluidHandleContext,
|
|
141
134
|
);
|
|
142
135
|
|
|
143
|
-
// Tombstone should only throw when the feature flag is enabled and the client isn't a summarizer
|
|
144
|
-
this.throwOnTombstoneLoad =
|
|
145
|
-
this.mc.config.getBoolean(throwOnTombstoneLoadKey) === true &&
|
|
146
|
-
this.runtime.gcTombstoneEnforcementAllowed &&
|
|
147
|
-
this.runtime.clientDetails.type !== summarizerClientType;
|
|
148
|
-
|
|
149
136
|
// Extract stores stored inside the snapshot
|
|
150
137
|
const fluidDataStores = new Map<string, ISnapshotTree>();
|
|
151
138
|
if (baseSnapshot) {
|
|
@@ -212,7 +199,7 @@ export class DataStores implements IDisposable {
|
|
|
212
199
|
|
|
213
200
|
public async waitIfPendingAlias(maybeAlias: string): Promise<AliasResult> {
|
|
214
201
|
const pendingAliasPromise = this.pendingAliases.get(maybeAlias);
|
|
215
|
-
return pendingAliasPromise
|
|
202
|
+
return pendingAliasPromise ?? "Success";
|
|
216
203
|
}
|
|
217
204
|
|
|
218
205
|
public processAttachMessage(message: ISequencedDocumentMessage, local: boolean) {
|
|
@@ -542,7 +529,8 @@ export class DataStores implements IDisposable {
|
|
|
542
529
|
if (!context.tombstoned) {
|
|
543
530
|
return false;
|
|
544
531
|
}
|
|
545
|
-
const logErrorEvent =
|
|
532
|
+
const logErrorEvent =
|
|
533
|
+
this.runtime.gcThrowOnTombstoneLoad && !requestHeaderData.allowTombstone;
|
|
546
534
|
sendGCUnexpectedUsageEvent(
|
|
547
535
|
this.mc,
|
|
548
536
|
{
|
|
@@ -578,7 +566,7 @@ export class DataStores implements IDisposable {
|
|
|
578
566
|
request,
|
|
579
567
|
);
|
|
580
568
|
// Throw an error if configured via options and via request headers.
|
|
581
|
-
if (this.
|
|
569
|
+
if (this.runtime.gcThrowOnTombstoneLoad && !requestHeaderData.allowTombstone) {
|
|
582
570
|
throw error;
|
|
583
571
|
}
|
|
584
572
|
}
|
package/src/error.ts
CHANGED
|
@@ -12,7 +12,10 @@ import { IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils";
|
|
|
12
12
|
export class ClientSessionExpiredError extends LoggingError implements IFluidErrorBase {
|
|
13
13
|
readonly errorType = ContainerErrorTypes.clientSessionExpiredError;
|
|
14
14
|
|
|
15
|
-
constructor(
|
|
15
|
+
constructor(
|
|
16
|
+
message: string,
|
|
17
|
+
readonly expiryMs: number,
|
|
18
|
+
) {
|
|
16
19
|
super(message, { timeoutMs: expiryMs });
|
|
17
20
|
}
|
|
18
21
|
}
|
|
@@ -113,6 +113,19 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
113
113
|
private readonly summaryStateTracker: GCSummaryStateTracker;
|
|
114
114
|
private readonly telemetryTracker: GCTelemetryTracker;
|
|
115
115
|
|
|
116
|
+
/** If false, loading or using a Tombstoned object should merely log, not fail */
|
|
117
|
+
public get tombstoneEnforcementAllowed(): boolean {
|
|
118
|
+
return this.configs.tombstoneEnforcementAllowed;
|
|
119
|
+
}
|
|
120
|
+
/** If true, throw an error when a tombstone data store is retrieved */
|
|
121
|
+
public get throwOnTombstoneLoad(): boolean {
|
|
122
|
+
return this.configs.throwOnTombstoneLoad;
|
|
123
|
+
}
|
|
124
|
+
/** If true, throw an error when a tombstone data store is used */
|
|
125
|
+
public get throwOnTombstoneUsage(): boolean {
|
|
126
|
+
return this.configs.throwOnTombstoneUsage;
|
|
127
|
+
}
|
|
128
|
+
|
|
116
129
|
/** For a given node path, returns the node's package path. */
|
|
117
130
|
private readonly getNodePackagePath: (
|
|
118
131
|
nodePath: string,
|
|
@@ -176,7 +189,6 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
176
189
|
this.mc,
|
|
177
190
|
this.configs,
|
|
178
191
|
this.isSummarizerClient,
|
|
179
|
-
this.runtime.gcTombstoneEnforcementAllowed,
|
|
180
192
|
createParams.createContainerMetadata,
|
|
181
193
|
(nodeId: string) => this.runtime.getNodeType(nodeId),
|
|
182
194
|
(nodeId: string) => this.unreferencedNodesState.get(nodeId),
|
|
@@ -287,15 +299,13 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
287
299
|
return { gcData: { gcNodes }, usedRoutes };
|
|
288
300
|
});
|
|
289
301
|
|
|
290
|
-
// Log all the GC options and the state determined by the garbage collector.
|
|
291
|
-
//
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
});
|
|
298
|
-
}
|
|
302
|
+
// Log all the GC options and the state determined by the garbage collector.
|
|
303
|
+
// This is useful even for interactive clients since they track unreferenced nodes and log errors.
|
|
304
|
+
this.mc.logger.sendTelemetryEvent({
|
|
305
|
+
eventName: "GarbageCollectorLoaded",
|
|
306
|
+
gcConfigs: JSON.stringify(this.configs),
|
|
307
|
+
gcOptions: JSON.stringify(createParams.gcOptions),
|
|
308
|
+
});
|
|
299
309
|
}
|
|
300
310
|
|
|
301
311
|
/**
|
|
@@ -883,8 +893,11 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
883
893
|
viaHandle: requestHeaders?.[RuntimeHeaders.viaHandle],
|
|
884
894
|
});
|
|
885
895
|
|
|
886
|
-
// Unless this is a Loaded event, we're done after telemetry tracking
|
|
887
|
-
if (
|
|
896
|
+
// Unless this is a Loaded event for a Blob or DataStore, we're done after telemetry tracking
|
|
897
|
+
if (
|
|
898
|
+
reason !== "Loaded" ||
|
|
899
|
+
![GCNodeType.Blob, GCNodeType.DataStore].includes(this.runtime.getNodeType(nodePath))
|
|
900
|
+
) {
|
|
888
901
|
return;
|
|
889
902
|
}
|
|
890
903
|
|
package/src/gc/gcConfigs.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { MonitoringContext, UsageError } from "@fluidframework/telemetry-utils";
|
|
7
7
|
import { IContainerRuntimeMetadata } from "../summary";
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
nextGCVersion,
|
|
10
10
|
defaultInactiveTimeoutMs,
|
|
11
11
|
defaultSessionExpiryDurationMs,
|
|
12
12
|
disableTombstoneKey,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
gcTestModeKey,
|
|
16
16
|
gcTombstoneGenerationOptionName,
|
|
17
17
|
GCVersion,
|
|
18
|
-
|
|
18
|
+
gcVersionUpgradeToV4Key,
|
|
19
19
|
IGarbageCollectorConfigs,
|
|
20
20
|
IGCRuntimeOptions,
|
|
21
21
|
maxSnapshotCacheExpiryMs,
|
|
@@ -24,8 +24,10 @@ import {
|
|
|
24
24
|
runSessionExpiryKey,
|
|
25
25
|
runSweepKey,
|
|
26
26
|
stableGCVersion,
|
|
27
|
+
throwOnTombstoneLoadKey,
|
|
28
|
+
throwOnTombstoneUsageKey,
|
|
27
29
|
} from "./gcDefinitions";
|
|
28
|
-
import { getGCVersion, shouldAllowGcSweep } from "./gcHelpers";
|
|
30
|
+
import { getGCVersion, shouldAllowGcSweep, shouldAllowGcTombstoneEnforcement } from "./gcHelpers";
|
|
29
31
|
|
|
30
32
|
/**
|
|
31
33
|
* Generates configurations for the Garbage Collector that it uses to determine what to run and how.
|
|
@@ -42,6 +44,7 @@ export function generateGCConfigs(
|
|
|
42
44
|
gcOptions: IGCRuntimeOptions;
|
|
43
45
|
metadata: IContainerRuntimeMetadata | undefined;
|
|
44
46
|
existing: boolean;
|
|
47
|
+
isSummarizerClient: boolean;
|
|
45
48
|
},
|
|
46
49
|
): IGarbageCollectorConfigs {
|
|
47
50
|
let gcEnabled: boolean;
|
|
@@ -107,7 +110,7 @@ export function generateGCConfigs(
|
|
|
107
110
|
|
|
108
111
|
// If version upgrade is not enabled, fall back to the stable GC version.
|
|
109
112
|
const gcVersionInEffect =
|
|
110
|
-
mc.config.getBoolean(
|
|
113
|
+
mc.config.getBoolean(gcVersionUpgradeToV4Key) === true ? nextGCVersion : stableGCVersion;
|
|
111
114
|
|
|
112
115
|
// The GC version is up-to-date if the GC version in effect is at least equal to the GC version in base snapshot.
|
|
113
116
|
// If it is not up-to-date, there is a newer version of GC out there which is more reliable than this. So, GC
|
|
@@ -152,8 +155,6 @@ export function generateGCConfigs(
|
|
|
152
155
|
throw new UsageError("inactive timeout should not be greater than the sweep timeout");
|
|
153
156
|
}
|
|
154
157
|
|
|
155
|
-
const throwOnInactiveLoad: boolean | undefined = createParams.gcOptions.throwOnInactiveLoad;
|
|
156
|
-
|
|
157
158
|
// Whether we are running in test mode. In this mode, unreferenced nodes are immediately deleted.
|
|
158
159
|
const testMode =
|
|
159
160
|
mc.config.getBoolean(gcTestModeKey) ?? createParams.gcOptions.runGCInTestMode === true;
|
|
@@ -162,6 +163,20 @@ export function generateGCConfigs(
|
|
|
162
163
|
const tombstoneMode = !shouldRunSweep && mc.config.getBoolean(disableTombstoneKey) !== true;
|
|
163
164
|
const runFullGC = createParams.gcOptions.runFullGC;
|
|
164
165
|
|
|
166
|
+
const throwOnInactiveLoad: boolean | undefined = createParams.gcOptions.throwOnInactiveLoad;
|
|
167
|
+
const tombstoneEnforcementAllowed = shouldAllowGcTombstoneEnforcement(
|
|
168
|
+
createParams.metadata?.gcFeatureMatrix?.tombstoneGeneration /* persisted */,
|
|
169
|
+
createParams.gcOptions[gcTombstoneGenerationOptionName] /* current */,
|
|
170
|
+
);
|
|
171
|
+
const throwOnTombstoneLoad =
|
|
172
|
+
mc.config.getBoolean(throwOnTombstoneLoadKey) === true &&
|
|
173
|
+
tombstoneEnforcementAllowed &&
|
|
174
|
+
!createParams.isSummarizerClient;
|
|
175
|
+
const throwOnTombstoneUsage =
|
|
176
|
+
mc.config.getBoolean(throwOnTombstoneUsageKey) === true &&
|
|
177
|
+
tombstoneEnforcementAllowed &&
|
|
178
|
+
!createParams.isSummarizerClient;
|
|
179
|
+
|
|
165
180
|
return {
|
|
166
181
|
gcEnabled,
|
|
167
182
|
sweepEnabled,
|
|
@@ -173,10 +188,13 @@ export function generateGCConfigs(
|
|
|
173
188
|
sessionExpiryTimeoutMs,
|
|
174
189
|
sweepTimeoutMs,
|
|
175
190
|
inactiveTimeoutMs,
|
|
176
|
-
throwOnInactiveLoad,
|
|
177
191
|
persistedGcFeatureMatrix,
|
|
178
192
|
gcVersionInBaseSnapshot,
|
|
179
193
|
gcVersionInEffect,
|
|
194
|
+
throwOnInactiveLoad,
|
|
195
|
+
tombstoneEnforcementAllowed,
|
|
196
|
+
throwOnTombstoneLoad,
|
|
197
|
+
throwOnTombstoneUsage,
|
|
180
198
|
};
|
|
181
199
|
}
|
|
182
200
|
|
package/src/gc/gcDefinitions.ts
CHANGED
|
@@ -20,12 +20,15 @@ import {
|
|
|
20
20
|
IRefreshSummaryResult,
|
|
21
21
|
} from "../summary";
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
23
26
|
export type GCVersion = number;
|
|
24
27
|
|
|
25
|
-
/** The stable version of
|
|
26
|
-
export const stableGCVersion: GCVersion =
|
|
27
|
-
/** The
|
|
28
|
-
export const
|
|
28
|
+
/** The stable/default version of GC Data */
|
|
29
|
+
export const stableGCVersion: GCVersion = 3;
|
|
30
|
+
/** The next version of GC Data, to bump to in case we need to regenerate all GC Data across all files. */
|
|
31
|
+
export const nextGCVersion: GCVersion = 4;
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
34
|
* This undocumented GC Option (on ContainerRuntime Options) allows an app to disable enforcing GC on old documents by incrementing this value
|
|
@@ -60,7 +63,7 @@ export const throwOnTombstoneLoadKey = "Fluid.GarbageCollection.ThrowOnTombstone
|
|
|
60
63
|
/** Config key to enable throwing an error when tombstone object is used (e.g. outgoing or incoming ops). */
|
|
61
64
|
export const throwOnTombstoneUsageKey = "Fluid.GarbageCollection.ThrowOnTombstoneUsage";
|
|
62
65
|
/** Config key to enable GC version upgrade. */
|
|
63
|
-
export const
|
|
66
|
+
export const gcVersionUpgradeToV4Key = "Fluid.GarbageCollection.GCVersionUpgradeToV4";
|
|
64
67
|
/** Config key to disable GC sweep for datastores. */
|
|
65
68
|
export const disableDatastoreSweepKey = "Fluid.GarbageCollection.DisableDataStoreSweep";
|
|
66
69
|
/** Config key to disable GC sweep for attachment blobs. */
|
|
@@ -80,7 +83,10 @@ export const maxSnapshotCacheExpiryMs = 5 * oneDayMs;
|
|
|
80
83
|
export const defaultInactiveTimeoutMs = 7 * oneDayMs; // 7 days
|
|
81
84
|
export const defaultSessionExpiryDurationMs = 30 * oneDayMs; // 30 days
|
|
82
85
|
|
|
83
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* @see IGCMetadata.gcFeatureMatrix
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
84
90
|
export interface GCFeatureMatrix {
|
|
85
91
|
/**
|
|
86
92
|
* The Tombstone Generation value in effect when this file was created.
|
|
@@ -96,6 +102,9 @@ export interface GCFeatureMatrix {
|
|
|
96
102
|
sweepGeneration?: number;
|
|
97
103
|
}
|
|
98
104
|
|
|
105
|
+
/**
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
99
108
|
export interface IGCMetadata {
|
|
100
109
|
/**
|
|
101
110
|
* The version of the GC code that was run to generate the GC data that is written in the summary.
|
|
@@ -119,11 +128,11 @@ export interface IGCMetadata {
|
|
|
119
128
|
*/
|
|
120
129
|
readonly gcFeatureMatrix?: GCFeatureMatrix;
|
|
121
130
|
/**
|
|
122
|
-
* @deprecated - @see GCFeatureMatrix.sweepGeneration
|
|
123
|
-
*
|
|
124
131
|
* Tells whether the GC sweep phase is enabled for this container.
|
|
125
132
|
* - True means sweep phase is enabled.
|
|
126
133
|
* - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.
|
|
134
|
+
*
|
|
135
|
+
* @deprecated use GCFeatureMatrix.sweepGeneration instead. @see GCFeatureMatrix.sweepGeneration
|
|
127
136
|
*/
|
|
128
137
|
readonly sweepEnabled?: boolean;
|
|
129
138
|
/** If this is present, the session for this container will expire after this time and the container will close */
|
|
@@ -132,7 +141,10 @@ export interface IGCMetadata {
|
|
|
132
141
|
readonly sweepTimeoutMs?: number;
|
|
133
142
|
}
|
|
134
143
|
|
|
135
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* The statistics of the system state after a garbage collection run.
|
|
146
|
+
* @public
|
|
147
|
+
*/
|
|
136
148
|
export interface IGCStats {
|
|
137
149
|
/** The number of nodes in the container. */
|
|
138
150
|
nodeCount: number;
|
|
@@ -154,7 +166,10 @@ export interface IGCStats {
|
|
|
154
166
|
updatedAttachmentBlobCount: number;
|
|
155
167
|
}
|
|
156
168
|
|
|
157
|
-
/**
|
|
169
|
+
/**
|
|
170
|
+
* The types of GC nodes in the GC reference graph.
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
158
173
|
export const GCNodeType = {
|
|
159
174
|
// Nodes that are for data stores.
|
|
160
175
|
DataStore: "DataStore",
|
|
@@ -165,7 +180,11 @@ export const GCNodeType = {
|
|
|
165
180
|
// Nodes that are neither of the above. For example, root node.
|
|
166
181
|
Other: "Other",
|
|
167
182
|
};
|
|
168
|
-
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @public
|
|
186
|
+
*/
|
|
187
|
+
export type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];
|
|
169
188
|
|
|
170
189
|
/**
|
|
171
190
|
* Defines the APIs for the runtime object to be passed to the garbage collector.
|
|
@@ -193,8 +212,6 @@ export interface IGarbageCollectionRuntime {
|
|
|
193
212
|
getNodeType(nodePath: string): GCNodeType;
|
|
194
213
|
/** Called when the runtime should close because of an error. */
|
|
195
214
|
closeFn: (error?: ICriticalContainerError) => void;
|
|
196
|
-
/** If false, loading or using a Tombstoned object should merely log, not fail */
|
|
197
|
-
gcTombstoneEnforcementAllowed: boolean;
|
|
198
215
|
}
|
|
199
216
|
|
|
200
217
|
/** Defines the contract for the garbage collector. */
|
|
@@ -205,6 +222,12 @@ export interface IGarbageCollector {
|
|
|
205
222
|
readonly summaryStateNeedsReset: boolean;
|
|
206
223
|
/** The count of data stores whose GC state updated since the last summary. */
|
|
207
224
|
readonly updatedDSCountSinceLastSummary: number;
|
|
225
|
+
/** Tells whether tombstone feature is enabled and enforced. */
|
|
226
|
+
readonly tombstoneEnforcementAllowed: boolean;
|
|
227
|
+
/** Tells whether loading a tombstone object should fail or merely log. */
|
|
228
|
+
readonly throwOnTombstoneLoad: boolean;
|
|
229
|
+
/** Tells whether using a tombstone object should fail or merely log. */
|
|
230
|
+
readonly throwOnTombstoneUsage: boolean;
|
|
208
231
|
/** Initialize the state from the base snapshot after its creation. */
|
|
209
232
|
initializeBaseState(): Promise<void>;
|
|
210
233
|
/** Run garbage collection and update the reference / used state of the system. */
|
|
@@ -260,6 +283,9 @@ export interface IGarbageCollectorCreateParams {
|
|
|
260
283
|
readonly activeConnection: () => boolean;
|
|
261
284
|
}
|
|
262
285
|
|
|
286
|
+
/**
|
|
287
|
+
* @public
|
|
288
|
+
*/
|
|
263
289
|
export interface IGCRuntimeOptions {
|
|
264
290
|
/**
|
|
265
291
|
* Flag that if true, will enable running garbage collection (GC) for a new container.
|
|
@@ -267,24 +293,12 @@ export interface IGCRuntimeOptions {
|
|
|
267
293
|
* GC has mark phase and sweep phase. In mark phase, unreferenced objects are identified
|
|
268
294
|
* and marked as such in the summary. This option enables the mark phase.
|
|
269
295
|
* In sweep phase, unreferenced objects are eventually deleted from the container if they meet certain conditions.
|
|
270
|
-
* Sweep phase can be enabled
|
|
296
|
+
* Sweep phase can be enabled using the "gcSweepGeneration" option.
|
|
271
297
|
*
|
|
272
298
|
* Note: This setting is persisted in the container's summary and cannot be changed.
|
|
273
299
|
*/
|
|
274
300
|
gcAllowed?: boolean;
|
|
275
301
|
|
|
276
|
-
/**
|
|
277
|
-
* @deprecated - @see gcSweepGenerationOptionName and @see GCFeatureMatrix.sweepGeneration
|
|
278
|
-
*
|
|
279
|
-
* Flag that if true, enables GC's sweep phase for a new container.
|
|
280
|
-
*
|
|
281
|
-
* This will allow GC to eventually delete unreferenced objects from the container.
|
|
282
|
-
* This flag should only be set to true if "gcAllowed" is true.
|
|
283
|
-
*
|
|
284
|
-
* Note: This setting is persisted in the container's summary and cannot be changed.
|
|
285
|
-
*/
|
|
286
|
-
sweepAllowed?: boolean;
|
|
287
|
-
|
|
288
302
|
/**
|
|
289
303
|
* Flag that if true, will disable garbage collection for the session.
|
|
290
304
|
* Can be used to disable running GC on containers where it is allowed via the gcAllowed option.
|
|
@@ -344,8 +358,6 @@ export interface IGarbageCollectorConfigs {
|
|
|
344
358
|
readonly sweepTimeoutMs: number | undefined;
|
|
345
359
|
/** The time after which an unreferenced node is inactive. */
|
|
346
360
|
readonly inactiveTimeoutMs: number;
|
|
347
|
-
/** It is easier for users to diagnose InactiveObject usage if we throw on load, which this option enables */
|
|
348
|
-
readonly throwOnInactiveLoad: boolean | undefined;
|
|
349
361
|
/** Tracks whether GC should run in test mode. In this mode, unreferenced objects are deleted immediately. */
|
|
350
362
|
readonly testMode: boolean;
|
|
351
363
|
/**
|
|
@@ -361,6 +373,14 @@ export interface IGarbageCollectorConfigs {
|
|
|
361
373
|
readonly gcVersionInBaseSnapshot: GCVersion | undefined;
|
|
362
374
|
/** The current version of GC data in the running code */
|
|
363
375
|
readonly gcVersionInEffect: GCVersion;
|
|
376
|
+
/** It is easier for users to diagnose InactiveObject usage if we throw on load, which this option enables */
|
|
377
|
+
readonly throwOnInactiveLoad: boolean | undefined;
|
|
378
|
+
/** If false, loading or using a Tombstoned object should merely log, not fail */
|
|
379
|
+
readonly tombstoneEnforcementAllowed: boolean;
|
|
380
|
+
/** If true, throw an error when a tombstone data store is retrieved */
|
|
381
|
+
readonly throwOnTombstoneLoad: boolean;
|
|
382
|
+
/** If true, throw an error when a tombstone data store is used. */
|
|
383
|
+
readonly throwOnTombstoneUsage: boolean;
|
|
364
384
|
}
|
|
365
385
|
|
|
366
386
|
/** The state of node that is unreferenced. */
|
|
@@ -372,7 +392,7 @@ export const UnreferencedState = {
|
|
|
372
392
|
/** The node is ready to be deleted by the sweep phase. */
|
|
373
393
|
SweepReady: "SweepReady",
|
|
374
394
|
} as const;
|
|
375
|
-
export type UnreferencedState = typeof UnreferencedState[keyof typeof UnreferencedState];
|
|
395
|
+
export type UnreferencedState = (typeof UnreferencedState)[keyof typeof UnreferencedState];
|
|
376
396
|
|
|
377
397
|
/**
|
|
378
398
|
* Represents the result of a GC run.
|
|
@@ -41,7 +41,7 @@ export interface IGarbageCollectionSnapshotData {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* @deprecated
|
|
44
|
+
* @deprecated IGarbageCollectionState is written in the root of the summary now.
|
|
45
45
|
* Legacy GC details from when the GC details were written at the data store's summary tree.
|
|
46
46
|
*/
|
|
47
47
|
export interface IGarbageCollectionSummaryDetailsLegacy {
|
package/src/gc/gcTelemetry.ts
CHANGED
|
@@ -80,10 +80,9 @@ export class GCTelemetryTracker {
|
|
|
80
80
|
private readonly mc: MonitoringContext,
|
|
81
81
|
private readonly configs: Pick<
|
|
82
82
|
IGarbageCollectorConfigs,
|
|
83
|
-
"inactiveTimeoutMs" | "sweepTimeoutMs"
|
|
83
|
+
"inactiveTimeoutMs" | "sweepTimeoutMs" | "tombstoneEnforcementAllowed"
|
|
84
84
|
>,
|
|
85
85
|
private readonly isSummarizerClient: boolean,
|
|
86
|
-
private readonly gcTombstoneEnforcementAllowed: boolean,
|
|
87
86
|
private readonly createContainerMetadata: ICreateContainerMetadata,
|
|
88
87
|
private readonly getNodeType: (nodeId: string) => GCNodeType,
|
|
89
88
|
private readonly getNodeStateTracker: (
|
|
@@ -96,7 +95,7 @@ export class GCTelemetryTracker {
|
|
|
96
95
|
|
|
97
96
|
/**
|
|
98
97
|
* Returns whether an event should be logged for a node that isn't active anymore. Some scenarios where we won't log:
|
|
99
|
-
* 1. When a DDS is changed
|
|
98
|
+
* 1. When a DDS is changed. The corresponding data store's event will be logged instead.
|
|
100
99
|
* 2. An event is logged only once per container instance per event per node.
|
|
101
100
|
*/
|
|
102
101
|
private shouldLogNonActiveEvent(
|
|
@@ -110,12 +109,13 @@ export class GCTelemetryTracker {
|
|
|
110
109
|
return false;
|
|
111
110
|
}
|
|
112
111
|
|
|
113
|
-
|
|
114
|
-
// so skip logging to make the telemetry less noisy.
|
|
115
|
-
if (nodeType === GCNodeType.SubDataStore && usageType !== "Revived") {
|
|
112
|
+
if (nodeType === GCNodeType.Other) {
|
|
116
113
|
return false;
|
|
117
114
|
}
|
|
118
|
-
|
|
115
|
+
|
|
116
|
+
// For sub data store (DDS) nodes, if they are changed, its data store will also be changed,
|
|
117
|
+
// so skip logging to make the telemetry less noisy.
|
|
118
|
+
if (nodeType === GCNodeType.SubDataStore && usageType === "Changed") {
|
|
119
119
|
return false;
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -183,7 +183,7 @@ export class GCTelemetryTracker {
|
|
|
183
183
|
eventName: `GC_Tombstone_${nodeType}_Revived`,
|
|
184
184
|
category: "generic",
|
|
185
185
|
...tagCodeArtifacts({ url: id }),
|
|
186
|
-
gcTombstoneEnforcementAllowed: this.
|
|
186
|
+
gcTombstoneEnforcementAllowed: this.configs.tombstoneEnforcementAllowed,
|
|
187
187
|
},
|
|
188
188
|
undefined /* packagePath */,
|
|
189
189
|
);
|
package/src/gc/index.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
export { GarbageCollector } from "./garbageCollection";
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
nextGCVersion,
|
|
9
9
|
defaultInactiveTimeoutMs,
|
|
10
10
|
defaultSessionExpiryDurationMs,
|
|
11
11
|
disableSweepLogKey,
|
|
@@ -15,7 +15,7 @@ export {
|
|
|
15
15
|
gcSweepGenerationOptionName,
|
|
16
16
|
GCFeatureMatrix,
|
|
17
17
|
GCVersion,
|
|
18
|
-
|
|
18
|
+
gcVersionUpgradeToV4Key,
|
|
19
19
|
IGarbageCollectionRuntime,
|
|
20
20
|
IGarbageCollector,
|
|
21
21
|
IGarbageCollectorConfigs,
|
|
@@ -31,15 +31,11 @@ export {
|
|
|
31
31
|
stableGCVersion,
|
|
32
32
|
disableAttachmentBlobSweepKey,
|
|
33
33
|
disableDatastoreSweepKey,
|
|
34
|
-
throwOnTombstoneLoadKey,
|
|
35
|
-
throwOnTombstoneUsageKey,
|
|
36
34
|
UnreferencedState,
|
|
37
35
|
} from "./gcDefinitions";
|
|
38
36
|
export {
|
|
39
37
|
cloneGCData,
|
|
40
38
|
concatGarbageCollectionStates,
|
|
41
|
-
shouldAllowGcTombstoneEnforcement,
|
|
42
|
-
shouldAllowGcSweep,
|
|
43
39
|
trimLeadingAndTrailingSlashes,
|
|
44
40
|
unpackChildNodesGCDetails,
|
|
45
41
|
} from "./gcHelpers";
|
|
@@ -35,6 +35,7 @@ export function createSessionId(): SessionId {
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Asserts that the given string is a stable ID.
|
|
38
|
+
* @public
|
|
38
39
|
*/
|
|
39
40
|
export function assertIsStableId(stableId: string): StableId {
|
|
40
41
|
assert(isStableId(stableId), 0x4a3 /* Expected a StableId */);
|
|
@@ -51,6 +52,7 @@ export function assertIsSessionId(stableId: string): SessionId {
|
|
|
51
52
|
|
|
52
53
|
/**
|
|
53
54
|
* Generate a random stable ID
|
|
55
|
+
* @public
|
|
54
56
|
*/
|
|
55
57
|
export function generateStableId(): StableId {
|
|
56
58
|
return assertIsStableId(v4());
|
|
@@ -59,6 +61,7 @@ export function generateStableId(): StableId {
|
|
|
59
61
|
/**
|
|
60
62
|
* Returns true iff the given string is a valid Version 4, variant 2 UUID
|
|
61
63
|
* 'xxxxxxxx-xxxx-4xxx-vxxx-xxxxxxxxxxxx'
|
|
64
|
+
* @public
|
|
62
65
|
*/
|
|
63
66
|
export function isStableId(str: string): str is StableId {
|
|
64
67
|
if (str.length !== 36) {
|