@fluidframework/container-runtime 2.0.0-internal.7.1.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 +4 -0
- package/api-extractor.json +1 -13
- package/api-report/container-runtime.api.md +75 -10
- 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/containerRuntime.d.ts +71 -23
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +72 -32
- 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/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 +40 -9
- 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 +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -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/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.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 +1 -0
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +1 -0
- 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 +1 -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/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/containerRuntime.d.ts +71 -23
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +73 -33
- 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/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 +40 -9
- 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 +3 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- 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/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.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 +1 -0
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +1 -0
- 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 +1 -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/package.json +25 -22
- package/src/blobManager.ts +61 -74
- package/src/containerRuntime.ts +103 -50
- 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/gc/garbageCollection.ts +18 -3
- package/src/gc/gcConfigs.ts +22 -4
- package/src/gc/gcDefinitions.ts +41 -9
- 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 +13 -1
- package/src/messageTypes.ts +4 -1
- package/src/opLifecycle/definitions.ts +3 -0
- package/src/packageVersion.ts +1 -1
- package/src/summary/orderedClientElection.ts +4 -1
- package/src/summary/runWhileConnectedCoordinator.ts +5 -1
- package/src/summary/summarizer.ts +1 -0
- package/src/summary/summarizerTypes.ts +95 -11
- package/src/summary/summaryCollection.ts +18 -1
- package/src/summary/summaryFormat.ts +11 -1
- package/dist/container-runtime-alpha.d.ts +0 -1554
- package/dist/container-runtime-beta.d.ts +0 -1554
- package/dist/container-runtime-public.d.ts +0 -1554
- package/dist/container-runtime.d.ts +0 -1611
- package/src/gc/gcEarlyAdoption.md +0 -145
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
|
@@ -20,6 +20,9 @@ import {
|
|
|
20
20
|
IRefreshSummaryResult,
|
|
21
21
|
} from "../summary";
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
23
26
|
export type GCVersion = number;
|
|
24
27
|
|
|
25
28
|
/** The stable/default version of GC Data */
|
|
@@ -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,6 +180,10 @@ export const GCNodeType = {
|
|
|
165
180
|
// Nodes that are neither of the above. For example, root node.
|
|
166
181
|
Other: "Other",
|
|
167
182
|
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @public
|
|
186
|
+
*/
|
|
168
187
|
export type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];
|
|
169
188
|
|
|
170
189
|
/**
|
|
@@ -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.
|
|
@@ -332,8 +358,6 @@ export interface IGarbageCollectorConfigs {
|
|
|
332
358
|
readonly sweepTimeoutMs: number | undefined;
|
|
333
359
|
/** The time after which an unreferenced node is inactive. */
|
|
334
360
|
readonly inactiveTimeoutMs: number;
|
|
335
|
-
/** It is easier for users to diagnose InactiveObject usage if we throw on load, which this option enables */
|
|
336
|
-
readonly throwOnInactiveLoad: boolean | undefined;
|
|
337
361
|
/** Tracks whether GC should run in test mode. In this mode, unreferenced objects are deleted immediately. */
|
|
338
362
|
readonly testMode: boolean;
|
|
339
363
|
/**
|
|
@@ -349,6 +373,14 @@ export interface IGarbageCollectorConfigs {
|
|
|
349
373
|
readonly gcVersionInBaseSnapshot: GCVersion | undefined;
|
|
350
374
|
/** The current version of GC data in the running code */
|
|
351
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;
|
|
352
384
|
}
|
|
353
385
|
|
|
354
386
|
/** The state of node that is unreferenced. */
|
|
@@ -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
|
@@ -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) {
|
package/src/index.ts
CHANGED
|
@@ -32,8 +32,16 @@ export {
|
|
|
32
32
|
CompatModeBehavior,
|
|
33
33
|
RecentlyAddedContainerRuntimeMessageDetails,
|
|
34
34
|
} from "./messageTypes";
|
|
35
|
+
export { IBlobManagerLoadInfo } from "./blobManager";
|
|
35
36
|
export { FluidDataStoreRegistry } from "./dataStoreRegistry";
|
|
36
|
-
export {
|
|
37
|
+
export {
|
|
38
|
+
GCNodeType,
|
|
39
|
+
IGCMetadata,
|
|
40
|
+
GCFeatureMatrix,
|
|
41
|
+
GCVersion,
|
|
42
|
+
IGCRuntimeOptions,
|
|
43
|
+
IGCStats,
|
|
44
|
+
} from "./gc";
|
|
37
45
|
export {
|
|
38
46
|
IAckedSummary,
|
|
39
47
|
ISummarizer,
|
|
@@ -49,6 +57,8 @@ export {
|
|
|
49
57
|
IBroadcastSummaryResult,
|
|
50
58
|
ICancellationToken,
|
|
51
59
|
IConnectableRuntime,
|
|
60
|
+
IContainerRuntimeMetadata,
|
|
61
|
+
ICreateContainerMetadata,
|
|
52
62
|
IEnqueueSummarizeOptions,
|
|
53
63
|
IGenerateSummaryTreeResult,
|
|
54
64
|
IGeneratedSummaryStats,
|
|
@@ -57,6 +67,7 @@ export {
|
|
|
57
67
|
IRefreshSummaryAckOptions,
|
|
58
68
|
ISubmitSummaryOpResult,
|
|
59
69
|
ISubmitSummaryOptions,
|
|
70
|
+
ISerializedElection,
|
|
60
71
|
ISummarizeOptions,
|
|
61
72
|
ISummarizerEvents,
|
|
62
73
|
ISummarizerInternalsProvider,
|
|
@@ -69,6 +80,7 @@ export {
|
|
|
69
80
|
ISummary,
|
|
70
81
|
ISummaryCollectionOpEvents,
|
|
71
82
|
ISummaryAckMessage,
|
|
83
|
+
ISummaryMetadataMessage,
|
|
72
84
|
ISummaryNackMessage,
|
|
73
85
|
ISummaryOpMessage,
|
|
74
86
|
OpActionEventListener,
|
package/src/messageTypes.ts
CHANGED
|
@@ -14,6 +14,9 @@ import {
|
|
|
14
14
|
import { IDataStoreAliasMessage } from "./dataStore";
|
|
15
15
|
import { IChunkedOp } from "./opLifecycle";
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
17
20
|
export enum ContainerMessageType {
|
|
18
21
|
// An op to be delivered to store
|
|
19
22
|
FluidDataStoreOp = "component",
|
|
@@ -210,7 +213,7 @@ export type InboundSequencedRecentlyAddedContainerRuntimeMessage = ISequencedDoc
|
|
|
210
213
|
* IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.
|
|
211
214
|
* This way stringified values can be compared.
|
|
212
215
|
*
|
|
213
|
-
* @deprecated
|
|
216
|
+
* @deprecated this is an internal type which should not be used outside of the package.
|
|
214
217
|
* Internally, it is superseded by `TypedContainerRuntimeMessage`.
|
|
215
218
|
*
|
|
216
219
|
* @internal
|
package/src/packageVersion.ts
CHANGED
|
@@ -225,7 +225,10 @@ export interface IOrderedClientElectionEvents extends IEvent {
|
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
/**
|
|
228
|
+
/**
|
|
229
|
+
* Serialized state of IOrderedClientElection.
|
|
230
|
+
* @public
|
|
231
|
+
*/
|
|
229
232
|
export interface ISerializedElection {
|
|
230
233
|
/** Sequence number at the time of the latest election. */
|
|
231
234
|
readonly electionSequenceNumber: number;
|
|
@@ -10,7 +10,10 @@ import {
|
|
|
10
10
|
ISummaryCancellationToken,
|
|
11
11
|
} from "./summarizerTypes";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Similar to AbortController, but using promise instead of events
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
14
17
|
export interface ICancellableSummarizerController extends ISummaryCancellationToken {
|
|
15
18
|
stop(reason: SummarizerStopReason): void;
|
|
16
19
|
}
|
|
@@ -18,6 +21,7 @@ export interface ICancellableSummarizerController extends ISummaryCancellationTo
|
|
|
18
21
|
/**
|
|
19
22
|
* Can be useful in testing as well as in places where caller does not use cancellation.
|
|
20
23
|
* This object implements ISummaryCancellationToken interface but cancellation is never leveraged.
|
|
24
|
+
* @public
|
|
21
25
|
*/
|
|
22
26
|
export const neverCancelledSummaryToken: ISummaryCancellationToken = {
|
|
23
27
|
cancelled: false,
|
|
@@ -69,6 +69,7 @@ export const createSummarizingWarning = (errorMessage: string, logged: boolean)
|
|
|
69
69
|
* Summarizer is responsible for coordinating when to generate and send summaries.
|
|
70
70
|
* It is the main entry point for summary work.
|
|
71
71
|
* It is created only by summarizing container (i.e. one with clientType === "summarizer")
|
|
72
|
+
* @public
|
|
72
73
|
*/
|
|
73
74
|
export class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements ISummarizer {
|
|
74
75
|
public get ISummarizer() {
|