@fluidframework/container-runtime 2.0.0-dev.7.2.0.203917 → 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/api-report/container-runtime.api.md +3 -1
- package/dist/blobManager.d.ts +1 -3
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +1 -7
- package/dist/blobManager.js.map +1 -1
- package/dist/container-runtime-alpha.d.ts +6 -4
- package/dist/container-runtime-beta.d.ts +6 -4
- package/dist/container-runtime-public.d.ts +6 -4
- package/dist/container-runtime-untrimmed.d.ts +6 -4
- package/dist/containerRuntime.d.ts +6 -4
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +12 -1
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +1 -5
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +0 -2
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +2 -7
- package/dist/dataStores.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 +13 -1
- 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 +12 -2
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +14 -4
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +1 -2
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +2 -3
- package/dist/gc/gcTelemetry.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 +1 -5
- package/dist/gc/index.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/lib/blobManager.d.ts +1 -3
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +2 -8
- package/lib/blobManager.js.map +1 -1
- package/lib/containerRuntime.d.ts +6 -4
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +13 -2
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +2 -6
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts +0 -2
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +3 -8
- package/lib/dataStores.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 +13 -1
- 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 +14 -4
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +14 -4
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +1 -2
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +2 -3
- package/lib/gc/gcTelemetry.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/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +20 -16
- package/src/blobManager.ts +3 -15
- package/src/containerRuntime.ts +14 -10
- package/src/dataStoreContext.ts +2 -6
- package/src/dataStores.ts +4 -16
- package/src/gc/garbageCollection.ts +13 -1
- package/src/gc/gcConfigs.ts +22 -4
- package/src/gc/gcDefinitions.ts +14 -4
- package/src/gc/gcTelemetry.ts +2 -3
- package/src/gc/index.ts +0 -4
- package/src/packageVersion.ts +1 -1
|
@@ -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),
|
package/src/gc/gcConfigs.ts
CHANGED
|
@@ -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;
|
|
@@ -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
|
@@ -212,8 +212,6 @@ export interface IGarbageCollectionRuntime {
|
|
|
212
212
|
getNodeType(nodePath: string): GCNodeType;
|
|
213
213
|
/** Called when the runtime should close because of an error. */
|
|
214
214
|
closeFn: (error?: ICriticalContainerError) => void;
|
|
215
|
-
/** If false, loading or using a Tombstoned object should merely log, not fail */
|
|
216
|
-
gcTombstoneEnforcementAllowed: boolean;
|
|
217
215
|
}
|
|
218
216
|
|
|
219
217
|
/** Defines the contract for the garbage collector. */
|
|
@@ -224,6 +222,12 @@ export interface IGarbageCollector {
|
|
|
224
222
|
readonly summaryStateNeedsReset: boolean;
|
|
225
223
|
/** The count of data stores whose GC state updated since the last summary. */
|
|
226
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;
|
|
227
231
|
/** Initialize the state from the base snapshot after its creation. */
|
|
228
232
|
initializeBaseState(): Promise<void>;
|
|
229
233
|
/** Run garbage collection and update the reference / used state of the system. */
|
|
@@ -354,8 +358,6 @@ export interface IGarbageCollectorConfigs {
|
|
|
354
358
|
readonly sweepTimeoutMs: number | undefined;
|
|
355
359
|
/** The time after which an unreferenced node is inactive. */
|
|
356
360
|
readonly inactiveTimeoutMs: number;
|
|
357
|
-
/** It is easier for users to diagnose InactiveObject usage if we throw on load, which this option enables */
|
|
358
|
-
readonly throwOnInactiveLoad: boolean | undefined;
|
|
359
361
|
/** Tracks whether GC should run in test mode. In this mode, unreferenced objects are deleted immediately. */
|
|
360
362
|
readonly testMode: boolean;
|
|
361
363
|
/**
|
|
@@ -371,6 +373,14 @@ export interface IGarbageCollectorConfigs {
|
|
|
371
373
|
readonly gcVersionInBaseSnapshot: GCVersion | undefined;
|
|
372
374
|
/** The current version of GC data in the running code */
|
|
373
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;
|
|
374
384
|
}
|
|
375
385
|
|
|
376
386
|
/** The state of node that is unreferenced. */
|
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: (
|
|
@@ -184,7 +183,7 @@ export class GCTelemetryTracker {
|
|
|
184
183
|
eventName: `GC_Tombstone_${nodeType}_Revived`,
|
|
185
184
|
category: "generic",
|
|
186
185
|
...tagCodeArtifacts({ url: id }),
|
|
187
|
-
gcTombstoneEnforcementAllowed: this.
|
|
186
|
+
gcTombstoneEnforcementAllowed: this.configs.tombstoneEnforcementAllowed,
|
|
188
187
|
},
|
|
189
188
|
undefined /* packagePath */,
|
|
190
189
|
);
|
package/src/gc/index.ts
CHANGED
|
@@ -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";
|
package/src/packageVersion.ts
CHANGED