@fluidframework/container-runtime 2.0.0-dev-rc.5.0.0.271717 → 2.0.0-dev-rc.5.0.0.272251

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 (68) hide show
  1. package/api-extractor/api-extractor-lint-bundle.json +5 -0
  2. package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
  3. package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
  4. package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
  5. package/api-extractor/api-extractor-lint-public.esm.json +5 -0
  6. package/api-report/container-runtime.alpha.api.md +1 -1
  7. package/container-runtime.test-files.tar +0 -0
  8. package/dist/channelCollection.d.ts +12 -2
  9. package/dist/channelCollection.d.ts.map +1 -1
  10. package/dist/channelCollection.js +85 -87
  11. package/dist/channelCollection.js.map +1 -1
  12. package/dist/containerRuntime.d.ts +2 -1
  13. package/dist/containerRuntime.d.ts.map +1 -1
  14. package/dist/containerRuntime.js +25 -4
  15. package/dist/containerRuntime.js.map +1 -1
  16. package/dist/dataStoreContext.d.ts +2 -1
  17. package/dist/dataStoreContext.d.ts.map +1 -1
  18. package/dist/dataStoreContext.js +3 -2
  19. package/dist/dataStoreContext.js.map +1 -1
  20. package/dist/gc/garbageCollection.d.ts +4 -2
  21. package/dist/gc/garbageCollection.d.ts.map +1 -1
  22. package/dist/gc/garbageCollection.js +10 -6
  23. package/dist/gc/garbageCollection.js.map +1 -1
  24. package/dist/gc/gcDefinitions.d.ts +7 -4
  25. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  26. package/dist/gc/gcDefinitions.js.map +1 -1
  27. package/dist/gc/gcTelemetry.d.ts +1 -1
  28. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  29. package/dist/gc/gcTelemetry.js +0 -5
  30. package/dist/gc/gcTelemetry.js.map +1 -1
  31. package/dist/packageVersion.d.ts +1 -1
  32. package/dist/packageVersion.js +1 -1
  33. package/dist/packageVersion.js.map +1 -1
  34. package/lib/channelCollection.d.ts +12 -2
  35. package/lib/channelCollection.d.ts.map +1 -1
  36. package/lib/channelCollection.js +85 -87
  37. package/lib/channelCollection.js.map +1 -1
  38. package/lib/containerRuntime.d.ts +2 -1
  39. package/lib/containerRuntime.d.ts.map +1 -1
  40. package/lib/containerRuntime.js +26 -5
  41. package/lib/containerRuntime.js.map +1 -1
  42. package/lib/dataStoreContext.d.ts +2 -1
  43. package/lib/dataStoreContext.d.ts.map +1 -1
  44. package/lib/dataStoreContext.js +3 -2
  45. package/lib/dataStoreContext.js.map +1 -1
  46. package/lib/gc/garbageCollection.d.ts +4 -2
  47. package/lib/gc/garbageCollection.d.ts.map +1 -1
  48. package/lib/gc/garbageCollection.js +10 -6
  49. package/lib/gc/garbageCollection.js.map +1 -1
  50. package/lib/gc/gcDefinitions.d.ts +7 -4
  51. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  52. package/lib/gc/gcDefinitions.js.map +1 -1
  53. package/lib/gc/gcTelemetry.d.ts +1 -1
  54. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  55. package/lib/gc/gcTelemetry.js +0 -5
  56. package/lib/gc/gcTelemetry.js.map +1 -1
  57. package/lib/packageVersion.d.ts +1 -1
  58. package/lib/packageVersion.js +1 -1
  59. package/lib/packageVersion.js.map +1 -1
  60. package/package.json +27 -18
  61. package/src/channelCollection.ts +133 -123
  62. package/src/containerRuntime.ts +31 -4
  63. package/src/dataStoreContext.ts +3 -2
  64. package/src/gc/garbageCollection.ts +24 -7
  65. package/src/gc/gcDefinitions.ts +16 -4
  66. package/src/gc/gcTelemetry.ts +1 -7
  67. package/src/packageVersion.ts +1 -1
  68. package/tsdoc.json +4 -0
@@ -13,7 +13,7 @@ import { FlushMode, FlushModeExperimental, channelsTreeName, gcTreeKey, } from "
13
13
  import { GCDataBuilder, RequestParser, TelemetryContext, addBlobToSummary, addSummarizeResultToSummary, calculateStats, create404Response, exceptionToResponse, responseToException, seqFromTree, } from "@fluidframework/runtime-utils/internal";
14
14
  import { DataCorruptionError, DataProcessingError, GenericError, LoggingError, PerformanceEvent,
15
15
  // eslint-disable-next-line import/no-deprecated
16
- TaggedLoggerAdapter, UsageError, createChildLogger, createChildMonitoringContext, createSampledLogger, loggerToMonitoringContext, raiseConnectedEvent, wrapError, } from "@fluidframework/telemetry-utils/internal";
16
+ TaggedLoggerAdapter, UsageError, createChildLogger, createChildMonitoringContext, createSampledLogger, loggerToMonitoringContext, raiseConnectedEvent, wrapError, tagCodeArtifacts, } from "@fluidframework/telemetry-utils/internal";
17
17
  import { v4 as uuid } from "uuid";
18
18
  import { BindBatchTracker } from "./batchTracker.js";
19
19
  import { BlobManager } from "./blobManager.js";
@@ -769,7 +769,10 @@ export class ContainerRuntime extends TypedEventEmitter {
769
769
  snapshotTree: snapshot,
770
770
  };
771
771
  }
772
- this.channelCollection = new ChannelCollection(snapshot, parentContext, this.mc.logger, (props) => this.garbageCollector.nodeUpdated(props), (path) => this.garbageCollector.isNodeDeleted(path), new Map(dataStoreAliasMap), async (runtime) => provideEntryPoint);
772
+ this.channelCollection = new ChannelCollection(snapshot, parentContext, this.mc.logger, (props) => this.garbageCollector.nodeUpdated({
773
+ ...props,
774
+ timestampMs: props.timestampMs ?? this.getCurrentReferenceTimestampMs(),
775
+ }), (path) => this.garbageCollector.isNodeDeleted(path), new Map(dataStoreAliasMap), async (runtime) => provideEntryPoint);
773
776
  this.blobManager = new BlobManager({
774
777
  routeContext: this.handleContext,
775
778
  snapshot: blobManagerSnapshot,
@@ -785,6 +788,7 @@ export class ContainerRuntime extends TypedEventEmitter {
785
788
  blobRequested: (blobPath) => this.garbageCollector.nodeUpdated({
786
789
  node: { type: "Blob", path: blobPath },
787
790
  reason: "Loaded",
791
+ timestampMs: this.getCurrentReferenceTimestampMs(),
788
792
  }),
789
793
  isBlobDeleted: (blobPath) => this.garbageCollector.isNodeDeleted(blobPath),
790
794
  runtime: this,
@@ -1565,7 +1569,7 @@ export class ContainerRuntime extends TypedEventEmitter {
1565
1569
  }
1566
1570
  break;
1567
1571
  case ContainerMessageType.GC:
1568
- this.garbageCollector.processMessage(messageWithContext.message, local);
1572
+ this.garbageCollector.processMessage(messageWithContext.message, messageWithContext.message.timestamp, local);
1569
1573
  break;
1570
1574
  case ContainerMessageType.ChunkedOp:
1571
1575
  // From observability POV, we should not exppse the rest of the system (including "op" events on object) to these messages.
@@ -1749,6 +1753,7 @@ export class ContainerRuntime extends TypedEventEmitter {
1749
1753
  node: { type: "DataStore", path: `/${internalId}` },
1750
1754
  reason: "Loaded",
1751
1755
  packagePath: context.packagePath,
1756
+ timestampMs: this.getCurrentReferenceTimestampMs(),
1752
1757
  });
1753
1758
  return channel.entryPoint;
1754
1759
  }
@@ -2056,9 +2061,25 @@ export class ContainerRuntime extends TypedEventEmitter {
2056
2061
  * all references added in the system.
2057
2062
  * @param fromPath - The absolute path of the node that added the reference.
2058
2063
  * @param toPath - The absolute path of the outbound node that is referenced.
2064
+ * @param messageTimestampMs - The timestamp of the message that added the reference.
2059
2065
  */
2060
- addedGCOutboundRoute(fromPath, toPath) {
2061
- this.garbageCollector.addedOutboundReference(fromPath, toPath);
2066
+ addedGCOutboundRoute(fromPath, toPath, messageTimestampMs) {
2067
+ // This is always called when processing an op so messageTimestampMs should exist. Due to back-compat
2068
+ // across the data store runtime / container runtime boundary, this may be undefined and if so, get
2069
+ // the timestamp from the last processed message which should exist.
2070
+ // If a timestamp doesn't exist, log so we can learn about these cases and return.
2071
+ const timestampMs = messageTimestampMs ?? this.getCurrentReferenceTimestampMs();
2072
+ if (timestampMs === undefined) {
2073
+ this.mc.logger.sendTelemetryEvent({
2074
+ eventName: "NoTimestampInGCOutboundRoute",
2075
+ ...tagCodeArtifacts({
2076
+ id: toPath,
2077
+ fromId: fromPath,
2078
+ }),
2079
+ });
2080
+ return;
2081
+ }
2082
+ this.garbageCollector.addedOutboundReference(fromPath, toPath, timestampMs);
2062
2083
  }
2063
2084
  /**
2064
2085
  * Generates the summary tree, uploads it to storage, and then submits the summarize op.