@fluidframework/container-runtime 2.4.0-297027 → 2.4.0-299374
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/container-runtime.test-files.tar +0 -0
- package/dist/containerRuntime.d.ts +8 -0
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +79 -58
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +0 -3
- package/dist/dataStoreContext.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/summarizerNode/summarizerNode.d.ts +30 -13
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +84 -102
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +15 -42
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +10 -88
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +5 -6
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +28 -38
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/containerRuntime.d.ts +8 -0
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +79 -58
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +0 -3
- package/lib/dataStoreContext.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/summarizerNode/summarizerNode.d.ts +30 -13
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +85 -103
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +15 -42
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +8 -84
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +5 -6
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +29 -39
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/package.json +21 -22
- package/src/containerRuntime.ts +98 -76
- package/src/dataStoreContext.ts +0 -3
- package/src/packageVersion.ts +1 -1
- package/src/summary/summarizerNode/summarizerNode.ts +90 -123
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +19 -99
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +37 -53
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
ICreateChildDetails,
|
|
29
29
|
IStartSummaryResult,
|
|
30
30
|
ISummarizerNodeRootContract,
|
|
31
|
-
|
|
31
|
+
PendingSummaryInfo,
|
|
32
32
|
ValidateSummaryResult,
|
|
33
33
|
} from "./summarizerNodeUtils.js";
|
|
34
34
|
|
|
@@ -36,19 +36,9 @@ export interface IRootSummarizerNodeWithGC
|
|
|
36
36
|
extends ISummarizerNodeWithGC,
|
|
37
37
|
ISummarizerNodeRootContract {}
|
|
38
38
|
|
|
39
|
-
// Extend
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
public readonly serializedUsedRoutes: string | undefined,
|
|
43
|
-
summary: {
|
|
44
|
-
readonly referenceSequenceNumber: number;
|
|
45
|
-
readonly basePath: EscapedPath | undefined;
|
|
46
|
-
readonly localPath: EscapedPath;
|
|
47
|
-
additionalPath?: EscapedPath;
|
|
48
|
-
},
|
|
49
|
-
) {
|
|
50
|
-
super(summary);
|
|
51
|
-
}
|
|
39
|
+
// Extend PendingSummaryInfo to add used routes tracking it.
|
|
40
|
+
interface PendingSummaryInfoWithGC extends PendingSummaryInfo {
|
|
41
|
+
serializedUsedRoutes: string | undefined;
|
|
52
42
|
}
|
|
53
43
|
|
|
54
44
|
/**
|
|
@@ -103,9 +93,10 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
|
|
|
103
93
|
logger: ITelemetryBaseLogger,
|
|
104
94
|
summarizeInternalFn: SummarizeInternalFn,
|
|
105
95
|
config: ISummarizerNodeConfigWithGC,
|
|
96
|
+
_summaryHandleId: EscapedPath,
|
|
106
97
|
changeSequenceNumber: number,
|
|
107
|
-
/**
|
|
108
|
-
|
|
98
|
+
/** Summary reference sequence number, i.e. last sequence number seen when it was created */
|
|
99
|
+
lastSummaryReferenceSequenceNumber?: number,
|
|
109
100
|
wipSummaryLogger?: ITelemetryBaseLogger,
|
|
110
101
|
private readonly getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
|
|
111
102
|
getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,
|
|
@@ -116,8 +107,9 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
|
|
|
116
107
|
logger,
|
|
117
108
|
summarizeInternalFn,
|
|
118
109
|
config,
|
|
110
|
+
_summaryHandleId,
|
|
119
111
|
changeSequenceNumber,
|
|
120
|
-
|
|
112
|
+
lastSummaryReferenceSequenceNumber,
|
|
121
113
|
wipSummaryLogger,
|
|
122
114
|
telemetryId,
|
|
123
115
|
);
|
|
@@ -268,29 +260,27 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
|
|
|
268
260
|
* Called after summary has been uploaded to the server. Add the work-in-progress state to the pending
|
|
269
261
|
* summary queue. We track this until we get an ack from the server for this summary.
|
|
270
262
|
* @param proposalHandle - The handle of the summary that was uploaded to the server.
|
|
271
|
-
* @param parentPath - The path of the parent node which is used to build the path of this node.
|
|
272
263
|
* @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.
|
|
273
264
|
* In that case, the children will not have work-in-progress state.
|
|
274
265
|
*/
|
|
275
|
-
protected completeSummaryCore(
|
|
276
|
-
proposalHandle: string,
|
|
277
|
-
parentPath: EscapedPath | undefined,
|
|
278
|
-
parentSkipRecursion: boolean,
|
|
279
|
-
) {
|
|
266
|
+
protected completeSummaryCore(proposalHandle: string, parentSkipRecursion: boolean) {
|
|
280
267
|
let wipSerializedUsedRoutes: string | undefined;
|
|
281
268
|
// If GC is disabled, don't set wip used routes.
|
|
282
269
|
if (!this.gcDisabled) {
|
|
283
270
|
wipSerializedUsedRoutes = this.wipSerializedUsedRoutes;
|
|
284
271
|
}
|
|
285
272
|
|
|
286
|
-
super.completeSummaryCore(proposalHandle,
|
|
273
|
+
super.completeSummaryCore(proposalHandle, parentSkipRecursion);
|
|
287
274
|
|
|
288
275
|
// If GC is disabled, skip setting pending summary with GC state.
|
|
289
276
|
if (!this.gcDisabled) {
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
292
|
-
const
|
|
293
|
-
|
|
277
|
+
const pendingSummaryInfo = this.pendingSummaries.get(proposalHandle);
|
|
278
|
+
if (pendingSummaryInfo !== undefined) {
|
|
279
|
+
const pendingSummaryInfoWithGC = {
|
|
280
|
+
serializedUsedRoutes: wipSerializedUsedRoutes,
|
|
281
|
+
...pendingSummaryInfo,
|
|
282
|
+
};
|
|
283
|
+
this.pendingSummaries.set(proposalHandle, pendingSummaryInfoWithGC);
|
|
294
284
|
}
|
|
295
285
|
}
|
|
296
286
|
}
|
|
@@ -314,10 +304,10 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
|
|
|
314
304
|
): void {
|
|
315
305
|
// If GC is disabled, skip setting referenced used routes since we are not tracking GC state.
|
|
316
306
|
if (!this.gcDisabled) {
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
307
|
+
const pendingSummaryInfo = this.pendingSummaries.get(proposalHandle);
|
|
308
|
+
if (pendingSummaryInfo !== undefined) {
|
|
319
309
|
// If a pending summary exists, it must have used routes since GC is enabled.
|
|
320
|
-
const summaryNodeWithGC =
|
|
310
|
+
const summaryNodeWithGC = pendingSummaryInfo as PendingSummaryInfoWithGC;
|
|
321
311
|
if (summaryNodeWithGC.serializedUsedRoutes === undefined) {
|
|
322
312
|
const error = new LoggingError("MissingGCStateInPendingSummary", {
|
|
323
313
|
proposalHandle,
|
|
@@ -379,8 +369,9 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
|
|
|
379
369
|
// Propagate our gcDisabled state to the child if its not explicity specified in child's config.
|
|
380
370
|
gcDisabled: config.gcDisabled ?? this.gcDisabled,
|
|
381
371
|
},
|
|
372
|
+
createDetails.summaryHandleId,
|
|
382
373
|
createDetails.changeSequenceNumber,
|
|
383
|
-
createDetails.
|
|
374
|
+
createDetails.lastSummaryReferenceSequenceNumber,
|
|
384
375
|
this.wipSummaryLogger,
|
|
385
376
|
getGCDataFn,
|
|
386
377
|
getChildBaseGCDetailsFn,
|
|
@@ -422,24 +413,18 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
|
|
|
422
413
|
}
|
|
423
414
|
|
|
424
415
|
// In case we have pending summaries on the parent, let's initialize it on the child.
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
basePath: child.latestSummary.basePath,
|
|
438
|
-
localPath: child.latestSummary.localPath,
|
|
439
|
-
},
|
|
440
|
-
);
|
|
441
|
-
child.addPendingSummary(key, newLatestSummaryNode);
|
|
442
|
-
}
|
|
416
|
+
for (const [key, pendingSummary] of this.pendingSummaries.entries()) {
|
|
417
|
+
const pendingSummaryWithGC = pendingSummary as PendingSummaryInfoWithGC;
|
|
418
|
+
if (pendingSummaryWithGC.serializedUsedRoutes !== undefined) {
|
|
419
|
+
const childNodeUsedRoutes = unpackChildNodesUsedRoutes(
|
|
420
|
+
JSON.parse(pendingSummaryWithGC.serializedUsedRoutes),
|
|
421
|
+
);
|
|
422
|
+
const newSerializedRoutes = childNodeUsedRoutes.get(id) ?? [""];
|
|
423
|
+
const childPendingSummaryInfo = {
|
|
424
|
+
...pendingSummaryWithGC,
|
|
425
|
+
serializedUsedRoutes: JSON.stringify(newSerializedRoutes),
|
|
426
|
+
};
|
|
427
|
+
child.addPendingSummary(key, childPendingSummaryInfo);
|
|
443
428
|
}
|
|
444
429
|
}
|
|
445
430
|
}
|
|
@@ -530,10 +515,9 @@ export const createRootSummarizerNodeWithGC = (
|
|
|
530
515
|
logger,
|
|
531
516
|
summarizeInternalFn,
|
|
532
517
|
config,
|
|
518
|
+
EscapedPath.create("") /* summaryHandleId */,
|
|
533
519
|
changeSequenceNumber,
|
|
534
|
-
referenceSequenceNumber
|
|
535
|
-
? undefined
|
|
536
|
-
: SummaryNode.createForRoot(referenceSequenceNumber),
|
|
520
|
+
referenceSequenceNumber,
|
|
537
521
|
undefined /* wipSummaryLogger */,
|
|
538
522
|
getGCDataFn,
|
|
539
523
|
getBaseGCDetailsFn,
|