@fluidframework/container-runtime 2.0.0-internal.6.4.0 → 2.0.0-internal.7.0.1

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 (223) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/dist/blobManager.d.ts +3 -6
  3. package/dist/blobManager.d.ts.map +1 -1
  4. package/dist/blobManager.js +23 -48
  5. package/dist/blobManager.js.map +1 -1
  6. package/dist/containerHandleContext.js +3 -3
  7. package/dist/containerHandleContext.js.map +1 -1
  8. package/dist/containerRuntime.d.ts +13 -14
  9. package/dist/containerRuntime.d.ts.map +1 -1
  10. package/dist/containerRuntime.js +253 -237
  11. package/dist/containerRuntime.js.map +1 -1
  12. package/dist/dataStore.js +9 -9
  13. package/dist/dataStore.js.map +1 -1
  14. package/dist/dataStoreContext.d.ts +2 -3
  15. package/dist/dataStoreContext.d.ts.map +1 -1
  16. package/dist/dataStoreContext.js +88 -87
  17. package/dist/dataStoreContext.js.map +1 -1
  18. package/dist/dataStoreRegistry.js +3 -3
  19. package/dist/dataStoreRegistry.js.map +1 -1
  20. package/dist/dataStores.d.ts +0 -16
  21. package/dist/dataStores.d.ts.map +1 -1
  22. package/dist/dataStores.js +0 -48
  23. package/dist/dataStores.js.map +1 -1
  24. package/dist/deltaManagerProxyBase.js +4 -4
  25. package/dist/deltaManagerProxyBase.js.map +1 -1
  26. package/dist/deltaManagerSummarizerProxy.js +6 -6
  27. package/dist/deltaManagerSummarizerProxy.js.map +1 -1
  28. package/dist/deltaScheduler.js.map +1 -1
  29. package/dist/gc/garbageCollection.d.ts +12 -3
  30. package/dist/gc/garbageCollection.d.ts.map +1 -1
  31. package/dist/gc/garbageCollection.js +54 -31
  32. package/dist/gc/garbageCollection.js.map +1 -1
  33. package/dist/gc/gcConfigs.d.ts +1 -0
  34. package/dist/gc/gcConfigs.d.ts.map +1 -1
  35. package/dist/gc/gcConfigs.js +12 -2
  36. package/dist/gc/gcConfigs.js.map +1 -1
  37. package/dist/gc/gcDefinitions.d.ts +25 -22
  38. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  39. package/dist/gc/gcDefinitions.js.map +1 -1
  40. package/dist/gc/gcTelemetry.d.ts +13 -7
  41. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  42. package/dist/gc/gcTelemetry.js +74 -42
  43. package/dist/gc/gcTelemetry.js.map +1 -1
  44. package/dist/gc/gcUnreferencedStateTracker.js +3 -3
  45. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  46. package/dist/gc/index.d.ts +2 -2
  47. package/dist/gc/index.d.ts.map +1 -1
  48. package/dist/gc/index.js +1 -5
  49. package/dist/gc/index.js.map +1 -1
  50. package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
  51. package/dist/id-compressor/idCompressor.js.map +1 -1
  52. package/dist/id-compressor/identifiers.d.ts +3 -3
  53. package/dist/id-compressor/identifiers.d.ts.map +1 -1
  54. package/dist/messageTypes.d.ts +17 -17
  55. package/dist/messageTypes.d.ts.map +1 -1
  56. package/dist/messageTypes.js +1 -1
  57. package/dist/messageTypes.js.map +1 -1
  58. package/dist/opLifecycle/batchManager.js +6 -6
  59. package/dist/opLifecycle/batchManager.js.map +1 -1
  60. package/dist/opLifecycle/definitions.d.ts +2 -2
  61. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  62. package/dist/packageVersion.d.ts +1 -1
  63. package/dist/packageVersion.js +1 -1
  64. package/dist/packageVersion.js.map +1 -1
  65. package/dist/pendingStateManager.d.ts +3 -19
  66. package/dist/pendingStateManager.d.ts.map +1 -1
  67. package/dist/pendingStateManager.js +20 -39
  68. package/dist/pendingStateManager.js.map +1 -1
  69. package/dist/summary/orderedClientElection.d.ts +3 -3
  70. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  71. package/dist/summary/orderedClientElection.js +54 -54
  72. package/dist/summary/orderedClientElection.js.map +1 -1
  73. package/dist/summary/runWhileConnectedCoordinator.js +6 -6
  74. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  75. package/dist/summary/runningSummarizer.js +37 -37
  76. package/dist/summary/runningSummarizer.js.map +1 -1
  77. package/dist/summary/summarizer.d.ts.map +1 -1
  78. package/dist/summary/summarizer.js +8 -6
  79. package/dist/summary/summarizer.js.map +1 -1
  80. package/dist/summary/summarizerClientElection.js +6 -6
  81. package/dist/summary/summarizerClientElection.js.map +1 -1
  82. package/dist/summary/summarizerHeuristics.js +9 -9
  83. package/dist/summary/summarizerHeuristics.js.map +1 -1
  84. package/dist/summary/summarizerNode/summarizerNode.js +7 -7
  85. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  86. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
  87. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  88. package/dist/summary/summarizerNode/summarizerNodeUtils.js +3 -3
  89. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  90. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
  91. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  92. package/dist/summary/summarizerTypes.d.ts +12 -12
  93. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  94. package/dist/summary/summaryCollection.d.ts +2 -2
  95. package/dist/summary/summaryCollection.d.ts.map +1 -1
  96. package/dist/summary/summaryCollection.js +21 -21
  97. package/dist/summary/summaryCollection.js.map +1 -1
  98. package/dist/summary/summaryFormat.d.ts +5 -5
  99. package/dist/summary/summaryFormat.d.ts.map +1 -1
  100. package/dist/summary/summaryGenerator.d.ts +3 -3
  101. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  102. package/dist/summary/summaryManager.js +7 -7
  103. package/dist/summary/summaryManager.js.map +1 -1
  104. package/dist/throttler.js +16 -16
  105. package/dist/throttler.js.map +1 -1
  106. package/dist/tsdoc-metadata.json +1 -1
  107. package/lib/blobManager.d.ts +3 -6
  108. package/lib/blobManager.d.ts.map +1 -1
  109. package/lib/blobManager.js +24 -49
  110. package/lib/blobManager.js.map +1 -1
  111. package/lib/containerHandleContext.js +3 -3
  112. package/lib/containerHandleContext.js.map +1 -1
  113. package/lib/containerRuntime.d.ts +13 -14
  114. package/lib/containerRuntime.d.ts.map +1 -1
  115. package/lib/containerRuntime.js +249 -235
  116. package/lib/containerRuntime.js.map +1 -1
  117. package/lib/dataStore.js +9 -9
  118. package/lib/dataStore.js.map +1 -1
  119. package/lib/dataStoreContext.d.ts +2 -3
  120. package/lib/dataStoreContext.d.ts.map +1 -1
  121. package/lib/dataStoreContext.js +89 -88
  122. package/lib/dataStoreContext.js.map +1 -1
  123. package/lib/dataStoreRegistry.js +3 -3
  124. package/lib/dataStoreRegistry.js.map +1 -1
  125. package/lib/dataStores.d.ts +0 -16
  126. package/lib/dataStores.d.ts.map +1 -1
  127. package/lib/dataStores.js +2 -50
  128. package/lib/dataStores.js.map +1 -1
  129. package/lib/deltaManagerProxyBase.js +4 -4
  130. package/lib/deltaManagerProxyBase.js.map +1 -1
  131. package/lib/deltaManagerSummarizerProxy.js +6 -6
  132. package/lib/deltaManagerSummarizerProxy.js.map +1 -1
  133. package/lib/deltaScheduler.js.map +1 -1
  134. package/lib/gc/garbageCollection.d.ts +12 -3
  135. package/lib/gc/garbageCollection.d.ts.map +1 -1
  136. package/lib/gc/garbageCollection.js +55 -32
  137. package/lib/gc/garbageCollection.js.map +1 -1
  138. package/lib/gc/gcConfigs.d.ts +1 -0
  139. package/lib/gc/gcConfigs.d.ts.map +1 -1
  140. package/lib/gc/gcConfigs.js +14 -4
  141. package/lib/gc/gcConfigs.js.map +1 -1
  142. package/lib/gc/gcDefinitions.d.ts +25 -22
  143. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  144. package/lib/gc/gcDefinitions.js.map +1 -1
  145. package/lib/gc/gcTelemetry.d.ts +13 -7
  146. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  147. package/lib/gc/gcTelemetry.js +74 -42
  148. package/lib/gc/gcTelemetry.js.map +1 -1
  149. package/lib/gc/gcUnreferencedStateTracker.js +3 -3
  150. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  151. package/lib/gc/index.d.ts +2 -2
  152. package/lib/gc/index.d.ts.map +1 -1
  153. package/lib/gc/index.js +2 -2
  154. package/lib/gc/index.js.map +1 -1
  155. package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
  156. package/lib/id-compressor/idCompressor.js.map +1 -1
  157. package/lib/id-compressor/identifiers.d.ts +3 -3
  158. package/lib/id-compressor/identifiers.d.ts.map +1 -1
  159. package/lib/messageTypes.d.ts +17 -17
  160. package/lib/messageTypes.d.ts.map +1 -1
  161. package/lib/opLifecycle/batchManager.js +6 -6
  162. package/lib/opLifecycle/batchManager.js.map +1 -1
  163. package/lib/opLifecycle/definitions.d.ts +2 -2
  164. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  165. package/lib/packageVersion.d.ts +1 -1
  166. package/lib/packageVersion.js +1 -1
  167. package/lib/packageVersion.js.map +1 -1
  168. package/lib/pendingStateManager.d.ts +3 -19
  169. package/lib/pendingStateManager.d.ts.map +1 -1
  170. package/lib/pendingStateManager.js +20 -39
  171. package/lib/pendingStateManager.js.map +1 -1
  172. package/lib/summary/orderedClientElection.d.ts +3 -3
  173. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  174. package/lib/summary/orderedClientElection.js +54 -54
  175. package/lib/summary/orderedClientElection.js.map +1 -1
  176. package/lib/summary/runWhileConnectedCoordinator.js +6 -6
  177. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  178. package/lib/summary/runningSummarizer.js +37 -37
  179. package/lib/summary/runningSummarizer.js.map +1 -1
  180. package/lib/summary/summarizer.d.ts.map +1 -1
  181. package/lib/summary/summarizer.js +8 -6
  182. package/lib/summary/summarizer.js.map +1 -1
  183. package/lib/summary/summarizerClientElection.js +6 -6
  184. package/lib/summary/summarizerClientElection.js.map +1 -1
  185. package/lib/summary/summarizerHeuristics.js +9 -9
  186. package/lib/summary/summarizerHeuristics.js.map +1 -1
  187. package/lib/summary/summarizerNode/summarizerNode.js +7 -7
  188. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  189. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
  190. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  191. package/lib/summary/summarizerNode/summarizerNodeUtils.js +3 -3
  192. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  193. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
  194. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  195. package/lib/summary/summarizerTypes.d.ts +12 -12
  196. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  197. package/lib/summary/summaryCollection.d.ts +2 -2
  198. package/lib/summary/summaryCollection.d.ts.map +1 -1
  199. package/lib/summary/summaryCollection.js +21 -21
  200. package/lib/summary/summaryCollection.js.map +1 -1
  201. package/lib/summary/summaryFormat.d.ts +5 -5
  202. package/lib/summary/summaryFormat.d.ts.map +1 -1
  203. package/lib/summary/summaryGenerator.d.ts +3 -3
  204. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  205. package/lib/summary/summaryManager.js +6 -6
  206. package/lib/summary/summaryManager.js.map +1 -1
  207. package/lib/throttler.js +16 -16
  208. package/lib/throttler.js.map +1 -1
  209. package/package.json +53 -21
  210. package/src/blobManager.ts +18 -58
  211. package/src/containerRuntime.ts +68 -49
  212. package/src/dataStore.ts +1 -1
  213. package/src/dataStoreContext.ts +18 -14
  214. package/src/dataStores.ts +2 -80
  215. package/src/gc/garbageCollection.ts +53 -24
  216. package/src/gc/gcConfigs.ts +22 -4
  217. package/src/gc/gcDefinitions.ts +23 -20
  218. package/src/gc/gcEarlyAdoption.md +1 -1
  219. package/src/gc/gcTelemetry.ts +103 -56
  220. package/src/gc/index.ts +0 -4
  221. package/src/packageVersion.ts +1 -1
  222. package/src/pendingStateManager.ts +7 -46
  223. package/src/summary/summarizer.ts +3 -1
@@ -3,13 +3,14 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { ICriticalContainerError } from "@fluidframework/container-definitions";
6
- import { IRequestHeader } from "@fluidframework/core-interfaces";
6
+ import { IRequest } from "@fluidframework/core-interfaces";
7
7
  import { ISnapshotTree } from "@fluidframework/protocol-definitions";
8
8
  import { IGarbageCollectionData, IGarbageCollectionDetailsBase, ISummarizeResult, ITelemetryContext } from "@fluidframework/runtime-definitions";
9
9
  import { ReadAndParseBlob } from "@fluidframework/runtime-utils";
10
10
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
11
11
  import { IContainerRuntimeMetadata, ICreateContainerMetadata, IRefreshSummaryResult } from "../summary";
12
- export declare type GCVersion = number;
12
+ import { RuntimeHeaderData } from "../containerRuntime";
13
+ export type GCVersion = number;
13
14
  /** The stable/default version of GC Data */
14
15
  export declare const stableGCVersion: GCVersion;
15
16
  /** The next version of GC Data, to bump to in case we need to regenerate all GC Data across all files. */
@@ -138,7 +139,7 @@ export declare const GCNodeType: {
138
139
  Blob: string;
139
140
  Other: string;
140
141
  };
141
- export declare type GCNodeType = typeof GCNodeType[keyof typeof GCNodeType];
142
+ export type GCNodeType = typeof GCNodeType[keyof typeof GCNodeType];
142
143
  /**
143
144
  * Defines the APIs for the runtime object to be passed to the garbage collector.
144
145
  */
@@ -165,8 +166,6 @@ export interface IGarbageCollectionRuntime {
165
166
  getNodeType(nodePath: string): GCNodeType;
166
167
  /** Called when the runtime should close because of an error. */
167
168
  closeFn: (error?: ICriticalContainerError) => void;
168
- /** If false, loading or using a Tombstoned object should merely log, not fail */
169
- gcTombstoneEnforcementAllowed: boolean;
170
169
  }
171
170
  /** Defines the contract for the garbage collector. */
172
171
  export interface IGarbageCollector {
@@ -176,6 +175,12 @@ export interface IGarbageCollector {
176
175
  readonly summaryStateNeedsReset: boolean;
177
176
  /** The count of data stores whose GC state updated since the last summary. */
178
177
  readonly updatedDSCountSinceLastSummary: number;
178
+ /** Tells whether tombstone feature is enabled and enforced. */
179
+ readonly tombstoneEnforcementAllowed: boolean;
180
+ /** Tells whether loading a tombstone object should fail or merely log. */
181
+ readonly throwOnTombstoneLoad: boolean;
182
+ /** Tells whether using a tombstone object should fail or merely log. */
183
+ readonly throwOnTombstoneUsage: boolean;
179
184
  /** Initialize the state from the base snapshot after its creation. */
180
185
  initializeBaseState(): Promise<void>;
181
186
  /** Run garbage collection and update the reference / used state of the system. */
@@ -192,8 +197,11 @@ export interface IGarbageCollector {
192
197
  getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
193
198
  /** Called when the latest summary of the system has been refreshed. */
194
199
  refreshLatestSummary(result: IRefreshSummaryResult): Promise<void>;
195
- /** Called when a node is updated. Used to detect and log when an inactive node is changed or loaded. */
196
- nodeUpdated(nodePath: string, reason: "Loaded" | "Changed", timestampMs?: number, packagePath?: readonly string[], requestHeaders?: IRequestHeader): void;
200
+ /**
201
+ * Called when a node with the given path is updated. If the node is inactive or tombstoned, this will log an error
202
+ * or throw an error if failing on incorrect usage is configured.
203
+ */
204
+ nodeUpdated(nodePath: string, reason: "Loaded" | "Changed", timestampMs?: number, packagePath?: readonly string[], request?: IRequest, headerData?: RuntimeHeaderData): void;
197
205
  /** Called when a reference is added to a node. Used to identify nodes that were referenced between summaries. */
198
206
  addedOutboundReference(fromNodePath: string, toNodePath: string): void;
199
207
  /** Returns true if this node has been deleted by GC during sweep phase. */
@@ -223,22 +231,11 @@ export interface IGCRuntimeOptions {
223
231
  * GC has mark phase and sweep phase. In mark phase, unreferenced objects are identified
224
232
  * and marked as such in the summary. This option enables the mark phase.
225
233
  * In sweep phase, unreferenced objects are eventually deleted from the container if they meet certain conditions.
226
- * Sweep phase can be enabled via the "sweepAllowed" option.
234
+ * Sweep phase can be enabled using the "gcSweepGeneration" option.
227
235
  *
228
236
  * Note: This setting is persisted in the container's summary and cannot be changed.
229
237
  */
230
238
  gcAllowed?: boolean;
231
- /**
232
- * @deprecated - @see gcSweepGenerationOptionName and @see GCFeatureMatrix.sweepGeneration
233
- *
234
- * Flag that if true, enables GC's sweep phase for a new container.
235
- *
236
- * This will allow GC to eventually delete unreferenced objects from the container.
237
- * This flag should only be set to true if "gcAllowed" is true.
238
- *
239
- * Note: This setting is persisted in the container's summary and cannot be changed.
240
- */
241
- sweepAllowed?: boolean;
242
239
  /**
243
240
  * Flag that if true, will disable garbage collection for the session.
244
241
  * Can be used to disable running GC on containers where it is allowed via the gcAllowed option.
@@ -294,8 +291,6 @@ export interface IGarbageCollectorConfigs {
294
291
  readonly sweepTimeoutMs: number | undefined;
295
292
  /** The time after which an unreferenced node is inactive. */
296
293
  readonly inactiveTimeoutMs: number;
297
- /** It is easier for users to diagnose InactiveObject usage if we throw on load, which this option enables */
298
- readonly throwOnInactiveLoad: boolean | undefined;
299
294
  /** Tracks whether GC should run in test mode. In this mode, unreferenced objects are deleted immediately. */
300
295
  readonly testMode: boolean;
301
296
  /**
@@ -311,6 +306,14 @@ export interface IGarbageCollectorConfigs {
311
306
  readonly gcVersionInBaseSnapshot: GCVersion | undefined;
312
307
  /** The current version of GC data in the running code */
313
308
  readonly gcVersionInEffect: GCVersion;
309
+ /** It is easier for users to diagnose InactiveObject usage if we throw on load, which this option enables */
310
+ readonly throwOnInactiveLoad: boolean | undefined;
311
+ /** If false, loading or using a Tombstoned object should merely log, not fail */
312
+ readonly tombstoneEnforcementAllowed: boolean;
313
+ /** If true, throw an error when a tombstone data store is retrieved */
314
+ readonly throwOnTombstoneLoad: boolean;
315
+ /** If true, throw an error when a tombstone data store is used. */
316
+ readonly throwOnTombstoneUsage: boolean;
314
317
  }
315
318
  /** The state of node that is unreferenced. */
316
319
  export declare const UnreferencedState: {
@@ -321,7 +324,7 @@ export declare const UnreferencedState: {
321
324
  /** The node is ready to be deleted by the sweep phase. */
322
325
  readonly SweepReady: "SweepReady";
323
326
  };
324
- export declare type UnreferencedState = typeof UnreferencedState[keyof typeof UnreferencedState];
327
+ export type UnreferencedState = typeof UnreferencedState[keyof typeof UnreferencedState];
325
328
  /**
326
329
  * Represents the result of a GC run.
327
330
  */
@@ -1 +1 @@
1
- {"version":3,"file":"gcDefinitions.d.ts","sourceRoot":"","sources":["../../src/gc/gcDefinitions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EACN,sBAAsB,EACtB,6BAA6B,EAC7B,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EACN,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,MAAM,YAAY,CAAC;AAEpB,oBAAY,SAAS,GAAG,MAAM,CAAC;AAE/B,4CAA4C;AAC5C,eAAO,MAAM,eAAe,EAAE,SAAa,CAAC;AAC5C,0GAA0G;AAC1G,eAAO,MAAM,aAAa,EAAE,SAAa,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,0BAA0B,CAAC;AACvE;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,sBAAsB,CAAC;AAE/D,sCAAsC;AACtC,eAAO,MAAM,QAAQ,kCAAkC,CAAC;AACxD,4CAA4C;AAC5C,eAAO,MAAM,WAAW,qCAAqC,CAAC;AAC9D,gDAAgD;AAChD,eAAO,MAAM,aAAa,uCAAuC,CAAC;AAClE,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,6CAA6C,CAAC;AAC9E,2CAA2C;AAC3C,eAAO,MAAM,kBAAkB,4CAA4C,CAAC;AAC5E,mHAAmH;AACnH,eAAO,MAAM,mBAAmB,6CAA6C,CAAC;AAC9E,0F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wB,GAAG,CAAC,GAAG,gBAAQ,CAAC;AAExC,QAAA,wBAAwB,GAAG,CAAC,GAAG,gBAAQ,CAAC,CAAC,SAAS;AAClD,QAAA,8BAA8B,GAAG,EAAE,GAAG,gBAAQ,CAAC,CAAC,UAAU;AA4EvE,uDAAuD;AAC1C,QAAA,UAAU,GAAG;IACzB,kCAAkC;IAClC,SAAS,EAAE,WAAW;IACtB,8DAA8D;IAC9D,YAAY,EAAE,cAAc;IAC5B,6EAA6E;IAC7E,IAAI,EAAE,MAAM;IACZ,+DAA+D;IAC/D,KAAK,EAAE,OAAO;CACd,CAAC;AAuMF,8CAA8C;AACjC,QAAA,iBAAiB,GAAG;IAChC,gEAAgE;IAChE,MAAM,EAAE,QAAQ;IAChB,mEAAmE;IACnE,QAAQ,EAAE,UAAU;IACpB,0DAA0D;IAC1D,UAAU,EAAE,YAAY;CACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { IRequestHeader } from \"@fluidframework/core-interfaces\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n\tISummarizeResult,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { ReadAndParseBlob } from \"@fluidframework/runtime-utils\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport {\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tIRefreshSummaryResult,\n} from \"../summary\";\n\nexport type GCVersion = number;\n\n/** The stable/default version of GC Data */\nexport const stableGCVersion: GCVersion = 3;\n/** The next version of GC Data, to bump to in case we need to regenerate all GC Data across all files. */\nexport const nextGCVersion: GCVersion = 4;\n\n/**\n * This undocumented GC Option (on ContainerRuntime Options) allows an app to disable enforcing GC on old documents by incrementing this value\n *\n * If unset, GC Tombstone phase will operate as otherwise configured\n * Otherwise, only enforce GC Tombstone if the passed in value matches the persisted value\n */\nexport const gcTombstoneGenerationOptionName = \"gcTombstoneGeneration\";\n/**\n * This GC Option (on ContainerRuntime Options) allows an app to disable GC Sweep on old documents by incrementing this value.\n *\n * If unset altogether, Sweep will be disabled.\n * If 0 is passed in, Sweep will be enabled for any document with gcSweepGeneration OR gcTombstoneGeneration as 0.\n * If any other number is passed in, Sweep will be enabled only for documents with the same value persisted.\n */\nexport const gcSweepGenerationOptionName = \"gcSweepGeneration\";\n\n/** Config key to turn GC on / off. */\nexport const runGCKey = \"Fluid.GarbageCollection.RunGC\";\n/** Config key to turn GC sweep on / off. */\nexport const runSweepKey = \"Fluid.GarbageCollection.RunSweep\";\n/** Config key to turn GC test mode on / off. */\nexport const gcTestModeKey = \"Fluid.GarbageCollection.GCTestMode\";\n/** Config key to expire a session after a set period of time. Defaults to true. */\nexport const runSessionExpiryKey = \"Fluid.GarbageCollection.RunSessionExpiry\";\n/** Config key to turn GC sweep log off. */\nexport const disableSweepLogKey = \"Fluid.GarbageCollection.DisableSweepLog\";\n/** Config key to disable the tombstone feature, i.e., tombstone information is not read / written into summary. */\nexport const disableTombstoneKey = \"Fluid.GarbageCollection.DisableTombstone\";\n/** Config key to enable throwing an error when tombstone object is loaded (requested). */\nexport const throwOnTombstoneLoadKey = \"Fluid.GarbageCollection.ThrowOnTombstoneLoad\";\n/** Config key to enable throwing an error when tombstone object is used (e.g. outgoing or incoming ops). */\nexport const throwOnTombstoneUsageKey = \"Fluid.GarbageCollection.ThrowOnTombstoneUsage\";\n/** Config key to enable GC version upgrade. */\nexport const gcVersionUpgradeToV4Key = \"Fluid.GarbageCollection.GCVersionUpgradeToV4\";\n/** Config key to disable GC sweep for datastores. */\nexport const disableDatastoreSweepKey = \"Fluid.GarbageCollection.DisableDataStoreSweep\";\n/** Config key to disable GC sweep for attachment blobs. */\nexport const disableAttachmentBlobSweepKey = \"Fluid.GarbageCollection.DisableAttachmentBlobSweep\";\n\n// One day in milliseconds.\nexport const oneDayMs = 1 * 24 * 60 * 60 * 1000;\n\n/**\n * The maximum snapshot cache expiry in the driver. This is used to calculate the sweep timeout.\n * Sweep timeout = session expiry timeout + snapshot cache expiry timeout + a buffer.\n * The snapshot cache expiry timeout cannot be known precisely but the upper bound is 5 days, i.e., any snapshot\n * in cache will be invalidated before 5 days.\n */\nexport const maxSnapshotCacheExpiryMs = 5 * oneDayMs;\n\nexport const defaultInactiveTimeoutMs = 7 * oneDayMs; // 7 days\nexport const defaultSessionExpiryDurationMs = 30 * oneDayMs; // 30 days\n\n/** @see IGCMetadata.gcFeatureMatrix */\nexport interface GCFeatureMatrix {\n\t/**\n\t * The Tombstone Generation value in effect when this file was created.\n\t * Gives a way for an app to disqualify old files from GC Tombstone enforcement.\n\t * Provided via Container Runtime Options.\n\t */\n\ttombstoneGeneration?: number;\n\t/**\n\t * The Sweep Generation value in effect when this file was created.\n\t * Gives a way for an app to disqualify old files from GC Sweep.\n\t * Provided via Container Runtime Options.\n\t */\n\tsweepGeneration?: number;\n}\n\nexport interface IGCMetadata {\n\t/**\n\t * The version of the GC code that was run to generate the GC data that is written in the summary.\n\t * If the persisted value doesn't match the current value in the code, saved GC data will be discarded and regenerated from scratch.\n\t * Also, used to determine whether GC is enabled for this container or not:\n\t * - A value of 0 or undefined means GC is disabled.\n\t * - A value greater than 0 means GC is enabled.\n\t */\n\treadonly gcFeature?: GCVersion;\n\n\t/**\n\t * A collection of different numerical \"Generations\" for different features,\n\t * used to determine feature availability over time.\n\t * This info may come from multiple sources (FF code, config service, app via Container Runtime Options),\n\t * and pertains to aspects of the document that may be fixed for its lifetime.\n\t *\n\t * For each dimension, if the persisted value doesn't match the currently provided value,\n\t * then this file does not support the corresponding feature as currently implemented.\n\t *\n\t * Guidance is that if no value is provided at runtime, it should result in the current default behavior.\n\t */\n\treadonly gcFeatureMatrix?: GCFeatureMatrix;\n\t/**\n\t * @deprecated - @see GCFeatureMatrix.sweepGeneration\n\t *\n\t * Tells whether the GC sweep phase is enabled for this container.\n\t * - True means sweep phase is enabled.\n\t * - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.\n\t */\n\treadonly sweepEnabled?: boolean;\n\t/** If this is present, the session for this container will expire after this time and the container will close */\n\treadonly sessionExpiryTimeoutMs?: number;\n\t/** How long to wait after an object is unreferenced before deleting it via GC Sweep */\n\treadonly sweepTimeoutMs?: number;\n}\n\n/** The statistics of the system state after a garbage collection run. */\nexport interface IGCStats {\n\t/** The number of nodes in the container. */\n\tnodeCount: number;\n\t/** The number of data stores in the container. */\n\tdataStoreCount: number;\n\t/** The number of attachment blobs in the container. */\n\tattachmentBlobCount: number;\n\t/** The number of unreferenced nodes in the container. */\n\tunrefNodeCount: number;\n\t/** The number of unreferenced data stores in the container. */\n\tunrefDataStoreCount: number;\n\t/** The number of unreferenced attachment blobs in the container. */\n\tunrefAttachmentBlobCount: number;\n\t/** The number of nodes whose reference state updated since last GC run. */\n\tupdatedNodeCount: number;\n\t/** The number of data stores whose reference state updated since last GC run. */\n\tupdatedDataStoreCount: number;\n\t/** The number of attachment blobs whose reference state updated since last GC run. */\n\tupdatedAttachmentBlobCount: number;\n}\n\n/** The types of GC nodes in the GC reference graph. */\nexport const GCNodeType = {\n\t// Nodes that are for data stores.\n\tDataStore: \"DataStore\",\n\t// Nodes that are within a data store. For example, DDS nodes.\n\tSubDataStore: \"SubDataStore\",\n\t// Nodes that are for attachment blobs, i.e., blobs uploaded via BlobManager.\n\tBlob: \"Blob\",\n\t// Nodes that are neither of the above. For example, root node.\n\tOther: \"Other\",\n};\nexport type GCNodeType = typeof GCNodeType[keyof typeof GCNodeType];\n\n/**\n * Defines the APIs for the runtime object to be passed to the garbage collector.\n */\nexport interface IGarbageCollectionRuntime {\n\t/** Before GC runs, called to notify the runtime to update any pending GC state. */\n\tupdateStateBeforeGC(): Promise<void>;\n\t/** Returns the garbage collection data of the runtime. */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\t/** After GC has run, called to notify the runtime of routes that are used in it. */\n\tupdateUsedRoutes(usedRoutes: string[]): void;\n\t/** After GC has run, called to notify the runtime of routes that are unused in it. */\n\tupdateUnusedRoutes(unusedRoutes: string[]): void;\n\t/**\n\t * After GC has run and identified nodes that are sweep ready, called to delete the sweep ready nodes. The runtime\n\t * should return the routes of nodes that were deleted.\n\t * @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.\n\t */\n\tdeleteSweepReadyNodes(sweepReadyRoutes: string[]): string[];\n\t/** Called to notify the runtime of routes that are tombstones. */\n\tupdateTombstonedRoutes(tombstoneRoutes: string[]): void;\n\t/** Returns a referenced timestamp to be used to track unreferenced nodes. */\n\tgetCurrentReferenceTimestampMs(): number | undefined;\n\t/** Returns the type of the GC node. */\n\tgetNodeType(nodePath: string): GCNodeType;\n\t/** Called when the runtime should close because of an error. */\n\tcloseFn: (error?: ICriticalContainerError) => void;\n\t/** If false, loading or using a Tombstoned object should merely log, not fail */\n\tgcTombstoneEnforcementAllowed: boolean;\n}\n\n/** Defines the contract for the garbage collector. */\nexport interface IGarbageCollector {\n\t/** Tells whether GC should run or not. */\n\treadonly shouldRunGC: boolean;\n\t/** Tells whether the GC state in summary needs to be reset in the next summary. */\n\treadonly summaryStateNeedsReset: boolean;\n\t/** The count of data stores whose GC state updated since the last summary. */\n\treadonly updatedDSCountSinceLastSummary: number;\n\t/** Initialize the state from the base snapshot after its creation. */\n\tinitializeBaseState(): Promise<void>;\n\t/** Run garbage collection and update the reference / used state of the system. */\n\tcollectGarbage(\n\t\toptions: {\n\t\t\tlogger?: ITelemetryLoggerExt;\n\t\t\trunSweep?: boolean;\n\t\t\tfullGC?: boolean;\n\t\t},\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<IGCStats | undefined>;\n\t/** Summarizes the GC data and returns it as a summary tree. */\n\tsummarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummarizeResult | undefined;\n\t/** Returns the garbage collector specific metadata to be written into the summary. */\n\tgetMetadata(): IGCMetadata;\n\t/** Returns the GC details generated from the base snapshot. */\n\tgetBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n\t/** Called when the latest summary of the system has been refreshed. */\n\trefreshLatestSummary(result: IRefreshSummaryResult): Promise<void>;\n\t/** Called when a node is updated. Used to detect and log when an inactive node is changed or loaded. */\n\tnodeUpdated(\n\t\tnodePath: string,\n\t\treason: \"Loaded\" | \"Changed\",\n\t\ttimestampMs?: number,\n\t\tpackagePath?: readonly string[],\n\t\trequestHeaders?: IRequestHeader,\n\t): void;\n\t/** Called when a reference is added to a node. Used to identify nodes that were referenced between summaries. */\n\taddedOutboundReference(fromNodePath: string, toNodePath: string): void;\n\t/** Returns true if this node has been deleted by GC during sweep phase. */\n\tisNodeDeleted(nodePath: string): boolean;\n\tsetConnectionState(connected: boolean, clientId?: string): void;\n\tdispose(): void;\n}\n\n/** Parameters necessary for creating a GarbageCollector. */\nexport interface IGarbageCollectorCreateParams {\n\treadonly runtime: IGarbageCollectionRuntime;\n\treadonly gcOptions: IGCRuntimeOptions;\n\treadonly baseLogger: ITelemetryLoggerExt;\n\treadonly existing: boolean;\n\treadonly metadata: IContainerRuntimeMetadata | undefined;\n\treadonly createContainerMetadata: ICreateContainerMetadata;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\treadonly isSummarizerClient: boolean;\n\treadonly getNodePackagePath: (nodePath: string) => Promise<readonly string[] | undefined>;\n\treadonly getLastSummaryTimestampMs: () => number | undefined;\n\treadonly readAndParseBlob: ReadAndParseBlob;\n\treadonly activeConnection: () => boolean;\n}\n\nexport interface IGCRuntimeOptions {\n\t/**\n\t * Flag that if true, will enable running garbage collection (GC) for a new container.\n\t *\n\t * GC has mark phase and sweep phase. In mark phase, unreferenced objects are identified\n\t * and marked as such in the summary. This option enables the mark phase.\n\t * In sweep phase, unreferenced objects are eventually deleted from the container if they meet certain conditions.\n\t * Sweep phase can be enabled via the \"sweepAllowed\" option.\n\t *\n\t * Note: This setting is persisted in the container's summary and cannot be changed.\n\t */\n\tgcAllowed?: boolean;\n\n\t/**\n\t * @deprecated - @see gcSweepGenerationOptionName and @see GCFeatureMatrix.sweepGeneration\n\t *\n\t * Flag that if true, enables GC's sweep phase for a new container.\n\t *\n\t * This will allow GC to eventually delete unreferenced objects from the container.\n\t * This flag should only be set to true if \"gcAllowed\" is true.\n\t *\n\t * Note: This setting is persisted in the container's summary and cannot be changed.\n\t */\n\tsweepAllowed?: boolean;\n\n\t/**\n\t * Flag that if true, will disable garbage collection for the session.\n\t * Can be used to disable running GC on containers where it is allowed via the gcAllowed option.\n\t */\n\tdisableGC?: boolean;\n\n\t/**\n\t * Flag that will bypass optimizations and generate GC data for all nodes irrespective of whether a node\n\t * changed or not.\n\t */\n\trunFullGC?: boolean;\n\n\t/**\n\t * Maximum session duration for a new container. If not present, a default value will be used.\n\t *\n\t * Note: This setting is persisted in the container's summary and cannot be changed.\n\t */\n\tsessionExpiryTimeoutMs?: number;\n\n\t/**\n\t * Allows additional GC options to be passed.\n\t */\n\t[key: string]: any;\n}\n\n/**\n * The configurations for Garbage Collector that determines what runs and how.\n */\nexport interface IGarbageCollectorConfigs {\n\t/**\n\t * Tracks if GC is enabled for this document. This is specified during document creation and doesn't change\n\t * throughout its lifetime.\n\t */\n\treadonly gcEnabled: boolean;\n\t/**\n\t * Tracks if sweep phase is enabled for this document. This is specified during document creation and doesn't change\n\t * throughout its lifetime.\n\t */\n\treadonly sweepEnabled: boolean;\n\t/**\n\t * Tracks if GC should run or not. Even if GC is enabled for a document (see gcEnabled), it can be explicitly\n\t * disabled via runtime options or feature flags.\n\t */\n\treadonly shouldRunGC: boolean;\n\t/**\n\t * Tracks if sweep phase should run or not. Even if the sweep phase is enabled for a document (see sweepEnabled), it\n\t * can be explicitly disabled via feature flags. It also won't run if session expiry is not enabled.\n\t */\n\treadonly shouldRunSweep: boolean;\n\t/**\n\t * If true, bypass optimizations and generate GC data for all nodes irrespective of whether a node changed or not.\n\t */\n\treadonly runFullGC: boolean | undefined;\n\t/** The time in ms to expire a session for a client for gc. */\n\treadonly sessionExpiryTimeoutMs: number | undefined;\n\t/** The time after which an unreferenced node is ready to be swept. */\n\treadonly sweepTimeoutMs: number | undefined;\n\t/** The time after which an unreferenced node is inactive. */\n\treadonly inactiveTimeoutMs: number;\n\t/** It is easier for users to diagnose InactiveObject usage if we throw on load, which this option enables */\n\treadonly throwOnInactiveLoad: boolean | undefined;\n\t/** Tracks whether GC should run in test mode. In this mode, unreferenced objects are deleted immediately. */\n\treadonly testMode: boolean;\n\t/**\n\t * Tracks whether GC should run in tombstone mode. In this mode, sweep ready objects are marked as tombstones.\n\t * In interactive (non-summarizer) clients, tombstone objects behave as if they are deleted, i.e., access to them\n\t * is not allowed. However, these objects can be accessed after referencing them first. It is used as a staging\n\t * step for sweep where accidental sweep ready objects can be recovered.\n\t */\n\treadonly tombstoneMode: boolean;\n\t/** @see GCFeatureMatrix. */\n\treadonly persistedGcFeatureMatrix: GCFeatureMatrix | undefined;\n\t/** The version of GC in the base snapshot. */\n\treadonly gcVersionInBaseSnapshot: GCVersion | undefined;\n\t/** The current version of GC data in the running code */\n\treadonly gcVersionInEffect: GCVersion;\n}\n\n/** The state of node that is unreferenced. */\nexport const UnreferencedState = {\n\t/** The node is active, i.e., it can become referenced again. */\n\tActive: \"Active\",\n\t/** The node is inactive, i.e., it should not become referenced. */\n\tInactive: \"Inactive\",\n\t/** The node is ready to be deleted by the sweep phase. */\n\tSweepReady: \"SweepReady\",\n} as const;\nexport type UnreferencedState = typeof UnreferencedState[keyof typeof UnreferencedState];\n\n/**\n * Represents the result of a GC run.\n */\nexport interface IGCResult {\n\t/** The ids of nodes that are referenced in the referenced graph */\n\treferencedNodeIds: string[];\n\t/** The ids of nodes that are not-referenced or deleted in the referenced graph */\n\tdeletedNodeIds: string[];\n}\n"]}
1
+ {"version":3,"file":"gcDefinitions.js","sourceRoot":"","sources":["../../src/gc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AkC;IAClC,SAAS,EAAE,WAAW;IACtB,8DAA8D;IAC9D,YAAY,EAAE,cAAc;IAC5B,6EAA6E;IAC7E,IAAI,EAAE,MAAM;IACZ,+DAA+D;IAC/D,KAAK,EAAE,OAAO;CACd,CAAC;AAyMF,8CAA8C;AACjC,QAAA,iBAAiB,GAAG;IAChC,gEAAgE;IAChE,MAAM,EAAE,QAAQ;IAChB,mEAAmE;IACnE,QAAQ,EAAE,UAAU;IACpB,0DAA0D;IAC1D,UAAU,EAAE,YAAY;CACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n\tISummarizeResult,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { ReadAndParseBlob } from \"@fluidframework/runtime-utils\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport {\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tIRefreshSummaryResult,\n} from \"../summary\";\nimport { RuntimeHeaderData } from \"../containerRuntime\";\n\nexport type GCVersion = number;\n\n/** The stable/default version of GC Data */\nexport const stableGCVersion: GCVersion = 3;\n/** The next version of GC Data, to bump to in case we need to regenerate all GC Data across all files. */\nexport const nextGCVersion: GCVersion = 4;\n\n/**\n * This undocumented GC Option (on ContainerRuntime Options) allows an app to disable enforcing GC on old documents by incrementing this value\n *\n * If unset, GC Tombstone phase will operate as otherwise configured\n * Otherwise, only enforce GC Tombstone if the passed in value matches the persisted value\n */\nexport const gcTombstoneGenerationOptionName = \"gcTombstoneGeneration\";\n/**\n * This GC Option (on ContainerRuntime Options) allows an app to disable GC Sweep on old documents by incrementing this value.\n *\n * If unset altogether, Sweep will be disabled.\n * If 0 is passed in, Sweep will be enabled for any document with gcSweepGeneration OR gcTombstoneGeneration as 0.\n * If any other number is passed in, Sweep will be enabled only for documents with the same value persisted.\n */\nexport const gcSweepGenerationOptionName = \"gcSweepGeneration\";\n\n/** Config key to turn GC on / off. */\nexport const runGCKey = \"Fluid.GarbageCollection.RunGC\";\n/** Config key to turn GC sweep on / off. */\nexport const runSweepKey = \"Fluid.GarbageCollection.RunSweep\";\n/** Config key to turn GC test mode on / off. */\nexport const gcTestModeKey = \"Fluid.GarbageCollection.GCTestMode\";\n/** Config key to expire a session after a set period of time. Defaults to true. */\nexport const runSessionExpiryKey = \"Fluid.GarbageCollection.RunSessionExpiry\";\n/** Config key to turn GC sweep log off. */\nexport const disableSweepLogKey = \"Fluid.GarbageCollection.DisableSweepLog\";\n/** Config key to disable the tombstone feature, i.e., tombstone information is not read / written into summary. */\nexport const disableTombstoneKey = \"Fluid.GarbageCollection.DisableTombstone\";\n/** Config key to enable throwing an error when tombstone object is loaded (requested). */\nexport const throwOnTombstoneLoadKey = \"Fluid.GarbageCollection.ThrowOnTombstoneLoad\";\n/** Config key to enable throwing an error when tombstone object is used (e.g. outgoing or incoming ops). */\nexport const throwOnTombstoneUsageKey = \"Fluid.GarbageCollection.ThrowOnTombstoneUsage\";\n/** Config key to enable GC version upgrade. */\nexport const gcVersionUpgradeToV4Key = \"Fluid.GarbageCollection.GCVersionUpgradeToV4\";\n/** Config key to disable GC sweep for datastores. */\nexport const disableDatastoreSweepKey = \"Fluid.GarbageCollection.DisableDataStoreSweep\";\n/** Config key to disable GC sweep for attachment blobs. */\nexport const disableAttachmentBlobSweepKey = \"Fluid.GarbageCollection.DisableAttachmentBlobSweep\";\n\n// One day in milliseconds.\nexport const oneDayMs = 1 * 24 * 60 * 60 * 1000;\n\n/**\n * The maximum snapshot cache expiry in the driver. This is used to calculate the sweep timeout.\n * Sweep timeout = session expiry timeout + snapshot cache expiry timeout + a buffer.\n * The snapshot cache expiry timeout cannot be known precisely but the upper bound is 5 days, i.e., any snapshot\n * in cache will be invalidated before 5 days.\n */\nexport const maxSnapshotCacheExpiryMs = 5 * oneDayMs;\n\nexport const defaultInactiveTimeoutMs = 7 * oneDayMs; // 7 days\nexport const defaultSessionExpiryDurationMs = 30 * oneDayMs; // 30 days\n\n/** @see IGCMetadata.gcFeatureMatrix */\nexport interface GCFeatureMatrix {\n\t/**\n\t * The Tombstone Generation value in effect when this file was created.\n\t * Gives a way for an app to disqualify old files from GC Tombstone enforcement.\n\t * Provided via Container Runtime Options.\n\t */\n\ttombstoneGeneration?: number;\n\t/**\n\t * The Sweep Generation value in effect when this file was created.\n\t * Gives a way for an app to disqualify old files from GC Sweep.\n\t * Provided via Container Runtime Options.\n\t */\n\tsweepGeneration?: number;\n}\n\nexport interface IGCMetadata {\n\t/**\n\t * The version of the GC code that was run to generate the GC data that is written in the summary.\n\t * If the persisted value doesn't match the current value in the code, saved GC data will be discarded and regenerated from scratch.\n\t * Also, used to determine whether GC is enabled for this container or not:\n\t * - A value of 0 or undefined means GC is disabled.\n\t * - A value greater than 0 means GC is enabled.\n\t */\n\treadonly gcFeature?: GCVersion;\n\n\t/**\n\t * A collection of different numerical \"Generations\" for different features,\n\t * used to determine feature availability over time.\n\t * This info may come from multiple sources (FF code, config service, app via Container Runtime Options),\n\t * and pertains to aspects of the document that may be fixed for its lifetime.\n\t *\n\t * For each dimension, if the persisted value doesn't match the currently provided value,\n\t * then this file does not support the corresponding feature as currently implemented.\n\t *\n\t * Guidance is that if no value is provided at runtime, it should result in the current default behavior.\n\t */\n\treadonly gcFeatureMatrix?: GCFeatureMatrix;\n\t/**\n\t * @deprecated - @see GCFeatureMatrix.sweepGeneration\n\t *\n\t * Tells whether the GC sweep phase is enabled for this container.\n\t * - True means sweep phase is enabled.\n\t * - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.\n\t */\n\treadonly sweepEnabled?: boolean;\n\t/** If this is present, the session for this container will expire after this time and the container will close */\n\treadonly sessionExpiryTimeoutMs?: number;\n\t/** How long to wait after an object is unreferenced before deleting it via GC Sweep */\n\treadonly sweepTimeoutMs?: number;\n}\n\n/** The statistics of the system state after a garbage collection run. */\nexport interface IGCStats {\n\t/** The number of nodes in the container. */\n\tnodeCount: number;\n\t/** The number of data stores in the container. */\n\tdataStoreCount: number;\n\t/** The number of attachment blobs in the container. */\n\tattachmentBlobCount: number;\n\t/** The number of unreferenced nodes in the container. */\n\tunrefNodeCount: number;\n\t/** The number of unreferenced data stores in the container. */\n\tunrefDataStoreCount: number;\n\t/** The number of unreferenced attachment blobs in the container. */\n\tunrefAttachmentBlobCount: number;\n\t/** The number of nodes whose reference state updated since last GC run. */\n\tupdatedNodeCount: number;\n\t/** The number of data stores whose reference state updated since last GC run. */\n\tupdatedDataStoreCount: number;\n\t/** The number of attachment blobs whose reference state updated since last GC run. */\n\tupdatedAttachmentBlobCount: number;\n}\n\n/** The types of GC nodes in the GC reference graph. */\nexport const GCNodeType = {\n\t// Nodes that are for data stores.\n\tDataStore: \"DataStore\",\n\t// Nodes that are within a data store. For example, DDS nodes.\n\tSubDataStore: \"SubDataStore\",\n\t// Nodes that are for attachment blobs, i.e., blobs uploaded via BlobManager.\n\tBlob: \"Blob\",\n\t// Nodes that are neither of the above. For example, root node.\n\tOther: \"Other\",\n};\nexport type GCNodeType = typeof GCNodeType[keyof typeof GCNodeType];\n\n/**\n * Defines the APIs for the runtime object to be passed to the garbage collector.\n */\nexport interface IGarbageCollectionRuntime {\n\t/** Before GC runs, called to notify the runtime to update any pending GC state. */\n\tupdateStateBeforeGC(): Promise<void>;\n\t/** Returns the garbage collection data of the runtime. */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\t/** After GC has run, called to notify the runtime of routes that are used in it. */\n\tupdateUsedRoutes(usedRoutes: string[]): void;\n\t/** After GC has run, called to notify the runtime of routes that are unused in it. */\n\tupdateUnusedRoutes(unusedRoutes: string[]): void;\n\t/**\n\t * After GC has run and identified nodes that are sweep ready, called to delete the sweep ready nodes. The runtime\n\t * should return the routes of nodes that were deleted.\n\t * @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.\n\t */\n\tdeleteSweepReadyNodes(sweepReadyRoutes: string[]): string[];\n\t/** Called to notify the runtime of routes that are tombstones. */\n\tupdateTombstonedRoutes(tombstoneRoutes: string[]): void;\n\t/** Returns a referenced timestamp to be used to track unreferenced nodes. */\n\tgetCurrentReferenceTimestampMs(): number | undefined;\n\t/** Returns the type of the GC node. */\n\tgetNodeType(nodePath: string): GCNodeType;\n\t/** Called when the runtime should close because of an error. */\n\tcloseFn: (error?: ICriticalContainerError) => void;\n}\n\n/** Defines the contract for the garbage collector. */\nexport interface IGarbageCollector {\n\t/** Tells whether GC should run or not. */\n\treadonly shouldRunGC: boolean;\n\t/** Tells whether the GC state in summary needs to be reset in the next summary. */\n\treadonly summaryStateNeedsReset: boolean;\n\t/** The count of data stores whose GC state updated since the last summary. */\n\treadonly updatedDSCountSinceLastSummary: number;\n\t/** Tells whether tombstone feature is enabled and enforced. */\n\treadonly tombstoneEnforcementAllowed: boolean;\n\t/** Tells whether loading a tombstone object should fail or merely log. */\n\treadonly throwOnTombstoneLoad: boolean;\n\t/** Tells whether using a tombstone object should fail or merely log. */\n\treadonly throwOnTombstoneUsage: boolean;\n\t/** Initialize the state from the base snapshot after its creation. */\n\tinitializeBaseState(): Promise<void>;\n\t/** Run garbage collection and update the reference / used state of the system. */\n\tcollectGarbage(\n\t\toptions: {\n\t\t\tlogger?: ITelemetryLoggerExt;\n\t\t\trunSweep?: boolean;\n\t\t\tfullGC?: boolean;\n\t\t},\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<IGCStats | undefined>;\n\t/** Summarizes the GC data and returns it as a summary tree. */\n\tsummarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummarizeResult | undefined;\n\t/** Returns the garbage collector specific metadata to be written into the summary. */\n\tgetMetadata(): IGCMetadata;\n\t/** Returns the GC details generated from the base snapshot. */\n\tgetBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n\t/** Called when the latest summary of the system has been refreshed. */\n\trefreshLatestSummary(result: IRefreshSummaryResult): Promise<void>;\n\t/**\n\t * Called when a node with the given path is updated. If the node is inactive or tombstoned, this will log an error\n\t * or throw an error if failing on incorrect usage is configured.\n\t */\n\tnodeUpdated(\n\t\tnodePath: string,\n\t\treason: \"Loaded\" | \"Changed\",\n\t\ttimestampMs?: number,\n\t\tpackagePath?: readonly string[],\n\t\trequest?: IRequest,\n\t\theaderData?: RuntimeHeaderData,\n\t): void;\n\t/** Called when a reference is added to a node. Used to identify nodes that were referenced between summaries. */\n\taddedOutboundReference(fromNodePath: string, toNodePath: string): void;\n\t/** Returns true if this node has been deleted by GC during sweep phase. */\n\tisNodeDeleted(nodePath: string): boolean;\n\tsetConnectionState(connected: boolean, clientId?: string): void;\n\tdispose(): void;\n}\n\n/** Parameters necessary for creating a GarbageCollector. */\nexport interface IGarbageCollectorCreateParams {\n\treadonly runtime: IGarbageCollectionRuntime;\n\treadonly gcOptions: IGCRuntimeOptions;\n\treadonly baseLogger: ITelemetryLoggerExt;\n\treadonly existing: boolean;\n\treadonly metadata: IContainerRuntimeMetadata | undefined;\n\treadonly createContainerMetadata: ICreateContainerMetadata;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\treadonly isSummarizerClient: boolean;\n\treadonly getNodePackagePath: (nodePath: string) => Promise<readonly string[] | undefined>;\n\treadonly getLastSummaryTimestampMs: () => number | undefined;\n\treadonly readAndParseBlob: ReadAndParseBlob;\n\treadonly activeConnection: () => boolean;\n}\n\nexport interface IGCRuntimeOptions {\n\t/**\n\t * Flag that if true, will enable running garbage collection (GC) for a new container.\n\t *\n\t * GC has mark phase and sweep phase. In mark phase, unreferenced objects are identified\n\t * and marked as such in the summary. This option enables the mark phase.\n\t * In sweep phase, unreferenced objects are eventually deleted from the container if they meet certain conditions.\n\t * Sweep phase can be enabled using the \"gcSweepGeneration\" option.\n\t *\n\t * Note: This setting is persisted in the container's summary and cannot be changed.\n\t */\n\tgcAllowed?: boolean;\n\n\t/**\n\t * Flag that if true, will disable garbage collection for the session.\n\t * Can be used to disable running GC on containers where it is allowed via the gcAllowed option.\n\t */\n\tdisableGC?: boolean;\n\n\t/**\n\t * Flag that will bypass optimizations and generate GC data for all nodes irrespective of whether a node\n\t * changed or not.\n\t */\n\trunFullGC?: boolean;\n\n\t/**\n\t * Maximum session duration for a new container. If not present, a default value will be used.\n\t *\n\t * Note: This setting is persisted in the container's summary and cannot be changed.\n\t */\n\tsessionExpiryTimeoutMs?: number;\n\n\t/**\n\t * Allows additional GC options to be passed.\n\t */\n\t[key: string]: any;\n}\n\n/**\n * The configurations for Garbage Collector that determines what runs and how.\n */\nexport interface IGarbageCollectorConfigs {\n\t/**\n\t * Tracks if GC is enabled for this document. This is specified during document creation and doesn't change\n\t * throughout its lifetime.\n\t */\n\treadonly gcEnabled: boolean;\n\t/**\n\t * Tracks if sweep phase is enabled for this document. This is specified during document creation and doesn't change\n\t * throughout its lifetime.\n\t */\n\treadonly sweepEnabled: boolean;\n\t/**\n\t * Tracks if GC should run or not. Even if GC is enabled for a document (see gcEnabled), it can be explicitly\n\t * disabled via runtime options or feature flags.\n\t */\n\treadonly shouldRunGC: boolean;\n\t/**\n\t * Tracks if sweep phase should run or not. Even if the sweep phase is enabled for a document (see sweepEnabled), it\n\t * can be explicitly disabled via feature flags. It also won't run if session expiry is not enabled.\n\t */\n\treadonly shouldRunSweep: boolean;\n\t/**\n\t * If true, bypass optimizations and generate GC data for all nodes irrespective of whether a node changed or not.\n\t */\n\treadonly runFullGC: boolean | undefined;\n\t/** The time in ms to expire a session for a client for gc. */\n\treadonly sessionExpiryTimeoutMs: number | undefined;\n\t/** The time after which an unreferenced node is ready to be swept. */\n\treadonly sweepTimeoutMs: number | undefined;\n\t/** The time after which an unreferenced node is inactive. */\n\treadonly inactiveTimeoutMs: number;\n\t/** Tracks whether GC should run in test mode. In this mode, unreferenced objects are deleted immediately. */\n\treadonly testMode: boolean;\n\t/**\n\t * Tracks whether GC should run in tombstone mode. In this mode, sweep ready objects are marked as tombstones.\n\t * In interactive (non-summarizer) clients, tombstone objects behave as if they are deleted, i.e., access to them\n\t * is not allowed. However, these objects can be accessed after referencing them first. It is used as a staging\n\t * step for sweep where accidental sweep ready objects can be recovered.\n\t */\n\treadonly tombstoneMode: boolean;\n\t/** @see GCFeatureMatrix. */\n\treadonly persistedGcFeatureMatrix: GCFeatureMatrix | undefined;\n\t/** The version of GC in the base snapshot. */\n\treadonly gcVersionInBaseSnapshot: GCVersion | undefined;\n\t/** The current version of GC data in the running code */\n\treadonly gcVersionInEffect: GCVersion;\n\t/** It is easier for users to diagnose InactiveObject usage if we throw on load, which this option enables */\n\treadonly throwOnInactiveLoad: boolean | undefined;\n\t/** If false, loading or using a Tombstoned object should merely log, not fail */\n\treadonly tombstoneEnforcementAllowed: boolean;\n\t/** If true, throw an error when a tombstone data store is retrieved */\n\treadonly throwOnTombstoneLoad: boolean;\n\t/** If true, throw an error when a tombstone data store is used. */\n\treadonly throwOnTombstoneUsage: boolean;\n}\n\n/** The state of node that is unreferenced. */\nexport const UnreferencedState = {\n\t/** The node is active, i.e., it can become referenced again. */\n\tActive: \"Active\",\n\t/** The node is inactive, i.e., it should not become referenced. */\n\tInactive: \"Inactive\",\n\t/** The node is ready to be deleted by the sweep phase. */\n\tSweepReady: \"SweepReady\",\n} as const;\nexport type UnreferencedState = typeof UnreferencedState[keyof typeof UnreferencedState];\n\n/**\n * Represents the result of a GC run.\n */\nexport interface IGCResult {\n\t/** The ids of nodes that are referenced in the referenced graph */\n\treferencedNodeIds: string[];\n\t/** The ids of nodes that are not-referenced or deleted in the referenced graph */\n\tdeletedNodeIds: string[];\n}\n"]}
@@ -5,17 +5,18 @@
5
5
  import { ITelemetryGenericEvent } from "@fluidframework/core-interfaces";
6
6
  import { IGarbageCollectionData } from "@fluidframework/runtime-definitions";
7
7
  import { ITelemetryLoggerExt, MonitoringContext } from "@fluidframework/telemetry-utils";
8
+ import { RuntimeHeaderData } from "../containerRuntime";
8
9
  import { ICreateContainerMetadata } from "../summary";
9
10
  import { GCNodeType, IGarbageCollectorConfigs } from "./gcDefinitions";
10
11
  import { UnreferencedStateTracker } from "./gcUnreferencedStateTracker";
11
- declare type NodeUsageType = "Changed" | "Loaded" | "Revived";
12
+ type NodeUsageType = "Changed" | "Loaded" | "Revived";
12
13
  /** Properties that are common to IUnreferencedEventProps and INodeUsageProps */
13
14
  interface ICommonProps {
14
15
  usageType: NodeUsageType;
15
16
  completedGCRuns: number;
16
17
  isTombstoned: boolean;
17
18
  lastSummaryTime?: number;
18
- viaHandle?: boolean;
19
+ headers?: RuntimeHeaderData;
19
20
  }
20
21
  /** Properties passed to nodeUsed function when a node is used. */
21
22
  interface INodeUsageProps extends ICommonProps {
@@ -37,24 +38,29 @@ export declare class GCTelemetryTracker {
37
38
  private readonly mc;
38
39
  private readonly configs;
39
40
  private readonly isSummarizerClient;
40
- private readonly gcTombstoneEnforcementAllowed;
41
41
  private readonly createContainerMetadata;
42
42
  private readonly getNodeType;
43
43
  private readonly getNodeStateTracker;
44
44
  private readonly getNodePackagePath;
45
45
  private readonly loggedUnreferencedEvents;
46
46
  private pendingEventsQueue;
47
- constructor(mc: MonitoringContext, configs: Pick<IGarbageCollectorConfigs, "inactiveTimeoutMs" | "sweepTimeoutMs">, isSummarizerClient: boolean, gcTombstoneEnforcementAllowed: boolean, createContainerMetadata: ICreateContainerMetadata, getNodeType: (nodeId: string) => GCNodeType, getNodeStateTracker: (nodeId: string) => UnreferencedStateTracker | undefined, getNodePackagePath: (nodePath: string) => Promise<readonly string[] | undefined>);
47
+ constructor(mc: MonitoringContext, configs: Pick<IGarbageCollectorConfigs, "inactiveTimeoutMs" | "sweepTimeoutMs" | "tombstoneEnforcementAllowed" | "throwOnTombstoneLoad" | "throwOnTombstoneUsage">, isSummarizerClient: boolean, createContainerMetadata: ICreateContainerMetadata, getNodeType: (nodeId: string) => GCNodeType, getNodeStateTracker: (nodeId: string) => UnreferencedStateTracker | undefined, getNodePackagePath: (nodePath: string) => Promise<readonly string[] | undefined>);
48
48
  /**
49
- * Returns whether an event should be logged for a node that isn't active anymore. Some scenarios where we won't log:
50
- * 1. When a DDS is changed or loaded. The corresponding data store's event will be logged instead.
49
+ * Returns whether an event should be logged for a node that isn't active anymore. This does not apply to
50
+ * tombstoned nodes for which an event is always logged. Some scenarios where we won't log:
51
+ * 1. When a DDS is changed. The corresponding data store's event will be logged instead.
51
52
  * 2. An event is logged only once per container instance per event per node.
52
53
  */
53
54
  private shouldLogNonActiveEvent;
54
55
  /**
55
- * Called when a node is used. If the node is not active, log an event indicating object is used when its not active.
56
+ * Called when a node is used. If the node is not active or tombstoned, log telemetry indicating object is used
57
+ * when it should not have been.
56
58
  */
57
59
  nodeUsed(nodeUsageProps: INodeUsageProps): void;
60
+ /**
61
+ * Logs telemetry when a tombstoned object is changed, revived or loaded.
62
+ */
63
+ private logTombstoneUsageTelemetry;
58
64
  /**
59
65
  * Log all new references or outbound routes in the current graph that haven't been explicitly notified to GC.
60
66
  * The principle is that every new reference or outbound route must be notified to GC via the
@@ -1 +1 @@
1
- {"version":3,"file":"gcTelemetry.d.ts","sourceRoot":"","sources":["../../src/gc/gcTelemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAEN,mBAAmB,EACnB,iBAAiB,EAEjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAEN,UAAU,EAEV,wBAAwB,EAKxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,aAAK,aAAa,GAAG,SAAS,GAAG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BAAwB,EACjD,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,UAAU,EAC3C,mBAAmB,EAAE,CACrC,MAAM,EAAE,MAAM,KACV,wBAAwB,GAAG,SAAS,EACxB,kBAAkB,EAAE,CACpC,QAAQ,EAAE,MAAM,KACZ,OAAO,CAAC,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAG5C;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;IA2B/B;;;OAGG;IACI,QAAQ,CAAC,cAAc,EAAE,eAAe;IAuG/C;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAmClC;;;;;;;;;;;OAWG;IACI,8BAA8B,CACpC,aAAa,EAAE,sBAAsB,EACrC,cAAc,EAAE,sBAAsB,EACtC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACzC,MAAM,EAAE,mBAAmB;IAuC5B;;;OAGG;IACU,gBAAgB,CAAC,MAAM,EAAE,mBAAmB;IA8CzD;;;OAGG;IACI,cAAc,CACpB,MAAM,EAAE,mBAAmB,EAC3B,2BAA2B,EAAE,MAAM,EACnC,sBAAsB,EAAE,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC,EAC7D,eAAe,EAAE,MAAM,EACvB,eAAe,CAAC,EAAE,MAAM;CA0CzB;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACzC,EAAE,EAAE,iBAAiB,EACrB,KAAK,EAAE,sBAAsB,GAAG;IAC/B,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,6BAA6B,EAAE,OAAO,GAAG,SAAS,CAAC;CACnD,EACD,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAC1C,KAAK,CAAC,EAAE,OAAO,QAaf"}
@@ -17,11 +17,10 @@ const gcDefinitions_1 = require("./gcDefinitions");
17
17
  * 5. Unknown outbound reference telemetry - When a node is referenced but GC is not explicitly notified of it.
18
18
  */
19
19
  class GCTelemetryTracker {
20
- constructor(mc, configs, isSummarizerClient, gcTombstoneEnforcementAllowed, createContainerMetadata, getNodeType, getNodeStateTracker, getNodePackagePath) {
20
+ constructor(mc, configs, isSummarizerClient, createContainerMetadata, getNodeType, getNodeStateTracker, getNodePackagePath) {
21
21
  this.mc = mc;
22
22
  this.configs = configs;
23
23
  this.isSummarizerClient = isSummarizerClient;
24
- this.gcTombstoneEnforcementAllowed = gcTombstoneEnforcementAllowed;
25
24
  this.createContainerMetadata = createContainerMetadata;
26
25
  this.getNodeType = getNodeType;
27
26
  this.getNodeStateTracker = getNodeStateTracker;
@@ -33,11 +32,12 @@ class GCTelemetryTracker {
33
32
  this.pendingEventsQueue = [];
34
33
  }
35
34
  /**
36
- * Returns whether an event should be logged for a node that isn't active anymore. Some scenarios where we won't log:
37
- * 1. When a DDS is changed or loaded. The corresponding data store's event will be logged instead.
35
+ * Returns whether an event should be logged for a node that isn't active anymore. This does not apply to
36
+ * tombstoned nodes for which an event is always logged. Some scenarios where we won't log:
37
+ * 1. When a DDS is changed. The corresponding data store's event will be logged instead.
38
38
  * 2. An event is logged only once per container instance per event per node.
39
39
  */
40
- shouldLogNonActiveEvent(nodeId, nodeType, usageType, nodeStateTracker, uniqueEventId) {
40
+ shouldLogNonActiveEvent(nodeType, usageType, nodeStateTracker, uniqueEventId) {
41
41
  if (nodeStateTracker.state === gcDefinitions_1.UnreferencedState.Active) {
42
42
  return false;
43
43
  }
@@ -49,55 +49,58 @@ class GCTelemetryTracker {
49
49
  if (nodeType === gcDefinitions_1.GCNodeType.Other) {
50
50
  return false;
51
51
  }
52
+ // Non-tombstone events are logged once per event per node. A unique id is generated by joining
53
+ // node state (inactive / sweep ready), node's id and usage (loaded / changed / revived).
52
54
  if (this.loggedUnreferencedEvents.has(uniqueEventId)) {
53
55
  return false;
54
56
  }
55
57
  return true;
56
58
  }
57
59
  /**
58
- * Called when a node is used. If the node is not active, log an event indicating object is used when its not active.
60
+ * Called when a node is used. If the node is not active or tombstoned, log telemetry indicating object is used
61
+ * when it should not have been.
59
62
  */
60
63
  nodeUsed(nodeUsageProps) {
61
64
  // If there is no reference timestamp to work with, no ops have been processed after creation. If so, skip
62
65
  // logging as nothing interesting would have happened worth logging.
63
- // If the node is not unreferenced, skip logging.
64
- const nodeStateTracker = this.getNodeStateTracker(nodeUsageProps.id);
65
- if (!nodeStateTracker || nodeUsageProps.currentReferenceTimestampMs === undefined) {
66
+ if (nodeUsageProps.currentReferenceTimestampMs === undefined) {
66
67
  return;
67
68
  }
68
- // We log these events once per event per node. A unique id is generated by joining node state (inactive / sweep ready),
69
- // node's id and usage (loaded / changed / revived).
70
- const uniqueEventId = `${nodeStateTracker.state}-${nodeUsageProps.id}-${nodeUsageProps.usageType}`;
69
+ const nodeStateTracker = this.getNodeStateTracker(nodeUsageProps.id);
71
70
  const nodeType = this.getNodeType(nodeUsageProps.id);
72
- if (!this.shouldLogNonActiveEvent(nodeUsageProps.id, nodeType, nodeUsageProps.usageType, nodeStateTracker, uniqueEventId)) {
73
- return;
74
- }
75
- // Add the unique event id so that we don't generate a log for this event again in this session..
76
- this.loggedUnreferencedEvents.add(uniqueEventId);
77
- const state = nodeStateTracker.state;
78
- const { usageType, currentReferenceTimestampMs, packagePath, id, fromId, ...propsToLog } = nodeUsageProps;
79
- const eventProps = {
71
+ const { usageType, currentReferenceTimestampMs, packagePath, id: untaggedId, fromId: untaggedFromId, ...propsToLog } = nodeUsageProps;
72
+ const unrefEventProps = {
80
73
  type: nodeType,
81
- unrefTime: nodeStateTracker.unreferencedTimestampMs,
82
- age: nodeUsageProps.currentReferenceTimestampMs -
83
- nodeStateTracker.unreferencedTimestampMs,
84
- timeout: state === gcDefinitions_1.UnreferencedState.Inactive
74
+ unrefTime: nodeStateTracker?.unreferencedTimestampMs ?? -1,
75
+ age: nodeStateTracker !== undefined
76
+ ? nodeUsageProps.currentReferenceTimestampMs -
77
+ nodeStateTracker.unreferencedTimestampMs
78
+ : -1,
79
+ timeout: nodeStateTracker?.state === gcDefinitions_1.UnreferencedState.Inactive
85
80
  ? this.configs.inactiveTimeoutMs
86
81
  : this.configs.sweepTimeoutMs,
87
- ...(0, telemetry_utils_1.tagCodeArtifacts)({ id, fromId }),
82
+ ...(0, telemetry_utils_1.tagCodeArtifacts)({ id: untaggedId, fromId: untaggedFromId }),
88
83
  ...propsToLog,
89
84
  ...this.createContainerMetadata,
90
85
  };
91
- // This will log the following events:
92
- // GC_Tombstone_DataStore_Revived, GC_Tombstone_SubDataStore_Revived, GC_Tombstone_Blob_Revived
93
- if (nodeUsageProps.usageType === "Revived" && nodeUsageProps.isTombstoned) {
94
- sendGCUnexpectedUsageEvent(this.mc, {
95
- eventName: `GC_Tombstone_${nodeType}_Revived`,
96
- category: "generic",
97
- ...(0, telemetry_utils_1.tagCodeArtifacts)({ url: id }),
98
- gcTombstoneEnforcementAllowed: this.gcTombstoneEnforcementAllowed,
99
- }, undefined /* packagePath */);
86
+ // If the node that is used is tombstoned, log a tombstone telemetry.
87
+ // Note that this is done before checking if "nodeStateTracker" is undefined below because unreferenced
88
+ // tracking may not have yet been enabled. That happens only after the client transitions to write mode.
89
+ if (nodeUsageProps.isTombstoned) {
90
+ this.logTombstoneUsageTelemetry(nodeUsageProps, unrefEventProps, nodeType, usageType);
100
91
  }
92
+ // After logging tombstone telemetry, if the node's unreferenced state is not tracked, there is nothing
93
+ // else to log.
94
+ if (nodeStateTracker === undefined) {
95
+ return;
96
+ }
97
+ const state = nodeStateTracker.state;
98
+ const uniqueEventId = `${state}-${nodeUsageProps.id}-${nodeUsageProps.usageType}`;
99
+ if (!this.shouldLogNonActiveEvent(nodeType, nodeUsageProps.usageType, nodeStateTracker, uniqueEventId)) {
100
+ return;
101
+ }
102
+ // Add the unique event id so that we don't generate a log for this event again in this session.
103
+ this.loggedUnreferencedEvents.add(uniqueEventId);
101
104
  // For summarizer client, queue the event so it is logged the next time GC runs if the event is still valid.
102
105
  // For non-summarizer client, log the event now since GC won't run on it. This may result in false positives
103
106
  // but it's a good signal nonetheless and we can consume it with a grain of salt.
@@ -105,7 +108,7 @@ class GCTelemetryTracker {
105
108
  // SweepReady errors are usages of Objects that will be deleted by GC Sweep!
106
109
  if (this.isSummarizerClient) {
107
110
  this.pendingEventsQueue.push({
108
- ...eventProps,
111
+ ...unrefEventProps,
109
112
  usageType: nodeUsageProps.usageType,
110
113
  state,
111
114
  });
@@ -116,16 +119,15 @@ class GCTelemetryTracker {
116
119
  // Events generated:
117
120
  // InactiveObject_Loaded, SweepReadyObject_Loaded
118
121
  if (nodeUsageProps.usageType === "Loaded") {
119
- const { id: taggedId, fromId: taggedFromId, ...otherProps } = eventProps;
122
+ const { id, fromId, headers, ...detailedProps } = unrefEventProps;
120
123
  const event = {
121
124
  eventName: `${state}Object_${nodeUsageProps.usageType}`,
122
- pkg: (0, telemetry_utils_1.tagCodeArtifacts)({ pkg: nodeUsageProps.packagePath?.join("/") }).pkg,
125
+ ...(0, telemetry_utils_1.tagCodeArtifacts)({ pkg: nodeUsageProps.packagePath?.join("/") }),
123
126
  stack: (0, telemetry_utils_1.generateStack)(),
124
- id: taggedId,
125
- fromId: taggedFromId,
126
- details: JSON.stringify({
127
- ...otherProps,
128
- }),
127
+ id,
128
+ fromId,
129
+ headers: { ...headers },
130
+ details: detailedProps,
129
131
  };
130
132
  // Do not log the inactive object x events as error events as they are not the best signal for
131
133
  // detecting something wrong with GC either from the partner or from the runtime itself.
@@ -138,6 +140,36 @@ class GCTelemetryTracker {
138
140
  }
139
141
  }
140
142
  }
143
+ /**
144
+ * Logs telemetry when a tombstoned object is changed, revived or loaded.
145
+ */
146
+ logTombstoneUsageTelemetry(nodeUsageProps, unrefEventProps, nodeType, usageType) {
147
+ // This will log the following events:
148
+ // GC_Tombstone_DataStore_Requested, GC_Tombstone_DataStore_Changed, GC_Tombstone_DataStore_Revived
149
+ // GC_Tombstone_SubDataStore_Requested, GC_Tombstone_SubDataStore_Changed, GC_Tombstone_SubDataStore_Revived
150
+ // GC_Tombstone_Blob_Requested, GC_Tombstone_Blob_Changed, GC_Tombstone_Blob_Revived
151
+ const { id, fromId, headers, ...detailedProps } = unrefEventProps;
152
+ const eventUsageName = usageType === "Loaded" ? "Requested" : usageType;
153
+ const event = {
154
+ eventName: `GC_Tombstone_${nodeType}_${eventUsageName}`,
155
+ pkg: (0, telemetry_utils_1.tagCodeArtifacts)({ pkg: nodeUsageProps.packagePath?.join("/") }).pkg,
156
+ stack: (0, telemetry_utils_1.generateStack)(),
157
+ id,
158
+ fromId,
159
+ headers: { ...headers },
160
+ details: detailedProps,
161
+ gcTombstoneEnforcementAllowed: this.configs.tombstoneEnforcementAllowed,
162
+ };
163
+ if ((usageType === "Loaded" &&
164
+ this.configs.throwOnTombstoneLoad &&
165
+ !headers?.allowTombstone) ||
166
+ (usageType === "Changed" && this.configs.throwOnTombstoneUsage)) {
167
+ this.mc.logger.sendErrorEvent(event);
168
+ }
169
+ else {
170
+ this.mc.logger.sendTelemetryEvent(event);
171
+ }
172
+ }
141
173
  /**
142
174
  * Log all new references or outbound routes in the current graph that haven't been explicitly notified to GC.
143
175
  * The principle is that every new reference or outbound route must be notified to GC via the