@fluidframework/container-runtime 2.0.0-internal.3.0.1 → 2.0.0-internal.3.0.2

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 (58) hide show
  1. package/dist/containerRuntime.d.ts +1 -1
  2. package/dist/containerRuntime.d.ts.map +1 -1
  3. package/dist/containerRuntime.js +43 -31
  4. package/dist/containerRuntime.js.map +1 -1
  5. package/dist/dataStoreContext.d.ts +12 -0
  6. package/dist/dataStoreContext.d.ts.map +1 -1
  7. package/dist/dataStoreContext.js +43 -5
  8. package/dist/dataStoreContext.js.map +1 -1
  9. package/dist/garbageCollection.d.ts +5 -4
  10. package/dist/garbageCollection.d.ts.map +1 -1
  11. package/dist/garbageCollection.js +15 -6
  12. package/dist/garbageCollection.js.map +1 -1
  13. package/dist/garbageCollectionConstants.d.ts +2 -0
  14. package/dist/garbageCollectionConstants.d.ts.map +1 -1
  15. package/dist/garbageCollectionConstants.js +3 -1
  16. package/dist/garbageCollectionConstants.js.map +1 -1
  17. package/dist/packageVersion.d.ts +1 -1
  18. package/dist/packageVersion.js +1 -1
  19. package/dist/packageVersion.js.map +1 -1
  20. package/dist/summaryFormat.d.ts +19 -0
  21. package/dist/summaryFormat.d.ts.map +1 -1
  22. package/dist/summaryFormat.js.map +1 -1
  23. package/dist/summaryGenerator.d.ts.map +1 -1
  24. package/dist/summaryGenerator.js +1 -1
  25. package/dist/summaryGenerator.js.map +1 -1
  26. package/lib/containerRuntime.d.ts +1 -1
  27. package/lib/containerRuntime.d.ts.map +1 -1
  28. package/lib/containerRuntime.js +43 -31
  29. package/lib/containerRuntime.js.map +1 -1
  30. package/lib/dataStoreContext.d.ts +12 -0
  31. package/lib/dataStoreContext.d.ts.map +1 -1
  32. package/lib/dataStoreContext.js +45 -7
  33. package/lib/dataStoreContext.js.map +1 -1
  34. package/lib/garbageCollection.d.ts +5 -4
  35. package/lib/garbageCollection.d.ts.map +1 -1
  36. package/lib/garbageCollection.js +16 -7
  37. package/lib/garbageCollection.js.map +1 -1
  38. package/lib/garbageCollectionConstants.d.ts +2 -0
  39. package/lib/garbageCollectionConstants.d.ts.map +1 -1
  40. package/lib/garbageCollectionConstants.js +2 -0
  41. package/lib/garbageCollectionConstants.js.map +1 -1
  42. package/lib/packageVersion.d.ts +1 -1
  43. package/lib/packageVersion.js +1 -1
  44. package/lib/packageVersion.js.map +1 -1
  45. package/lib/summaryFormat.d.ts +19 -0
  46. package/lib/summaryFormat.d.ts.map +1 -1
  47. package/lib/summaryFormat.js.map +1 -1
  48. package/lib/summaryGenerator.d.ts.map +1 -1
  49. package/lib/summaryGenerator.js +1 -1
  50. package/lib/summaryGenerator.js.map +1 -1
  51. package/package.json +19 -53
  52. package/src/containerRuntime.ts +78 -49
  53. package/src/dataStoreContext.ts +64 -5
  54. package/src/garbageCollection.ts +24 -9
  55. package/src/garbageCollectionConstants.ts +3 -0
  56. package/src/packageVersion.ts +1 -1
  57. package/src/summaryFormat.ts +22 -0
  58. package/src/summaryGenerator.ts +9 -5
@@ -204,6 +204,7 @@ class GarbageCollector {
204
204
  this.sessionExpiryTimeoutMs = metadata === null || metadata === void 0 ? void 0 : metadata.sessionExpiryTimeoutMs;
205
205
  this.sweepTimeoutMs =
206
206
  (_b = metadata === null || metadata === void 0 ? void 0 : metadata.sweepTimeoutMs) !== null && _b !== void 0 ? _b : computeSweepTimeout(this.sessionExpiryTimeoutMs); // Backfill old documents that didn't persist this
207
+ this.persistedGcFeatureMatrix = metadata === null || metadata === void 0 ? void 0 : metadata.gcFeatureMatrix;
207
208
  }
208
209
  else {
209
210
  // Sweep should not be enabled without enabling GC mark phase. We could silently disable sweep in this
@@ -224,6 +225,11 @@ class GarbageCollector {
224
225
  }
225
226
  this.sweepTimeoutMs =
226
227
  testOverrideSweepTimeoutMs !== null && testOverrideSweepTimeoutMs !== void 0 ? testOverrideSweepTimeoutMs : computeSweepTimeout(this.sessionExpiryTimeoutMs);
228
+ if (this.gcOptions[garbageCollectionConstants_1.gcTombstoneGenerationOptionName] !== undefined) {
229
+ this.persistedGcFeatureMatrix = {
230
+ tombstoneGeneration: this.gcOptions[garbageCollectionConstants_1.gcTombstoneGenerationOptionName],
231
+ };
232
+ }
227
233
  }
228
234
  // If session expiry is enabled, we need to close the container when the session expiry timeout expires.
229
235
  if (this.sessionExpiryTimeoutMs !== undefined) {
@@ -571,7 +577,7 @@ class GarbageCollector {
571
577
  * Runs garbage collection and updates the reference / used state of the nodes in the container.
572
578
  * @returns stats of the GC run or undefined if GC did not run.
573
579
  */
574
- async collectGarbage(options) {
580
+ async collectGarbage(options, telemetryContext) {
575
581
  var _a;
576
582
  const fullGC = (_a = options.fullGC) !== null && _a !== void 0 ? _a : (this.gcOptions.runFullGC === true || this.summaryStateNeedsReset);
577
583
  const logger = options.logger
@@ -594,6 +600,8 @@ class GarbageCollector {
594
600
  });
595
601
  return undefined;
596
602
  }
603
+ // Add the options that are used to run GC to the telemetry context.
604
+ telemetryContext === null || telemetryContext === void 0 ? void 0 : telemetryContext.setAll("fluid_GC", "Options", { fullGC, runSweep: options.runSweep });
597
605
  return telemetry_utils_1.PerformanceEvent.timedExecAsync(logger, { eventName: "GarbageCollection" }, async (event) => {
598
606
  await this.runPreGCSteps();
599
607
  // Get the runtime's GC data and run GC on the reference graph in it.
@@ -749,6 +757,7 @@ class GarbageCollector {
749
757
  * into the metadata blob. If GC is disabled, the gcFeature is 0.
750
758
  */
751
759
  gcFeature: this.gcEnabled ? this.currentGCVersion : 0,
760
+ gcFeatureMatrix: this.persistedGcFeatureMatrix,
752
761
  sessionExpiryTimeoutMs: this.sessionExpiryTimeoutMs,
753
762
  sweepEnabled: this.sweepEnabled,
754
763
  sweepTimeoutMs: this.sweepTimeoutMs,
@@ -765,7 +774,7 @@ class GarbageCollector {
765
774
  * Called to refresh the latest summary state. This happens when either a pending summary is acked or a snapshot
766
775
  * is downloaded and should be used to update the state.
767
776
  */
768
- async refreshLatestSummary(result, proposalHandle, summaryRefSeq, readAndParseBlob) {
777
+ async refreshLatestSummary(proposalHandle, result, readAndParseBlob) {
769
778
  // If the latest summary was updated and the summary was tracked, this client is the one that generated this
770
779
  // summary. So, update wasGCRunInLatestSummary.
771
780
  // Note that this has to be updated if GC did not run too. Otherwise, `gcStateNeedsReset` will always return
@@ -787,8 +796,8 @@ class GarbageCollector {
787
796
  return;
788
797
  }
789
798
  // If the summary was not tracked by this client, the state should be updated from the downloaded snapshot.
790
- const snapshot = result.snapshot;
791
- const metadataBlobId = snapshot.blobs[summaryFormat_1.metadataBlobName];
799
+ const snapshotTree = result.snapshotTree;
800
+ const metadataBlobId = snapshotTree.blobs[summaryFormat_1.metadataBlobName];
792
801
  if (metadataBlobId) {
793
802
  const metadata = await readAndParseBlob(metadataBlobId);
794
803
  this.latestSummaryGCVersion = (0, summaryFormat_1.getGCVersion)(metadata);
@@ -797,9 +806,9 @@ class GarbageCollector {
797
806
  // to be at least one op (summary op / ack, if nothing else) if a snapshot was taken.
798
807
  const currentReferenceTimestampMs = this.runtime.getCurrentReferenceTimestampMs();
799
808
  if (currentReferenceTimestampMs === undefined) {
800
- throw container_utils_1.DataProcessingError.create("No reference timestamp when updating GC state from snapshot", "refreshLatestSummary", undefined, { proposalHandle, summaryRefSeq, details: JSON.stringify(this.configs) });
809
+ throw container_utils_1.DataProcessingError.create("No reference timestamp when updating GC state from snapshot", "refreshLatestSummary", undefined, { proposalHandle, summaryRefSeq: result.summaryRefSeq, details: JSON.stringify(this.configs) });
801
810
  }
802
- const gcSnapshotTree = snapshot.trees[runtime_definitions_1.gcTreeKey];
811
+ const gcSnapshotTree = snapshotTree.trees[runtime_definitions_1.gcTreeKey];
803
812
  // If GC ran in the container that generated this snapshot, it will have a GC tree.
804
813
  this.wasGCRunInLatestSummary = gcSnapshotTree !== undefined;
805
814
  let latestGCData;