@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.
Files changed (52) hide show
  1. package/container-runtime.test-files.tar +0 -0
  2. package/dist/containerRuntime.d.ts +8 -0
  3. package/dist/containerRuntime.d.ts.map +1 -1
  4. package/dist/containerRuntime.js +79 -58
  5. package/dist/containerRuntime.js.map +1 -1
  6. package/dist/dataStoreContext.d.ts.map +1 -1
  7. package/dist/dataStoreContext.js +0 -3
  8. package/dist/dataStoreContext.js.map +1 -1
  9. package/dist/packageVersion.d.ts +1 -1
  10. package/dist/packageVersion.js +1 -1
  11. package/dist/packageVersion.js.map +1 -1
  12. package/dist/summary/summarizerNode/summarizerNode.d.ts +30 -13
  13. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  14. package/dist/summary/summarizerNode/summarizerNode.js +84 -102
  15. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  16. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +15 -42
  17. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  18. package/dist/summary/summarizerNode/summarizerNodeUtils.js +10 -88
  19. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  20. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +5 -6
  21. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  22. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +28 -38
  23. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  24. package/lib/containerRuntime.d.ts +8 -0
  25. package/lib/containerRuntime.d.ts.map +1 -1
  26. package/lib/containerRuntime.js +79 -58
  27. package/lib/containerRuntime.js.map +1 -1
  28. package/lib/dataStoreContext.d.ts.map +1 -1
  29. package/lib/dataStoreContext.js +0 -3
  30. package/lib/dataStoreContext.js.map +1 -1
  31. package/lib/packageVersion.d.ts +1 -1
  32. package/lib/packageVersion.js +1 -1
  33. package/lib/packageVersion.js.map +1 -1
  34. package/lib/summary/summarizerNode/summarizerNode.d.ts +30 -13
  35. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  36. package/lib/summary/summarizerNode/summarizerNode.js +85 -103
  37. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  38. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +15 -42
  39. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  40. package/lib/summary/summarizerNode/summarizerNodeUtils.js +8 -84
  41. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  42. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +5 -6
  43. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  44. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +29 -39
  45. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  46. package/package.json +21 -22
  47. package/src/containerRuntime.ts +98 -76
  48. package/src/dataStoreContext.ts +0 -3
  49. package/src/packageVersion.ts +1 -1
  50. package/src/summary/summarizerNode/summarizerNode.ts +90 -123
  51. package/src/summary/summarizerNode/summarizerNodeUtils.ts +19 -99
  52. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +37 -53
@@ -28,7 +28,7 @@ import {
28
28
  ICreateChildDetails,
29
29
  IStartSummaryResult,
30
30
  ISummarizerNodeRootContract,
31
- SummaryNode,
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 SummaryNode to add used routes tracking to it.
40
- class SummaryNodeWithGC extends SummaryNode {
41
- constructor(
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
- /** Undefined means created without summary */
108
- latestSummary?: SummaryNode,
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
- latestSummary,
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, parentPath, parentSkipRecursion);
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 summaryNode = this.pendingSummaries.get(proposalHandle);
291
- if (summaryNode !== undefined) {
292
- const summaryNodeWithGC = new SummaryNodeWithGC(wipSerializedUsedRoutes, summaryNode);
293
- this.pendingSummaries.set(proposalHandle, summaryNodeWithGC);
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 summaryNode = this.pendingSummaries.get(proposalHandle);
318
- if (summaryNode !== undefined) {
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 = summaryNode as 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.latestSummary,
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
- if (child.latestSummary !== undefined) {
426
- for (const [key, value] of this.pendingSummaries.entries()) {
427
- const summaryNodeWithGC = value as SummaryNodeWithGC;
428
- if (summaryNodeWithGC.serializedUsedRoutes !== undefined) {
429
- const childNodeUsedRoutes = unpackChildNodesUsedRoutes(
430
- JSON.parse(summaryNodeWithGC.serializedUsedRoutes),
431
- );
432
- const newSerializedRoutes = childNodeUsedRoutes.get(id) ?? [""];
433
- const newLatestSummaryNode = new SummaryNodeWithGC(
434
- JSON.stringify(newSerializedRoutes),
435
- {
436
- referenceSequenceNumber: value.referenceSequenceNumber,
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 === undefined
535
- ? undefined
536
- : SummaryNode.createForRoot(referenceSequenceNumber),
520
+ referenceSequenceNumber,
537
521
  undefined /* wipSummaryLogger */,
538
522
  getGCDataFn,
539
523
  getBaseGCDetailsFn,