@fluidframework/container-runtime 2.0.0-internal.1.0.0.81589 → 2.0.0-internal.1.0.0.82628
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/dist/containerRuntime.d.ts +19 -8
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +3 -3
- package/dist/containerRuntime.js.map +1 -1
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +17 -12
- package/dist/garbageCollection.js.map +1 -1
- package/dist/opProperties.js +2 -1
- package/dist/opProperties.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/containerRuntime.d.ts +19 -8
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +4 -4
- package/lib/containerRuntime.js.map +1 -1
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +17 -12
- package/lib/garbageCollection.js.map +1 -1
- package/lib/opProperties.js +2 -1
- package/lib/opProperties.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 +14 -14
- package/src/containerRuntime.ts +38 -14
- package/src/garbageCollection.ts +13 -7
- package/src/opProperties.ts +1 -1
- package/src/packageVersion.ts +1 -1
package/lib/opProperties.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opProperties.js","sourceRoot":"","sources":["../src/opProperties.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAA6B,EAAU,EAAE
|
|
1
|
+
{"version":3,"file":"opProperties.js","sourceRoot":"","sources":["../src/opProperties.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAA6B,EAAU,EAAE;;IAC5D,kDAAkD;IAClD,2DAA2D;IAC3D,MAAM,OAAO,GAAG,OAAO,EAAE,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;QAC7C,EAAE,CAAC,QAAQ,CAAC,CAAC;QACb,MAAA,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAAC;IACtC,MAAM,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1C,OAAO,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,EAA6B,EAAyC,EAAE,CACtF,EAAsC,CAAC,IAAI,KAAK,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage, ISequencedDocumentSystemMessage } from \"@fluidframework/protocol-definitions\";\n\nexport const opSize = (op: ISequencedDocumentMessage): number => {\n // Some messages may already have string contents,\n // so stringifying them again will add inaccurate overhead.\n const content = typeof op.contents === \"string\" ?\n op.contents :\n JSON.stringify(op.contents) ?? \"\";\n const data = opHasData(op) ? op.data : \"\";\n return content.length + data.length;\n};\n\nconst opHasData = (op: ISequencedDocumentMessage): op is ISequencedDocumentSystemMessage =>\n (op as ISequencedDocumentSystemMessage).data !== undefined;\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/container-runtime";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-internal.1.0.0.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.1.0.0.82628";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export const pkgName = "@fluidframework/container-runtime";
|
|
8
|
-
export const pkgVersion = "2.0.0-internal.1.0.0.
|
|
8
|
+
export const pkgVersion = "2.0.0-internal.1.0.0.82628";
|
|
9
9
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,4BAA4B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.0.0-internal.1.0.0.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,4BAA4B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.0.0-internal.1.0.0.82628\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/container-runtime",
|
|
3
|
-
"version": "2.0.0-internal.1.0.0.
|
|
3
|
+
"version": "2.0.0-internal.1.0.0.82628",
|
|
4
4
|
"description": "Fluid container runtime",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -63,19 +63,19 @@
|
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
65
65
|
"@fluidframework/common-utils": "^0.32.1",
|
|
66
|
-
"@fluidframework/container-definitions": "2.0.0-internal.1.0.0.
|
|
67
|
-
"@fluidframework/container-runtime-definitions": "2.0.0-internal.1.0.0.
|
|
68
|
-
"@fluidframework/container-utils": "2.0.0-internal.1.0.0.
|
|
69
|
-
"@fluidframework/core-interfaces": "2.0.0-internal.1.0.0.
|
|
70
|
-
"@fluidframework/datastore": "2.0.0-internal.1.0.0.
|
|
71
|
-
"@fluidframework/driver-definitions": "2.0.0-internal.1.0.0.
|
|
72
|
-
"@fluidframework/driver-utils": "2.0.0-internal.1.0.0.
|
|
73
|
-
"@fluidframework/garbage-collector": "2.0.0-internal.1.0.0.
|
|
66
|
+
"@fluidframework/container-definitions": "2.0.0-internal.1.0.0.82628",
|
|
67
|
+
"@fluidframework/container-runtime-definitions": "2.0.0-internal.1.0.0.82628",
|
|
68
|
+
"@fluidframework/container-utils": "2.0.0-internal.1.0.0.82628",
|
|
69
|
+
"@fluidframework/core-interfaces": "2.0.0-internal.1.0.0.82628",
|
|
70
|
+
"@fluidframework/datastore": "2.0.0-internal.1.0.0.82628",
|
|
71
|
+
"@fluidframework/driver-definitions": "2.0.0-internal.1.0.0.82628",
|
|
72
|
+
"@fluidframework/driver-utils": "2.0.0-internal.1.0.0.82628",
|
|
73
|
+
"@fluidframework/garbage-collector": "2.0.0-internal.1.0.0.82628",
|
|
74
74
|
"@fluidframework/protocol-base": "^0.1037.1000-0",
|
|
75
75
|
"@fluidframework/protocol-definitions": "^0.1029.1000-0",
|
|
76
|
-
"@fluidframework/runtime-definitions": "2.0.0-internal.1.0.0.
|
|
77
|
-
"@fluidframework/runtime-utils": "2.0.0-internal.1.0.0.
|
|
78
|
-
"@fluidframework/telemetry-utils": "2.0.0-internal.1.0.0.
|
|
76
|
+
"@fluidframework/runtime-definitions": "2.0.0-internal.1.0.0.82628",
|
|
77
|
+
"@fluidframework/runtime-utils": "2.0.0-internal.1.0.0.82628",
|
|
78
|
+
"@fluidframework/telemetry-utils": "2.0.0-internal.1.0.0.82628",
|
|
79
79
|
"double-ended-queue": "^2.1.0-0",
|
|
80
80
|
"uuid": "^8.3.1"
|
|
81
81
|
},
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
"@fluidframework/build-tools": "^0.3.0-0",
|
|
85
85
|
"@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@^1.0.0",
|
|
86
86
|
"@fluidframework/eslint-config-fluid": "^0.28.2000",
|
|
87
|
-
"@fluidframework/mocha-test-setup": "2.0.0-internal.1.0.0.
|
|
88
|
-
"@fluidframework/test-runtime-utils": "2.0.0-internal.1.0.0.
|
|
87
|
+
"@fluidframework/mocha-test-setup": "2.0.0-internal.1.0.0.82628",
|
|
88
|
+
"@fluidframework/test-runtime-utils": "2.0.0-internal.1.0.0.82628",
|
|
89
89
|
"@microsoft/api-extractor": "^7.22.2",
|
|
90
90
|
"@rushstack/eslint-config": "^2.5.1",
|
|
91
91
|
"@types/double-ended-queue": "^2.1.0",
|
package/src/containerRuntime.ts
CHANGED
|
@@ -44,7 +44,12 @@ import {
|
|
|
44
44
|
MonitoringContext,
|
|
45
45
|
loggerToMonitoringContext,
|
|
46
46
|
} from "@fluidframework/telemetry-utils";
|
|
47
|
-
import {
|
|
47
|
+
import {
|
|
48
|
+
DriverHeader,
|
|
49
|
+
FetchSource,
|
|
50
|
+
IDocumentStorageService,
|
|
51
|
+
ISummaryContext,
|
|
52
|
+
} from "@fluidframework/driver-definitions";
|
|
48
53
|
import { readAndParse, isUnpackedRuntimeMessage } from "@fluidframework/driver-utils";
|
|
49
54
|
import {
|
|
50
55
|
DataCorruptionError,
|
|
@@ -315,25 +320,30 @@ export const DefaultSummaryConfiguration: ISummaryConfiguration = {
|
|
|
315
320
|
|
|
316
321
|
export interface IGCRuntimeOptions {
|
|
317
322
|
/**
|
|
318
|
-
* Flag that if true, will enable running garbage collection (GC)
|
|
319
|
-
*
|
|
320
|
-
* mark phase.
|
|
323
|
+
* Flag that if true, will enable running garbage collection (GC) for a new container.
|
|
324
|
+
*
|
|
325
|
+
* GC has mark phase and sweep phase. In mark phase, unreferenced objects are identified
|
|
326
|
+
* and marked as such in the summary. This option enables the mark phase.
|
|
321
327
|
* In sweep phase, unreferenced objects are eventually deleted from the container if they meet certain conditions.
|
|
322
328
|
* Sweep phase can be enabled via the "sweepAllowed" option.
|
|
323
|
-
*
|
|
329
|
+
*
|
|
330
|
+
* Note: This setting is persisted in the container's summary and cannot be changed.
|
|
324
331
|
*/
|
|
325
332
|
gcAllowed?: boolean;
|
|
326
333
|
|
|
327
334
|
/**
|
|
328
|
-
* Flag that if true, enables GC's sweep phase
|
|
335
|
+
* Flag that if true, enables GC's sweep phase for a new container.
|
|
336
|
+
*
|
|
337
|
+
* This will allow GC to eventually delete unreferenced objects from the container.
|
|
329
338
|
* This flag should only be set to true if "gcAllowed" is true.
|
|
330
|
-
*
|
|
339
|
+
*
|
|
340
|
+
* Note: This setting is persisted in the container's summary and cannot be changed.
|
|
331
341
|
*/
|
|
332
342
|
sweepAllowed?: boolean;
|
|
333
343
|
|
|
334
344
|
/**
|
|
335
|
-
* Flag that will disable garbage collection
|
|
336
|
-
* is allowed via the gcAllowed option.
|
|
345
|
+
* Flag that if true, will disable garbage collection for the session.
|
|
346
|
+
* Can be used to disable running GC on containers where it is allowed via the gcAllowed option.
|
|
337
347
|
*/
|
|
338
348
|
disableGC?: boolean;
|
|
339
349
|
|
|
@@ -343,6 +353,13 @@ export interface IGCRuntimeOptions {
|
|
|
343
353
|
*/
|
|
344
354
|
runFullGC?: boolean;
|
|
345
355
|
|
|
356
|
+
/**
|
|
357
|
+
* Maximum session duration for a new container. If not present, a default value will be used.
|
|
358
|
+
*
|
|
359
|
+
* Note: This setting is persisted in the container's summary and cannot be changed.
|
|
360
|
+
*/
|
|
361
|
+
sessionExpiryTimeoutMs?: number;
|
|
362
|
+
|
|
346
363
|
/**
|
|
347
364
|
* Allows additional GC options to be passed.
|
|
348
365
|
*/
|
|
@@ -3131,9 +3148,11 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents>
|
|
|
3131
3148
|
*/
|
|
3132
3149
|
private async refreshLatestSummaryAckFromServer(summaryLogger: ITelemetryLogger): Promise<number> {
|
|
3133
3150
|
const snapshot = await this.fetchSnapshotFromStorage(null, summaryLogger, {
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3151
|
+
eventName: "RefreshLatestSummaryGetSnapshot",
|
|
3152
|
+
fetchLatest: true,
|
|
3153
|
+
},
|
|
3154
|
+
FetchSource.noCache,
|
|
3155
|
+
);
|
|
3137
3156
|
|
|
3138
3157
|
const readAndParseBlob = async <T>(id: string) => readAndParse<T>(this.storage, id);
|
|
3139
3158
|
const snapshotRefSeq = await seqFromTree(snapshot, readAndParseBlob);
|
|
@@ -3153,7 +3172,11 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents>
|
|
|
3153
3172
|
}
|
|
3154
3173
|
|
|
3155
3174
|
private async fetchSnapshotFromStorage(
|
|
3156
|
-
versionId: string | null,
|
|
3175
|
+
versionId: string | null,
|
|
3176
|
+
logger: ITelemetryLogger,
|
|
3177
|
+
event: ITelemetryGenericEvent,
|
|
3178
|
+
fetchSource?: FetchSource,
|
|
3179
|
+
) {
|
|
3157
3180
|
return PerformanceEvent.timedExecAsync(
|
|
3158
3181
|
logger, event, async (perfEvent: {
|
|
3159
3182
|
end: (arg0: {
|
|
@@ -3164,7 +3187,8 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents>
|
|
|
3164
3187
|
const stats: { getVersionDuration?: number; getSnapshotDuration?: number; } = {};
|
|
3165
3188
|
const trace = Trace.start();
|
|
3166
3189
|
|
|
3167
|
-
const versions = await this.storage.getVersions(
|
|
3190
|
+
const versions = await this.storage.getVersions(
|
|
3191
|
+
versionId, 1, "refreshLatestSummaryAckFromServer", fetchSource);
|
|
3168
3192
|
assert(!!versions && !!versions[0], 0x137 /* "Failed to get version from storage" */);
|
|
3169
3193
|
stats.getVersionDuration = trace.trace().duration;
|
|
3170
3194
|
|
package/src/garbageCollection.ts
CHANGED
|
@@ -63,7 +63,7 @@ export const gcBlobPrefix = "__gc";
|
|
|
63
63
|
// Feature gate key to turn GC on / off.
|
|
64
64
|
const runGCKey = "Fluid.GarbageCollection.RunGC";
|
|
65
65
|
// Feature gate key to turn GC sweep on / off.
|
|
66
|
-
const runSweepKey = "Fluid.GarbageCollection.RunSweep";
|
|
66
|
+
// const runSweepKey = "Fluid.GarbageCollection.RunSweep";
|
|
67
67
|
// Feature gate key to turn GC test mode on / off.
|
|
68
68
|
const gcTestModeKey = "Fluid.GarbageCollection.GCTestMode";
|
|
69
69
|
// Feature gate key to write GC data at the root of the summary tree.
|
|
@@ -486,7 +486,7 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
486
486
|
|
|
487
487
|
// Set the Session Expiry only if the flag is enabled or the test option is set.
|
|
488
488
|
if (this.mc.config.getBoolean(runSessionExpiryKey) && this.gcEnabled) {
|
|
489
|
-
this.sessionExpiryTimeoutMs = defaultSessionExpiryDurationMs;
|
|
489
|
+
this.sessionExpiryTimeoutMs = this.gcOptions.sessionExpiryTimeoutMs ?? defaultSessionExpiryDurationMs;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
|
|
@@ -503,14 +503,19 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
503
503
|
(timer) => { this.sessionExpiryTimer = timer; },
|
|
504
504
|
);
|
|
505
505
|
|
|
506
|
+
// TEMPORARY: Hardcode a default of 2 days which is the value used in the ODSP driver.
|
|
507
|
+
// This unblocks the Sweep Log (see logSweepEvents function).
|
|
508
|
+
// This will be removed before sweep is fully implemented.
|
|
509
|
+
const snapshotCacheExpiryMs = createParams.snapshotCacheExpiryMs ?? 2 * 24 * 60 * 60 * 1000;
|
|
510
|
+
|
|
506
511
|
/**
|
|
507
512
|
* Sweep timeout is the time after which unreferenced content can be swept.
|
|
508
513
|
* Sweep timeout = session expiry timeout + snapshot cache expiry timeout + one day buffer. The buffer is
|
|
509
514
|
* added to account for any clock skew. We use server timestamps throughout so the skew should be minimal
|
|
510
515
|
* but make it one day to be safe.
|
|
511
516
|
*/
|
|
512
|
-
if (
|
|
513
|
-
this.sweepTimeoutMs = this.sessionExpiryTimeoutMs +
|
|
517
|
+
if (snapshotCacheExpiryMs !== undefined) {
|
|
518
|
+
this.sweepTimeoutMs = this.sessionExpiryTimeoutMs + snapshotCacheExpiryMs + oneDayMs;
|
|
514
519
|
}
|
|
515
520
|
}
|
|
516
521
|
|
|
@@ -538,9 +543,10 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
538
543
|
* 3. Sweep should be enabled for this container (this.sweepEnabled). This can be overridden via runSweep
|
|
539
544
|
* feature flag.
|
|
540
545
|
*/
|
|
541
|
-
this.shouldRunSweep =
|
|
542
|
-
|
|
543
|
-
&&
|
|
546
|
+
this.shouldRunSweep = false; // disable while TEMPORARY measure hardcoding snapshotCacheExpiryMs is here
|
|
547
|
+
// this.shouldRunGC
|
|
548
|
+
// && this.sweepTimeoutMs !== undefined
|
|
549
|
+
// && (this.mc.config.getBoolean(runSweepKey) ?? this.sweepEnabled);
|
|
544
550
|
|
|
545
551
|
this.trackGCState = this.mc.config.getBoolean(trackGCStateKey) === true;
|
|
546
552
|
|
package/src/opProperties.ts
CHANGED
|
@@ -10,7 +10,7 @@ export const opSize = (op: ISequencedDocumentMessage): number => {
|
|
|
10
10
|
// so stringifying them again will add inaccurate overhead.
|
|
11
11
|
const content = typeof op.contents === "string" ?
|
|
12
12
|
op.contents :
|
|
13
|
-
JSON.stringify(op.contents);
|
|
13
|
+
JSON.stringify(op.contents) ?? "";
|
|
14
14
|
const data = opHasData(op) ? op.data : "";
|
|
15
15
|
return content.length + data.length;
|
|
16
16
|
};
|
package/src/packageVersion.ts
CHANGED