@fluidframework/container-runtime 0.59.2001 → 0.59.3000
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/.eslintrc.js +0 -1
- package/dist/batchTracker.js +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +8 -1
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +27 -17
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.js +8 -8
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerHandleContext.js +1 -1
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +27 -17
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +152 -176
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +1 -1
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +44 -44
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +2 -2
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +8 -8
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStores.d.ts +6 -4
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +50 -37
- package/dist/dataStores.js.map +1 -1
- package/dist/garbageCollection.d.ts +23 -23
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +81 -50
- package/dist/garbageCollection.js.map +1 -1
- package/dist/opTelemetry.js +1 -1
- package/dist/opTelemetry.js.map +1 -1
- package/dist/orderedClientElection.d.ts.map +1 -1
- package/dist/orderedClientElection.js +2 -2
- package/dist/orderedClientElection.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.js +17 -17
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/runWhileConnectedCoordinator.js +1 -1
- package/dist/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/runningSummarizer.d.ts.map +1 -1
- package/dist/runningSummarizer.js +7 -6
- package/dist/runningSummarizer.js.map +1 -1
- package/dist/summarizer.d.ts.map +1 -1
- package/dist/summarizer.js +4 -3
- package/dist/summarizer.js.map +1 -1
- package/dist/summarizerClientElection.js.map +1 -1
- package/dist/summarizerHeuristics.d.ts +1 -1
- package/dist/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summarizerHeuristics.js +1 -1
- package/dist/summarizerHeuristics.js.map +1 -1
- package/dist/summarizerTypes.d.ts +4 -2
- package/dist/summarizerTypes.d.ts.map +1 -1
- package/dist/summarizerTypes.js.map +1 -1
- package/dist/summaryCollection.js +2 -2
- package/dist/summaryCollection.js.map +1 -1
- package/dist/summaryFormat.d.ts +37 -11
- package/dist/summaryFormat.d.ts.map +1 -1
- package/dist/summaryFormat.js +12 -4
- package/dist/summaryFormat.js.map +1 -1
- package/dist/summaryGenerator.d.ts.map +1 -1
- package/dist/summaryGenerator.js +6 -4
- package/dist/summaryGenerator.js.map +1 -1
- package/dist/summaryManager.js +5 -5
- package/dist/summaryManager.js.map +1 -1
- package/dist/throttler.js +2 -2
- package/dist/throttler.js.map +1 -1
- package/lib/blobManager.d.ts +8 -1
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +19 -9
- package/lib/blobManager.js.map +1 -1
- package/lib/containerRuntime.d.ts +27 -17
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +71 -95
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts +2 -2
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +2 -2
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStores.d.ts +6 -4
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +27 -14
- package/lib/dataStores.js.map +1 -1
- package/lib/garbageCollection.d.ts +23 -23
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +68 -37
- package/lib/garbageCollection.js.map +1 -1
- package/lib/opTelemetry.js.map +1 -1
- package/lib/orderedClientElection.d.ts.map +1 -1
- package/lib/orderedClientElection.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.js.map +1 -1
- package/lib/runningSummarizer.d.ts.map +1 -1
- package/lib/runningSummarizer.js +4 -3
- package/lib/runningSummarizer.js.map +1 -1
- package/lib/summarizer.d.ts.map +1 -1
- package/lib/summarizer.js +1 -0
- package/lib/summarizer.js.map +1 -1
- package/lib/summarizerClientElection.js.map +1 -1
- package/lib/summarizerHeuristics.d.ts +1 -1
- package/lib/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summarizerHeuristics.js +1 -1
- package/lib/summarizerHeuristics.js.map +1 -1
- package/lib/summarizerTypes.d.ts +4 -2
- package/lib/summarizerTypes.d.ts.map +1 -1
- package/lib/summarizerTypes.js.map +1 -1
- package/lib/summaryCollection.js.map +1 -1
- package/lib/summaryFormat.d.ts +37 -11
- package/lib/summaryFormat.d.ts.map +1 -1
- package/lib/summaryFormat.js +10 -2
- package/lib/summaryFormat.js.map +1 -1
- package/lib/summaryGenerator.d.ts.map +1 -1
- package/lib/summaryGenerator.js +2 -0
- package/lib/summaryGenerator.js.map +1 -1
- package/lib/summaryManager.js.map +1 -1
- package/lib/throttler.js.map +1 -1
- package/package.json +26 -20
- package/src/blobManager.ts +23 -11
- package/src/containerRuntime.ts +111 -139
- package/src/dataStoreContext.ts +8 -11
- package/src/dataStoreContexts.ts +5 -5
- package/src/dataStores.ts +35 -17
- package/src/garbageCollection.ts +100 -57
- package/src/orderedClientElection.ts +5 -10
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +2 -2
- package/src/runningSummarizer.ts +8 -9
- package/src/summarizer.ts +2 -2
- package/src/summarizerHeuristics.ts +1 -1
- package/src/summarizerTypes.ts +8 -6
- package/src/summaryFormat.ts +38 -11
- package/src/summaryGenerator.ts +7 -5
- package/src/summaryManager.ts +2 -2
- package/src/throttler.ts +1 -1
|
@@ -34,25 +34,31 @@ export interface ContainerRuntimeMessage {
|
|
|
34
34
|
type: ContainerMessageType;
|
|
35
35
|
}
|
|
36
36
|
export interface IGCRuntimeOptions {
|
|
37
|
-
disableGC?: boolean;
|
|
38
37
|
/**
|
|
39
|
-
* Flag
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
38
|
+
* Flag that if true, will enable running garbage collection (GC) in a container. GC has mark phase and sweep phase.
|
|
39
|
+
* In mark phase, unreferenced objects are identified and marked as such in the summary. This option enables the
|
|
40
|
+
* mark phase.
|
|
41
|
+
* In sweep phase, unreferenced objects are eventually deleted from the container if they meet certain conditions.
|
|
42
|
+
* Sweep phase can be enabled via the "sweepAllowed" option.
|
|
43
|
+
* Note: This setting becomes part of the container's summary and cannot be changed.
|
|
44
44
|
*/
|
|
45
45
|
gcAllowed?: boolean;
|
|
46
46
|
/**
|
|
47
|
-
* Flag that
|
|
48
|
-
*
|
|
47
|
+
* Flag that if true, enables GC's sweep phase which will eventually delete unreferenced objects from the container.
|
|
48
|
+
* This flag should only be set to true if "gcAllowed" is true.
|
|
49
|
+
* Note: This setting becomes part of the container's summary and cannot be changed.
|
|
49
50
|
*/
|
|
50
|
-
|
|
51
|
+
sweepAllowed?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Flag that will disable garbage collection if set to true. Can be used to disable running GC on container where
|
|
54
|
+
* is allowed via the gcAllowed option.
|
|
55
|
+
*/
|
|
56
|
+
disableGC?: boolean;
|
|
51
57
|
/**
|
|
52
|
-
* Flag that
|
|
53
|
-
*
|
|
58
|
+
* Flag that will bypass optimizations and generate GC data for all nodes irrespective of whether a node
|
|
59
|
+
* changed or not.
|
|
54
60
|
*/
|
|
55
|
-
|
|
61
|
+
runFullGC?: boolean;
|
|
56
62
|
/**
|
|
57
63
|
* Allows additional GC options to be passed.
|
|
58
64
|
*/
|
|
@@ -185,7 +191,6 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
185
191
|
private readonly containerScope;
|
|
186
192
|
readonly logger: ITelemetryLogger;
|
|
187
193
|
private readonly requestHandler?;
|
|
188
|
-
private _storage?;
|
|
189
194
|
get IContainerRuntime(): this;
|
|
190
195
|
get IFluidRouter(): this;
|
|
191
196
|
/**
|
|
@@ -263,7 +268,11 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
263
268
|
private get summarizer();
|
|
264
269
|
private get summariesDisabled();
|
|
265
270
|
private readonly createContainerMetadata;
|
|
266
|
-
|
|
271
|
+
/**
|
|
272
|
+
* The summary number of the next summary that will be generated for this container. This is incremented every time
|
|
273
|
+
* a summary is generated.
|
|
274
|
+
*/
|
|
275
|
+
private nextSummaryNumber;
|
|
267
276
|
private readonly opTracker;
|
|
268
277
|
private constructor();
|
|
269
278
|
dispose(error?: Error): void;
|
|
@@ -279,7 +288,8 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
279
288
|
*/
|
|
280
289
|
resolveHandle(request: IRequest): Promise<IResponse>;
|
|
281
290
|
private getDataStoreFromRequest;
|
|
282
|
-
|
|
291
|
+
/** Adds the container's metadata to the given summary tree. */
|
|
292
|
+
private addMetadataToSummary;
|
|
283
293
|
private addContainerStateToSummary;
|
|
284
294
|
private shouldContinueReconnecting;
|
|
285
295
|
private resetReconnectCount;
|
|
@@ -411,8 +421,8 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
411
421
|
*/
|
|
412
422
|
getCurrentReferenceTimestampMs(): number | undefined;
|
|
413
423
|
/**
|
|
414
|
-
* Returns the type of the GC node. Currently, there are nodes that belong to
|
|
415
|
-
*
|
|
424
|
+
* Returns the type of the GC node. Currently, there are nodes that belong to the root ("/"), data stores or
|
|
425
|
+
* blob manager.
|
|
416
426
|
*/
|
|
417
427
|
getNodeType(nodePath: string): GCNodeType;
|
|
418
428
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerRuntime.d.ts","sourceRoot":"","sources":["../src/containerRuntime.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAgD,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACpH,OAAO,EACH,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,SAAS,EACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EAEb,QAAQ,EACR,uBAAuB,EACvB,WAAW,EACX,cAAc,EAEjB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,iBAAiB,EACjB,uBAAuB,EAC1B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAGH,iBAAiB,EAGpB,MAAM,8BAA8B,CAAC;AAWtC,OAAO,EAAgB,uBAAuB,EAAmB,MAAM,oCAAoC,CAAC;AAQ5G,OAAO,EACH,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EAErB,YAAY,EACZ,WAAW,EAEd,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,SAAS,EAET,8BAA8B,EAC9B,uBAAuB,EAEvB,sBAAsB,EAKtB,kCAAkC,EAClC,qBAAqB,EAMrB,UAAU,EACb,MAAM,qCAAqC,CAAC;AAsB7C,OAAO,EAAE,kBAAkB,EAAuB,MAAM,uBAAuB,CAAC;AAmBhF,OAAO,EACH,mBAAmB,EAGnB,qBAAqB,EACrB,WAAW,EACX,4BAA4B,EAC5B,kBAA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AO,CAAC,QAAQ;IAWhB,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,wBAAwB;IAYzB,iBAAiB,CACpB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,GAAG,EACb,eAAe,GAAE,OAAmB,GAAG,IAAI;IAQxC,sBAAsB,CAAC,QAAQ,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;IAS/D,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IAKtF,OAAO,CAAC,MAAM;IA8Dd,OAAO,CAAC,0BAA0B;IA0ClC,OAAO,CAAC,oBAAoB;IAqB5B,OAAO,CAAC,mBAAmB;IAoB3B,OAAO,CAAC,oBAAoB;IAgB5B;;;OAGG;IACH,OAAO,CAAC,eAAe;IAMvB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;IA6BhB,6EAA6E;IAChE,uBAAuB,CAChC,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,gBAAgB;IAoBnC;;;;;OAKG;YACW,iCAAiC;YAuBjC,wBAAwB;IAwB/B,oBAAoB;IAI3B,SAAgB,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAajE;IAEF,SAAgB,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAa/D;IAEF;;;SAGK;IACL,OAAO,CAAC,uBAAuB;CAyBlC"}
|
package/lib/containerRuntime.js
CHANGED
|
@@ -2,7 +2,7 @@ import { AttachState, LoaderHeader, } from "@fluidframework/container-definition
|
|
|
2
2
|
import { assert, Trace, TypedEventEmitter, unreachableCase, performance, } from "@fluidframework/common-utils";
|
|
3
3
|
import { ChildLogger, raiseConnectedEvent, PerformanceEvent, normalizeError, TaggedLoggerAdapter, loggerToMonitoringContext, TelemetryDataTag, } from "@fluidframework/telemetry-utils";
|
|
4
4
|
import { DriverHeader } from "@fluidframework/driver-definitions";
|
|
5
|
-
import { readAndParse
|
|
5
|
+
import { readAndParse } from "@fluidframework/driver-utils";
|
|
6
6
|
import { DataCorruptionError, GenericError, UsageError, extractSafePropertiesFromMessage, } from "@fluidframework/container-utils";
|
|
7
7
|
import { MessageType, SummaryType, } from "@fluidframework/protocol-definitions";
|
|
8
8
|
import { FlushMode, channelsTreeName, } from "@fluidframework/runtime-definitions";
|
|
@@ -372,8 +372,8 @@ export function getDeviceSpec() {
|
|
|
372
372
|
* It will define the store level mappings.
|
|
373
373
|
*/
|
|
374
374
|
export class ContainerRuntime extends TypedEventEmitter {
|
|
375
|
-
constructor(context, registry, metadata, electedSummarizerData, chunks, dataStoreAliasMap, runtimeOptions, containerScope, logger, existing, blobManagerSnapshot, requestHandler
|
|
376
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
375
|
+
constructor(context, registry, metadata, electedSummarizerData, chunks, dataStoreAliasMap, runtimeOptions, containerScope, logger, existing, blobManagerSnapshot, requestHandler) {
|
|
376
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
377
377
|
super();
|
|
378
378
|
this.context = context;
|
|
379
379
|
this.registry = registry;
|
|
@@ -381,7 +381,6 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
381
381
|
this.containerScope = containerScope;
|
|
382
382
|
this.logger = logger;
|
|
383
383
|
this.requestHandler = requestHandler;
|
|
384
|
-
this._storage = _storage;
|
|
385
384
|
this.defaultMaxConsecutiveReconnects = 15;
|
|
386
385
|
this._orderSequentiallyCalls = 0;
|
|
387
386
|
this.needsFlush = false;
|
|
@@ -440,21 +439,6 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
440
439
|
}
|
|
441
440
|
};
|
|
442
441
|
this.messageAtLastSummary = metadata === null || metadata === void 0 ? void 0 : metadata.message;
|
|
443
|
-
// If this is an existing container, we get values from metadata.
|
|
444
|
-
// otherwise, we initialize them.
|
|
445
|
-
if (existing) {
|
|
446
|
-
this.createContainerMetadata = {
|
|
447
|
-
createContainerRuntimeVersion: metadata === null || metadata === void 0 ? void 0 : metadata.createContainerRuntimeVersion,
|
|
448
|
-
createContainerTimestamp: metadata === null || metadata === void 0 ? void 0 : metadata.createContainerTimestamp,
|
|
449
|
-
};
|
|
450
|
-
this.summaryCount = metadata === null || metadata === void 0 ? void 0 : metadata.summaryCount;
|
|
451
|
-
}
|
|
452
|
-
else {
|
|
453
|
-
this.createContainerMetadata = {
|
|
454
|
-
createContainerRuntimeVersion: pkgVersion,
|
|
455
|
-
createContainerTimestamp: Date.now(),
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
442
|
// Default to false (enabled).
|
|
459
443
|
this.disableIsolatedChannels = (_a = this.runtimeOptions.summaryOptions.disableIsolatedChannels) !== null && _a !== void 0 ? _a : false;
|
|
460
444
|
this._connected = this.context.connected;
|
|
@@ -465,7 +449,8 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
465
449
|
((_b = this.mc.config.getBoolean(useDataStoreAliasingKey)) !== null && _b !== void 0 ? _b : false) ||
|
|
466
450
|
((_c = runtimeOptions.useDataStoreAliasing) !== null && _c !== void 0 ? _c : false);
|
|
467
451
|
this._maxOpSizeInBytes = ((_d = this.mc.config.getNumber(maxOpSizeInBytesKey)) !== null && _d !== void 0 ? _d : defaultMaxOpSizeInBytes);
|
|
468
|
-
this.maxConsecutiveReconnects =
|
|
452
|
+
this.maxConsecutiveReconnects =
|
|
453
|
+
(_e = this.mc.config.getNumber(maxConsecutiveReconnectsKey)) !== null && _e !== void 0 ? _e : this.defaultMaxConsecutiveReconnects;
|
|
469
454
|
this._flushMode = runtimeOptions.flushMode;
|
|
470
455
|
this.garbageCollector = GarbageCollector.create(this, this.runtimeOptions.gcOptions, (nodePath) => this.getGCNodePackagePath(nodePath), () => { var _a; return (_a = this.messageAtLastSummary) === null || _a === void 0 ? void 0 : _a.timestamp; }, context.baseSnapshot, async (id) => readAndParse(this.storage, id), this.mc.logger, existing, metadata);
|
|
471
456
|
const loadedFromSequenceNumber = this.deltaManager.initialSequenceNumber;
|
|
@@ -489,7 +474,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
489
474
|
this.summarizerNode.loadBaseSummaryWithoutDifferential(this.context.baseSnapshot);
|
|
490
475
|
}
|
|
491
476
|
this.dataStores = new DataStores(getSummaryForDatastores(context.baseSnapshot, metadata), this, (attachMsg) => this.submit(ContainerMessageType.Attach, attachMsg), (id, createParam) => (summarizeInternal, getGCDataFn, getBaseGCDetailsFn) => this.summarizerNode.createChild(summarizeInternal, id, createParam, undefined, getGCDataFn, getBaseGCDetailsFn), (id) => this.summarizerNode.deleteChild(id), this.mc.logger, async () => this.garbageCollector.getBaseGCDetails(), (path, timestampMs, packagePath) => this.garbageCollector.nodeUpdated(path, "Changed", timestampMs, packagePath), new Map(dataStoreAliasMap), this.garbageCollector.writeDataAtRoot);
|
|
492
|
-
this.blobManager = new BlobManager(this.handleContext, blobManagerSnapshot, () => this.storage, (blobId) => this.submit(ContainerMessageType.BlobAttach, undefined, undefined, { blobId }), this, this.logger);
|
|
477
|
+
this.blobManager = new BlobManager(this.handleContext, blobManagerSnapshot, () => this.storage, (blobId) => this.submit(ContainerMessageType.BlobAttach, undefined, undefined, { blobId }), (blobPath) => this.garbageCollector.nodeUpdated(blobPath, "Loaded"), this, this.logger);
|
|
493
478
|
this.scheduleManager = new ScheduleManager(context.deltaManager, this, ChildLogger.create(this.logger, "ScheduleManager"));
|
|
494
479
|
this.deltaSender = this.deltaManager;
|
|
495
480
|
this.pendingStateManager = new PendingStateManager(this, async (type, content) => this.applyStashedOp(type, content), this._flushMode, context.pendingLocalState);
|
|
@@ -572,8 +557,27 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
572
557
|
}
|
|
573
558
|
// logging hardware telemetry
|
|
574
559
|
logger.sendTelemetryEvent(Object.assign({ eventName: "DeviceSpec" }, getDeviceSpec()));
|
|
575
|
-
|
|
576
|
-
|
|
560
|
+
let loadSummaryNumber;
|
|
561
|
+
// Get the container creation metadata. For new container, we initialize these. For existing containers,
|
|
562
|
+
// get the values from the metadata blob.
|
|
563
|
+
if (existing) {
|
|
564
|
+
this.createContainerMetadata = {
|
|
565
|
+
createContainerRuntimeVersion: metadata === null || metadata === void 0 ? void 0 : metadata.createContainerRuntimeVersion,
|
|
566
|
+
createContainerTimestamp: metadata === null || metadata === void 0 ? void 0 : metadata.createContainerTimestamp,
|
|
567
|
+
};
|
|
568
|
+
// back-compat 0.59.3000 - Older document may either write summaryCount or not write it at all. If it does
|
|
569
|
+
// not write it, initialize summaryNumber to 0.
|
|
570
|
+
loadSummaryNumber = (_l = (_k = metadata === null || metadata === void 0 ? void 0 : metadata.summaryNumber) !== null && _k !== void 0 ? _k : metadata === null || metadata === void 0 ? void 0 : metadata.summaryCount) !== null && _l !== void 0 ? _l : 0;
|
|
571
|
+
}
|
|
572
|
+
else {
|
|
573
|
+
this.createContainerMetadata = {
|
|
574
|
+
createContainerRuntimeVersion: pkgVersion,
|
|
575
|
+
createContainerTimestamp: Date.now(),
|
|
576
|
+
};
|
|
577
|
+
loadSummaryNumber = 0;
|
|
578
|
+
}
|
|
579
|
+
this.nextSummaryNumber = loadSummaryNumber + 1;
|
|
580
|
+
this.logger.sendTelemetryEvent(Object.assign(Object.assign(Object.assign({ eventName: "ContainerLoadStats" }, this.createContainerMetadata), this.dataStores.containerLoadStats), { summaryNumber: loadSummaryNumber, summaryFormatVersion: metadata === null || metadata === void 0 ? void 0 : metadata.summaryFormatVersion, disableIsolatedChannels: metadata === null || metadata === void 0 ? void 0 : metadata.disableIsolatedChannels, gcVersion: metadata === null || metadata === void 0 ? void 0 : metadata.gcFeature }));
|
|
577
581
|
ReportOpPerfTelemetry(this.context.clientId, this.deltaManager, this.logger);
|
|
578
582
|
BindBatchTracker(this, this.logger);
|
|
579
583
|
this.opTracker = new OpTracker(this.deltaManager, this.mc.config.getBoolean(disableOpTrackingKey) === true);
|
|
@@ -600,28 +604,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
600
604
|
},
|
|
601
605
|
});
|
|
602
606
|
const { summaryOptions = {}, gcOptions = {}, loadSequenceNumberVerification = "close", useDataStoreAliasing = false, flushMode = defaultFlushMode, } = runtimeOptions;
|
|
603
|
-
|
|
604
|
-
// then there are no .channel layers, we pack at level 1, otherwise we pack at level 2
|
|
605
|
-
const packingLevel = summaryOptions.disableIsolatedChannels ? 1 : 2;
|
|
606
|
-
let storage = context.storage;
|
|
607
|
-
if (context.baseSnapshot) {
|
|
608
|
-
// This will patch snapshot in place!
|
|
609
|
-
// If storage is provided, it will wrap storage with BlobAggregationStorage that can
|
|
610
|
-
// pack & unpack aggregated blobs.
|
|
611
|
-
// Note that if storage is provided later by loader layer, we will wrap storage in this.storage getter.
|
|
612
|
-
// BlobAggregationStorage is smart enough for double-wrapping to be no-op
|
|
613
|
-
if (context.attachState === AttachState.Attached) {
|
|
614
|
-
// IContainerContext storage api return type still has undefined in 0.39 package version.
|
|
615
|
-
// So once we release 0.40 container-defn package we can remove this check.
|
|
616
|
-
assert(context.storage !== undefined, 0x1f4 /* "Attached state should have storage" */);
|
|
617
|
-
const aggrStorage = BlobAggregationStorage.wrap(context.storage, logger, undefined /* allowPacking */, packingLevel);
|
|
618
|
-
await aggrStorage.unpackSnapshot(context.baseSnapshot);
|
|
619
|
-
storage = aggrStorage;
|
|
620
|
-
}
|
|
621
|
-
else {
|
|
622
|
-
await BlobAggregationStorage.unpackSnapshot(context.baseSnapshot);
|
|
623
|
-
}
|
|
624
|
-
}
|
|
607
|
+
const storage = context.storage;
|
|
625
608
|
const registry = new FluidDataStoreRegistry(registryEntries);
|
|
626
609
|
const tryFetchBlob = async (blobName) => {
|
|
627
610
|
var _a;
|
|
@@ -671,7 +654,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
671
654
|
loadSequenceNumberVerification,
|
|
672
655
|
useDataStoreAliasing,
|
|
673
656
|
flushMode,
|
|
674
|
-
}, containerScope, logger, loadExisting, blobManagerSnapshot, requestHandler
|
|
657
|
+
}, containerScope, logger, loadExisting, blobManagerSnapshot, requestHandler);
|
|
675
658
|
return runtime;
|
|
676
659
|
}
|
|
677
660
|
get options() {
|
|
@@ -687,20 +670,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
687
670
|
return this.context.deltaManager;
|
|
688
671
|
}
|
|
689
672
|
get storage() {
|
|
690
|
-
|
|
691
|
-
// All callers should be fixed, as this API is called in detached state of container when we have
|
|
692
|
-
// no storage and it's passed down the stack without right typing.
|
|
693
|
-
// back-compat 0.40 NoStorageInDetachedMode. Also, IContainerContext storage api return type still
|
|
694
|
-
// has undefined in 0.39 package version.
|
|
695
|
-
// So once we release 0.40 container-defn package we can remove this check.
|
|
696
|
-
if (!this._storage && this.context.storage) {
|
|
697
|
-
// Note: BlobAggregationStorage is smart enough for double-wrapping to be no-op
|
|
698
|
-
// If isolated channels are disabled, then there are no .channel layers, we pack at level 1,
|
|
699
|
-
// otherwise we pack at level 2
|
|
700
|
-
this._storage = BlobAggregationStorage.wrap(this.context.storage, this.logger, undefined /* allowPacking */, this.disableIsolatedChannels ? 1 : 2);
|
|
701
|
-
}
|
|
702
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
703
|
-
return this._storage;
|
|
673
|
+
return this.context.storage;
|
|
704
674
|
}
|
|
705
675
|
get reSubmitFn() {
|
|
706
676
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
@@ -769,7 +739,8 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
769
739
|
this.removeAllListeners();
|
|
770
740
|
}
|
|
771
741
|
get IFluidTokenProvider() {
|
|
772
|
-
|
|
742
|
+
var _a;
|
|
743
|
+
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.intelligence) {
|
|
773
744
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
774
745
|
return {
|
|
775
746
|
intelligence: this.options.intelligence,
|
|
@@ -845,7 +816,8 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
845
816
|
async getDataStoreFromRequest(id, request) {
|
|
846
817
|
var _a, _b, _c;
|
|
847
818
|
const wait = typeof ((_a = request.headers) === null || _a === void 0 ? void 0 : _a[RuntimeHeaders.wait]) === "boolean"
|
|
848
|
-
? (_b = request.headers) === null || _b === void 0 ? void 0 : _b[RuntimeHeaders.wait]
|
|
819
|
+
? (_b = request.headers) === null || _b === void 0 ? void 0 : _b[RuntimeHeaders.wait]
|
|
820
|
+
: true;
|
|
849
821
|
const dataStoreContext = await this.dataStores.getDataStore(id, wait);
|
|
850
822
|
/**
|
|
851
823
|
* If GC should run and this an external app request with "externalRequest" header, we need to return
|
|
@@ -867,16 +839,22 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
867
839
|
this.garbageCollector.nodeUpdated(`/${id}`, "Loaded", undefined /* timestampMs */, dataStoreContext.packagePath, request === null || request === void 0 ? void 0 : request.headers);
|
|
868
840
|
return dataStoreChannel;
|
|
869
841
|
}
|
|
870
|
-
|
|
842
|
+
/** Adds the container's metadata to the given summary tree. */
|
|
843
|
+
addMetadataToSummary(summaryTree) {
|
|
871
844
|
var _a;
|
|
872
|
-
|
|
845
|
+
const metadata = Object.assign(Object.assign(Object.assign(Object.assign({}, this.createContainerMetadata), {
|
|
846
|
+
// back-compat 0.59.3000: This is renamed to summaryNumber. Can be removed when 0.59.3000 saturates.
|
|
847
|
+
summaryCount: this.nextSummaryNumber,
|
|
848
|
+
// Increment the summary number for the next summary that will be generated.
|
|
849
|
+
summaryNumber: this.nextSummaryNumber++, summaryFormatVersion: 1, disableIsolatedChannels: this.disableIsolatedChannels || undefined }), this.garbageCollector.getMetadata()), {
|
|
873
850
|
// The last message processed at the time of summary. If there are no new messages, use the message from the
|
|
874
851
|
// last summary.
|
|
875
|
-
message: (_a = extractSummaryMetadataMessage(this.deltaManager.lastMessage)) !== null && _a !== void 0 ? _a : this.messageAtLastSummary
|
|
852
|
+
message: (_a = extractSummaryMetadataMessage(this.deltaManager.lastMessage)) !== null && _a !== void 0 ? _a : this.messageAtLastSummary });
|
|
853
|
+
addBlobToSummary(summaryTree, metadataBlobName, JSON.stringify(metadata));
|
|
876
854
|
}
|
|
877
855
|
addContainerStateToSummary(summaryTree) {
|
|
878
856
|
var _a;
|
|
879
|
-
|
|
857
|
+
this.addMetadataToSummary(summaryTree);
|
|
880
858
|
if (this.chunkMap.size > 0) {
|
|
881
859
|
const content = JSON.stringify([...this.chunkMap]);
|
|
882
860
|
addBlobToSummary(summaryTree, chunksBlobName, content);
|
|
@@ -889,11 +867,11 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
889
867
|
const electedSummarizerContent = JSON.stringify((_a = this.summarizerClientElection) === null || _a === void 0 ? void 0 : _a.serialize());
|
|
890
868
|
addBlobToSummary(summaryTree, electedSummarizerBlobName, electedSummarizerContent);
|
|
891
869
|
}
|
|
892
|
-
const
|
|
870
|
+
const blobManagerSummary = this.blobManager.summarize();
|
|
893
871
|
// Some storage (like git) doesn't allow empty tree, so we can omit it.
|
|
894
872
|
// and the blob manager can handle the tree not existing when loading
|
|
895
|
-
if (Object.keys(
|
|
896
|
-
addTreeToSummary(summaryTree, blobsTreeName,
|
|
873
|
+
if (Object.keys(blobManagerSummary.summary.tree).length > 0) {
|
|
874
|
+
addTreeToSummary(summaryTree, blobsTreeName, blobManagerSummary);
|
|
897
875
|
}
|
|
898
876
|
if (this.garbageCollector.writeDataAtRoot) {
|
|
899
877
|
const gcSummary = this.garbageCollector.summarize();
|
|
@@ -1430,31 +1408,30 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1430
1408
|
return (_b = (_a = this.deltaManager.lastMessage) === null || _a === void 0 ? void 0 : _a.timestamp) !== null && _b !== void 0 ? _b : (_c = this.messageAtLastSummary) === null || _c === void 0 ? void 0 : _c.timestamp;
|
|
1431
1409
|
}
|
|
1432
1410
|
/**
|
|
1433
|
-
* Returns the type of the GC node. Currently, there are nodes that belong to
|
|
1434
|
-
*
|
|
1411
|
+
* Returns the type of the GC node. Currently, there are nodes that belong to the root ("/"), data stores or
|
|
1412
|
+
* blob manager.
|
|
1435
1413
|
*/
|
|
1436
1414
|
getNodeType(nodePath) {
|
|
1415
|
+
var _a;
|
|
1437
1416
|
if (this.isBlobPath(nodePath)) {
|
|
1438
1417
|
return GCNodeType.Blob;
|
|
1439
1418
|
}
|
|
1440
|
-
|
|
1441
|
-
return GCNodeType.DataStore;
|
|
1442
|
-
}
|
|
1443
|
-
// Root node ("/") and DDS nodes belong to "Other" node types.
|
|
1444
|
-
return GCNodeType.Other;
|
|
1419
|
+
return (_a = this.dataStores.getGCNodeType(nodePath)) !== null && _a !== void 0 ? _a : GCNodeType.Other;
|
|
1445
1420
|
}
|
|
1446
1421
|
/**
|
|
1447
1422
|
* Called by GC to retrieve the package path of the node with the given path. The node should belong to a
|
|
1448
1423
|
* data store or an attachment blob.
|
|
1449
1424
|
*/
|
|
1450
1425
|
getGCNodePackagePath(nodePath) {
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1426
|
+
switch (this.getNodeType(nodePath)) {
|
|
1427
|
+
case GCNodeType.Blob:
|
|
1428
|
+
return ["_blobs"];
|
|
1429
|
+
case GCNodeType.DataStore:
|
|
1430
|
+
case GCNodeType.SubDataStore:
|
|
1431
|
+
return this.dataStores.getDataStorePackagePath(nodePath);
|
|
1432
|
+
default:
|
|
1433
|
+
assert(false, 0x2de /* "Package path requested for unsupported node type." */);
|
|
1454
1434
|
}
|
|
1455
|
-
const dataStorePkgPath = this.dataStores.getDataStorePackagePath(nodePath);
|
|
1456
|
-
assert(dataStorePkgPath !== undefined, 0x2d6 /* "Package path requested for unknown node type." */);
|
|
1457
|
-
return dataStorePkgPath;
|
|
1458
1435
|
}
|
|
1459
1436
|
/**
|
|
1460
1437
|
* Returns whether a given path is for attachment blobs that are in the format - "/BlobManager.basePath/...".
|
|
@@ -1493,11 +1470,17 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1493
1470
|
async submitSummary(options) {
|
|
1494
1471
|
var _a, _b, _c;
|
|
1495
1472
|
const { fullTree, refreshLatestAck, summaryLogger } = options;
|
|
1473
|
+
// The summary number for this summary. This will be updated during the summary process, so get it now and
|
|
1474
|
+
// use it for all events logged during this summary.
|
|
1475
|
+
const summaryNumber = this.nextSummaryNumber;
|
|
1476
|
+
const summaryNumberLogger = ChildLogger.create(summaryLogger, undefined, {
|
|
1477
|
+
all: { summaryNumber },
|
|
1478
|
+
});
|
|
1496
1479
|
if (refreshLatestAck) {
|
|
1497
|
-
const latestSummaryRefSeq = await this.refreshLatestSummaryAckFromServer(ChildLogger.create(
|
|
1480
|
+
const latestSummaryRefSeq = await this.refreshLatestSummaryAckFromServer(ChildLogger.create(summaryNumberLogger, undefined, { all: { safeSummary: true } }));
|
|
1498
1481
|
if (latestSummaryRefSeq > this.deltaManager.lastSequenceNumber) {
|
|
1499
1482
|
// We need to catch up to the latest summary's reference sequence number before pausing.
|
|
1500
|
-
await PerformanceEvent.timedExecAsync(
|
|
1483
|
+
await PerformanceEvent.timedExecAsync(summaryNumberLogger, {
|
|
1501
1484
|
eventName: "WaitingForSeq",
|
|
1502
1485
|
lastSequenceNumber: this.deltaManager.lastSequenceNumber,
|
|
1503
1486
|
targetSequenceNumber: latestSummaryRefSeq,
|
|
@@ -1513,12 +1496,12 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1513
1496
|
// We should be here is we haven't processed be here. If we are of if the last message's sequence number
|
|
1514
1497
|
// doesn't match the last processed sequence number, log an error.
|
|
1515
1498
|
if (summaryRefSeqNum !== ((_a = this.deltaManager.lastMessage) === null || _a === void 0 ? void 0 : _a.sequenceNumber)) {
|
|
1516
|
-
|
|
1499
|
+
summaryNumberLogger.sendErrorEvent({
|
|
1517
1500
|
eventName: "LastSequenceMismatch",
|
|
1518
1501
|
error: message,
|
|
1519
1502
|
});
|
|
1520
1503
|
}
|
|
1521
|
-
this.summarizerNode.startSummary(summaryRefSeqNum,
|
|
1504
|
+
this.summarizerNode.startSummary(summaryRefSeqNum, summaryNumberLogger);
|
|
1522
1505
|
// Helper function to check whether we should still continue between each async step.
|
|
1523
1506
|
const checkContinue = () => {
|
|
1524
1507
|
// Do not check for loss of connectivity directly! Instead leave it up to
|
|
@@ -1555,13 +1538,6 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1555
1538
|
error: continueResult.error,
|
|
1556
1539
|
};
|
|
1557
1540
|
}
|
|
1558
|
-
// increment summary count
|
|
1559
|
-
if (this.summaryCount !== undefined) {
|
|
1560
|
-
this.summaryCount++;
|
|
1561
|
-
}
|
|
1562
|
-
else {
|
|
1563
|
-
this.summaryCount = 1;
|
|
1564
|
-
}
|
|
1565
1541
|
const trace = Trace.start();
|
|
1566
1542
|
let summarizeResult;
|
|
1567
1543
|
// If the GC state needs to be reset, we need to force a full tree summary and update the unreferenced
|
|
@@ -1571,7 +1547,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1571
1547
|
summarizeResult = await this.summarize({
|
|
1572
1548
|
fullTree: fullTree || forcedFullTree,
|
|
1573
1549
|
trackState: true,
|
|
1574
|
-
summaryLogger,
|
|
1550
|
+
summaryLogger: summaryNumberLogger,
|
|
1575
1551
|
runGC: this.garbageCollector.shouldRunGC,
|
|
1576
1552
|
});
|
|
1577
1553
|
}
|
|
@@ -1595,7 +1571,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1595
1571
|
const gcSummaryTreeStats = summaryTree.tree[gcTreeKey]
|
|
1596
1572
|
? calculateStats(summaryTree.tree[gcTreeKey])
|
|
1597
1573
|
: undefined;
|
|
1598
|
-
const summaryStats = Object.assign({ dataStoreCount: this.dataStores.size, summarizedDataStoreCount: this.dataStores.size - handleCount, gcStateUpdatedDataStoreCount: (_b = summarizeResult.gcStats) === null || _b === void 0 ? void 0 : _b.updatedDataStoreCount, gcBlobNodeCount: gcSummaryTreeStats === null || gcSummaryTreeStats === void 0 ? void 0 : gcSummaryTreeStats.blobNodeCount, gcTotalBlobsSize: gcSummaryTreeStats === null || gcSummaryTreeStats === void 0 ? void 0 : gcSummaryTreeStats.totalBlobSize, opsSizesSinceLastSummary: this.opTracker.opsSizeAccumulator, nonSystemOpsSinceLastSummary: this.opTracker.nonSystemOpCount }, partialStats);
|
|
1574
|
+
const summaryStats = Object.assign({ dataStoreCount: this.dataStores.size, summarizedDataStoreCount: this.dataStores.size - handleCount, gcStateUpdatedDataStoreCount: (_b = summarizeResult.gcStats) === null || _b === void 0 ? void 0 : _b.updatedDataStoreCount, gcBlobNodeCount: gcSummaryTreeStats === null || gcSummaryTreeStats === void 0 ? void 0 : gcSummaryTreeStats.blobNodeCount, gcTotalBlobsSize: gcSummaryTreeStats === null || gcSummaryTreeStats === void 0 ? void 0 : gcSummaryTreeStats.totalBlobSize, opsSizesSinceLastSummary: this.opTracker.opsSizeAccumulator, nonSystemOpsSinceLastSummary: this.opTracker.nonSystemOpCount, summaryNumber }, partialStats);
|
|
1599
1575
|
const generateSummaryData = {
|
|
1600
1576
|
referenceSequenceNumber: summaryRefSeqNum,
|
|
1601
1577
|
minimumSequenceNumber,
|