@fluidframework/container-runtime 2.0.0-internal.7.0.0 → 2.0.0-internal.7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/api-extractor.json +1 -1
- package/api-report/container-runtime.api.md +864 -0
- package/dist/blobManager.d.ts +4 -6
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +42 -56
- 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/containerRuntime.d.ts +90 -36
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +125 -59
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +2 -2
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +8 -2
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +15 -8
- 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 +3 -0
- 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 +2 -7
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaManagerProxyBase.d.ts +1 -1
- package/dist/deltaManagerProxyBase.d.ts.map +1 -1
- package/dist/deltaManagerProxyBase.js +2 -2
- package/dist/deltaManagerProxyBase.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 +16 -3
- 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 +42 -11
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +4 -1
- 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 +2 -3
- 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/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/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 +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/messageTypes.d.ts +4 -1
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js +3 -0
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +3 -0
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.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/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +3 -1
- 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 +4 -1
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- 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 +1 -0
- package/dist/summary/runWhileConnectedCoordinator.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 +15 -7
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +94 -10
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +16 -0
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +2 -0
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +10 -1
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.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 +3 -3
- package/dist/summary/summaryManager.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 +44 -58
- 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/containerRuntime.d.ts +90 -36
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +125 -62
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +2 -2
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +8 -2
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +16 -9
- 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 +3 -0
- 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 +3 -8
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaManagerProxyBase.d.ts +1 -1
- package/lib/deltaManagerProxyBase.d.ts.map +1 -1
- package/lib/deltaManagerProxyBase.js +2 -2
- package/lib/deltaManagerProxyBase.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 +16 -3
- 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 +42 -11
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +4 -1
- 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 +2 -3
- 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/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/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 +4 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/messageTypes.d.ts +4 -1
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js +3 -0
- package/lib/messageTypes.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +3 -0
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.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/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +3 -1
- 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 +4 -1
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- 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 +1 -0
- package/lib/summary/runWhileConnectedCoordinator.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 +16 -8
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +94 -10
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +16 -0
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +2 -0
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +10 -1
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js.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 +3 -3
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +26 -58
- package/src/blobManager.ts +61 -74
- package/src/connectionTelemetry.ts +97 -52
- package/src/containerRuntime.ts +173 -93
- package/src/dataStore.ts +2 -2
- package/src/dataStoreContext.ts +16 -9
- package/src/dataStoreRegistry.ts +3 -0
- package/src/dataStores.ts +4 -16
- package/src/deltaManagerProxyBase.ts +2 -2
- package/src/error.ts +4 -1
- package/src/gc/garbageCollection.ts +18 -3
- package/src/gc/gcConfigs.ts +22 -4
- package/src/gc/gcDefinitions.ts +43 -11
- package/src/gc/gcSummaryDefinitions.ts +1 -1
- package/src/gc/gcTelemetry.ts +8 -8
- package/src/gc/index.ts +0 -4
- package/src/id-compressor/utilities.ts +3 -0
- package/src/index.ts +14 -1
- package/src/messageTypes.ts +4 -1
- package/src/opLifecycle/README.md +53 -28
- package/src/opLifecycle/definitions.ts +3 -0
- package/src/opLifecycle/outbox.ts +3 -0
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +1 -0
- package/src/scheduleManager.ts +2 -0
- package/src/summary/orderedClientElection.ts +4 -1
- package/src/summary/runWhileConnectedCoordinator.ts +5 -1
- package/src/summary/summarizer.ts +21 -9
- package/src/summary/summarizerTypes.ts +95 -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
|
@@ -84,6 +84,10 @@ export function getAttributesFormatVersion(attributes: ReadFluidDataStoreAttribu
|
|
|
84
84
|
export function hasIsolatedChannels(attributes: ReadFluidDataStoreAttributes): boolean {
|
|
85
85
|
return !!attributes.summaryFormatVersion && !attributes.disableIsolatedChannels;
|
|
86
86
|
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
87
91
|
export interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGCMetadata {
|
|
88
92
|
readonly summaryFormatVersion: 1;
|
|
89
93
|
/** The last message processed at the time of summary. Only primitive property types are added to the summary. */
|
|
@@ -98,6 +102,9 @@ export interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGC
|
|
|
98
102
|
readonly idCompressorEnabled?: boolean;
|
|
99
103
|
}
|
|
100
104
|
|
|
105
|
+
/**
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
101
108
|
export interface ICreateContainerMetadata {
|
|
102
109
|
/** Runtime version of the container when it was first created */
|
|
103
110
|
createContainerRuntimeVersion?: string;
|
|
@@ -105,7 +112,10 @@ export interface ICreateContainerMetadata {
|
|
|
105
112
|
createContainerTimestamp?: number;
|
|
106
113
|
}
|
|
107
114
|
|
|
108
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* The properties of an ISequencedDocumentMessage to be stored in the metadata blob in summary.
|
|
117
|
+
* @public
|
|
118
|
+
*/
|
|
109
119
|
export type ISummaryMetadataMessage = Pick<
|
|
110
120
|
ISequencedDocumentMessage,
|
|
111
121
|
| "clientId"
|
|
@@ -47,12 +47,12 @@ export async function raceTimer<T>(
|
|
|
47
47
|
cancellationToken?: ISummaryCancellationToken,
|
|
48
48
|
): Promise<raceTimerResult<T>> {
|
|
49
49
|
const promises: Promise<raceTimerResult<T>>[] = [
|
|
50
|
-
promise.then((value) => ({ result: "done", value } as const)
|
|
51
|
-
timer.then(({ timerResult: result }) => ({ result } as const)
|
|
50
|
+
promise.then((value) => ({ result: "done", value }) as const),
|
|
51
|
+
timer.then(({ timerResult: result }) => ({ result }) as const),
|
|
52
52
|
];
|
|
53
53
|
if (cancellationToken !== undefined) {
|
|
54
54
|
promises.push(
|
|
55
|
-
cancellationToken.waitCancelled.then(() => ({ result: "cancelled" } as const)
|
|
55
|
+
cancellationToken.waitCancelled.then(() => ({ result: "cancelled" }) as const),
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
return Promise.race(promises);
|
|
@@ -114,7 +114,7 @@ export class SummaryManager extends TypedEventEmitter<ISummarizerEvents> impleme
|
|
|
114
114
|
parentLogger: ITelemetryBaseLogger,
|
|
115
115
|
/** Creates summarizer by asking interactive container to spawn summarizing container and
|
|
116
116
|
* get back its Summarizer instance. */
|
|
117
|
-
private readonly
|
|
117
|
+
private readonly createSummarizerFn: () => Promise<ISummarizer>,
|
|
118
118
|
private readonly startThrottler: IThrottler,
|
|
119
119
|
{
|
|
120
120
|
initialDelayMs = defaultInitialDelayMs,
|
|
@@ -264,7 +264,7 @@ export class SummaryManager extends TypedEventEmitter<ISummarizerEvents> impleme
|
|
|
264
264
|
);
|
|
265
265
|
this.state = SummaryManagerState.Running;
|
|
266
266
|
|
|
267
|
-
const summarizer = await this.
|
|
267
|
+
const summarizer = await this.createSummarizerFn();
|
|
268
268
|
this.summarizer = summarizer;
|
|
269
269
|
this.summarizer.on("summarize", this.handleSummarizeEvent);
|
|
270
270
|
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
# Garbage Collection: Advanced configuration for early adopters
|
|
2
|
-
|
|
3
|
-
_For a technical overview of Garbage Collection, start with [GarbageCollection.md](./garbageCollection.md)_
|
|
4
|
-
|
|
5
|
-
GC Sweep is not yet enabled by default, and until that time early adopters have several configuration options available
|
|
6
|
-
for how to enable GC and monitor for any GC-impacting bugs that would need to be mitigated.
|
|
7
|
-
|
|
8
|
-
Please refer to the section [Techniques Used for Configuration](./garbageCollection.md#techniques-used-for-configuration)
|
|
9
|
-
before continuing, to ensure you're familiar with using "GC Options" and "Config Settings" for configuring GC.
|
|
10
|
-
|
|
11
|
-
## What's on by default
|
|
12
|
-
|
|
13
|
-
GC Mark Phase is enabled by default, which includes marking objects that are ready to be deleted as Tombstones.
|
|
14
|
-
FF will log an informational event if/when a Tombstoned object is loaded - a scenario that would represent data loss if Sweep were enabled.
|
|
15
|
-
The eventName for the Tombstone log ends with `GC_Tombstone_DataStore_Requested`.
|
|
16
|
-
|
|
17
|
-
There's a similar event logged long before an object is Tombstoned. Ater only 7 days (configurable), an unreferenced object is considered
|
|
18
|
-
"Inactive", and FF will log if an Inactive object is loaded as well.
|
|
19
|
-
The eventName for the Inactive log ends with `InactiveObject_Loaded`.
|
|
20
|
-
|
|
21
|
-
## Getting earlier signals: Shortening the InactiveObject timeout
|
|
22
|
-
|
|
23
|
-
The default timeout for an unreferenced object to become "Inactive" is 7 days. This is intended to be long enough such that
|
|
24
|
-
it's very unlikely to hit a legitimate case where an object is revived within the same session it was deleted (e.g. delete then undo).
|
|
25
|
-
Based on your application's user experience, you may choose to shorten this timeout to get an earlier signal (but beware of false positives).
|
|
26
|
-
|
|
27
|
-
To override the default InactiveObject timeout, use the `inactiveTimeoutMs` GC Option.
|
|
28
|
-
There's also a Config Setting which can be used for testing (if the Config Provider allows overriding via localStorage/sessionStorage):
|
|
29
|
-
`Fluid.GarbageCollection.TestOverride.InactiveTimeoutMs`
|
|
30
|
-
|
|
31
|
-
## Enabling Tombstone Enforcement
|
|
32
|
-
|
|
33
|
-
By default, GC is marking objects as Tombstoned, but merely logging if they're used after that point.
|
|
34
|
-
You can enable enforcement of Tombstone objects to simulate real Sweep while having the peace of mind
|
|
35
|
-
that the data is not yet deleted from the user's file, and can be recovered.
|
|
36
|
-
|
|
37
|
-
The first step is to prevent the Fluid Framework from loading a Tombstoned object (via `handle.get()` as described previously),
|
|
38
|
-
by using this Config Setting:
|
|
39
|
-
|
|
40
|
-
```ts
|
|
41
|
-
"Fluid.GarbageCollection.ThrowOnTombstoneLoad": true
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Now, even with `Fluid.GarbageCollection.ThrowOnTombstoneLoad` set to true, changes to a Tombstoned object will be allowed.
|
|
45
|
-
This is required for the advanced recovery options to work, explained [below](#advanced-back-door-recovering-and-reviving-tombstoned-objects).
|
|
46
|
-
|
|
47
|
-
To instruct FF to treat Tombstoned objects as if they are truly not present in the document, use this Config Setting:
|
|
48
|
-
|
|
49
|
-
```ts
|
|
50
|
-
"Fluid.GarbageCollection.ThrowOnTombstoneUsage": true
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### In case of emergency: Bumping the gcTombstoneGeneration
|
|
54
|
-
|
|
55
|
-
GC includes a mechanism for Tombstone by which all new documents may be stamped with a "Generation" number,
|
|
56
|
-
and if set then Tombstone is only enforceable for documents of the latest Generation. This number is specified
|
|
57
|
-
via the `gcTombstoneGeneration` GC Option, and will not change over the lifetime of a given document.
|
|
58
|
-
|
|
59
|
-
In case a bug is released that is found to cause GC errors, a bump to the gcTombstoneGeneration can be incuded
|
|
60
|
-
with the fix, which will prevent any user pain for those potentially affected documents that were exposed to the bug.
|
|
61
|
-
|
|
62
|
-
If gcTombstoneGeneration is unset, Tombstone enforcement will be enabled/disabled as otherwise configured.
|
|
63
|
-
In other words, until you start using this, Tombstone enforcement will apply to all documents.
|
|
64
|
-
|
|
65
|
-
### Advanced "Back door": Recovering and reviving Tombstoned objects
|
|
66
|
-
|
|
67
|
-
If your application has Tombstone enabled and your users are encountering Tombstones - even at the point where
|
|
68
|
-
Tombstone enforcement is enabled - there is a way to still access these objects to recover them and property
|
|
69
|
-
reference them ("revival"). However, please understand that this is an advanced and unsupported path that may
|
|
70
|
-
be immediately deprecated at any time.
|
|
71
|
-
|
|
72
|
-
As mentioned above, bumping the gcTombstoneGeneration will free up impacted documents, but that's a permanent
|
|
73
|
-
mitigation - those documents will never be exposed to GC Tombstone or Sweep.
|
|
74
|
-
|
|
75
|
-
If there's a particular codepath in your application where objects being loaded may be Tombstoned,
|
|
76
|
-
you may use this advanced "back door" to recover them and then properly reference them, thus restoring the document.
|
|
77
|
-
For this to work, you must disable the `Fluid.GarbageCollection.ThrowOnTombstoneUsage` Config Setting.
|
|
78
|
-
|
|
79
|
-
When a Tombstoned object (via `handle.get()`) fails to load, the 404 response error object has an `underlyingResponseHeaders` with the
|
|
80
|
-
`isTombstoned` flag set to true: i.e. `error.underlyingResponseHeaders?.isTombstoned === true`. In this case,
|
|
81
|
-
you may turn around and use `IContainerRuntimeWithResolveHandle_Deprecated.resolveHandle` with `allowTombstone: true` in `IRequest.headers` to request
|
|
82
|
-
the object again - this time it will succeed.
|
|
83
|
-
|
|
84
|
-
To be very clear once again - This path uses deprecated APIs (`resolveHandle`) and comes with no guarantees of support.
|
|
85
|
-
|
|
86
|
-
### Tombstones and the Summarizer Client
|
|
87
|
-
|
|
88
|
-
Note: The Summarizer client will _never_ throw on usage or load of a Tombstoned object.
|
|
89
|
-
|
|
90
|
-
## Enabling Sweep
|
|
91
|
-
|
|
92
|
-
To enable Sweep for the first time, set this GC Option:
|
|
93
|
-
|
|
94
|
-
```ts
|
|
95
|
-
gcSweepGeneration: 0;
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
This will enable sweep for all documents moving forward _as well as_ any documents created with `gcTombstoneGeneration: 0`
|
|
99
|
-
(this is a special case in the code).
|
|
100
|
-
|
|
101
|
-
### A caveat...
|
|
102
|
-
|
|
103
|
-
If you used `gcTombstoneGeneration` **and ever bumped it**, you should skip 0 here to avoid enabling Sweep for old / at-risk documents:
|
|
104
|
-
|
|
105
|
-
```ts
|
|
106
|
-
gcSweepGeneration: 1;
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Remember, you can always bump `gcSweepGeneration` to disable Sweep for all existing documents and start fresh,
|
|
110
|
-
in case a major bug is discovered and fixed.
|
|
111
|
-
|
|
112
|
-
### More about gcSweepGeneration and gcTombstoneGeneration
|
|
113
|
-
|
|
114
|
-
`gcSweepGeneration` is persisted and immutable in the document, just like `gcTombstoneGeneration`.
|
|
115
|
-
However, behavior differs in a few important ways.
|
|
116
|
-
|
|
117
|
-
For Tombstone, if `gcTombstoneGeneration` is not set, Tombstone enforcement will be **enabled**.
|
|
118
|
-
For Sweep however, if `gcSweepGeneration` is not set, Sweep enforcement will be **disabled**.
|
|
119
|
-
|
|
120
|
-
This means that until the `gcSweepGeneration` GC Option is set, _no existing document will be eligible for Sweep, ever_.
|
|
121
|
-
So all documents created since the most recent bump to the gcSweepGeneration will have Sweep enabled.
|
|
122
|
-
Note that if `gcSweepGeneration` is set and matches, Tombstone Mode is off for the session and `gcTombstoneGeneration` is ignored.
|
|
123
|
-
|
|
124
|
-
And as mentioned above, there is a special case when `gcSweepGeneration === 0`: Any document with `gcTombstoneGeneration: 0` will
|
|
125
|
-
be eligible for Sweep as well. This was done for historical reasons due to circumstances during GC's development.
|
|
126
|
-
|
|
127
|
-
## More Advanced Configurations
|
|
128
|
-
|
|
129
|
-
There are a handful of other configuration options/settings that can be used to tweak GC's behavior,
|
|
130
|
-
mostly for testing. Please refer to the function [`generateGCConfigs` in gcConfigs.ts](./gcConfigs.ts) and the
|
|
131
|
-
[setting/option names listed in gcDefinitions.ts](./gcDefinitions.ts) for the full story.
|
|
132
|
-
|
|
133
|
-
Examples of available advanced configuration include:
|
|
134
|
-
|
|
135
|
-
- Disabling GC permanently for new files
|
|
136
|
-
- Overriding GC Mark/Sweep enablement for this session:
|
|
137
|
-
- Disabling running GC Mark and/or Sweep phases for this session
|
|
138
|
-
- Forcing GC Mark and/or Sweep to run for this session even if otherwise it would be disabled
|
|
139
|
-
- Disabling Tombstone Mode (don't even mark objects as Tombstones)
|
|
140
|
-
- Disabling the deletion of either DataStores or AttachmentBlobs independent of one another (when Sweep is enabled)
|
|
141
|
-
- Overriding the default Session Expiry for new files (or disabling it altogether, which will also disable Tombstone/Sweep)
|
|
142
|
-
- Overriding the Sweep Timeout, _independent of Session Expiry_, so use with care (for testing purposes only - data loss could occur)
|
|
143
|
-
- Running in "Test Mode", where objects are deleted as soon as they're unreferenced
|
|
144
|
-
- Force "Full GC" to run, which ignores incremental optimizations based on previously computed GC Data
|
|
145
|
-
- Treat InactiveObjects like Tombstones: throw an error on load (with the same back door to follow-up with a successful request)
|