@fluidframework/container-runtime 2.0.0-rc.3.0.3 → 2.0.0-rc.4.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 (289) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/api-report/container-runtime.api.md +72 -34
  3. package/dist/batchTracker.d.ts +1 -1
  4. package/dist/batchTracker.d.ts.map +1 -1
  5. package/dist/batchTracker.js.map +1 -1
  6. package/dist/blobManager.d.ts +7 -7
  7. package/dist/blobManager.d.ts.map +1 -1
  8. package/dist/blobManager.js +2 -4
  9. package/dist/blobManager.js.map +1 -1
  10. package/dist/channelCollection.d.ts +6 -4
  11. package/dist/channelCollection.d.ts.map +1 -1
  12. package/dist/channelCollection.js +20 -7
  13. package/dist/channelCollection.js.map +1 -1
  14. package/dist/connectionTelemetry.d.ts +2 -2
  15. package/dist/connectionTelemetry.d.ts.map +1 -1
  16. package/dist/connectionTelemetry.js +54 -5
  17. package/dist/connectionTelemetry.js.map +1 -1
  18. package/dist/containerRuntime.d.ts +17 -35
  19. package/dist/containerRuntime.d.ts.map +1 -1
  20. package/dist/containerRuntime.js +194 -163
  21. package/dist/containerRuntime.js.map +1 -1
  22. package/dist/dataStore.d.ts +1 -1
  23. package/dist/dataStore.d.ts.map +1 -1
  24. package/dist/dataStore.js.map +1 -1
  25. package/dist/dataStoreContext.d.ts +9 -6
  26. package/dist/dataStoreContext.d.ts.map +1 -1
  27. package/dist/dataStoreContext.js +19 -5
  28. package/dist/dataStoreContext.js.map +1 -1
  29. package/dist/dataStoreContexts.d.ts.map +1 -1
  30. package/dist/dataStoreContexts.js.map +1 -1
  31. package/dist/deltaManagerProxies.d.ts +81 -0
  32. package/dist/deltaManagerProxies.d.ts.map +1 -0
  33. package/dist/{deltaManagerSummarizerProxy.js → deltaManagerProxies.js} +75 -20
  34. package/dist/deltaManagerProxies.js.map +1 -0
  35. package/dist/deltaScheduler.d.ts +2 -2
  36. package/dist/deltaScheduler.d.ts.map +1 -1
  37. package/dist/deltaScheduler.js.map +1 -1
  38. package/dist/gc/garbageCollection.d.ts +1 -1
  39. package/dist/gc/garbageCollection.d.ts.map +1 -1
  40. package/dist/gc/garbageCollection.js.map +1 -1
  41. package/dist/gc/gcDefinitions.d.ts +1 -1
  42. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  43. package/dist/gc/gcDefinitions.js.map +1 -1
  44. package/dist/gc/gcTelemetry.d.ts +1 -2
  45. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  46. package/dist/gc/gcTelemetry.js.map +1 -1
  47. package/dist/index.d.ts +1 -1
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js.map +1 -1
  50. package/dist/legacy.d.ts +6 -1
  51. package/dist/messageTypes.d.ts +5 -2
  52. package/dist/messageTypes.d.ts.map +1 -1
  53. package/dist/messageTypes.js.map +1 -1
  54. package/dist/metadata.d.ts +2 -2
  55. package/dist/metadata.d.ts.map +1 -1
  56. package/dist/metadata.js.map +1 -1
  57. package/dist/opLifecycle/batchManager.d.ts +4 -1
  58. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  59. package/dist/opLifecycle/batchManager.js +0 -10
  60. package/dist/opLifecycle/batchManager.js.map +1 -1
  61. package/dist/opLifecycle/outbox.d.ts +0 -4
  62. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  63. package/dist/opLifecycle/outbox.js +7 -38
  64. package/dist/opLifecycle/outbox.js.map +1 -1
  65. package/dist/packageVersion.d.ts +1 -1
  66. package/dist/packageVersion.js +1 -1
  67. package/dist/packageVersion.js.map +1 -1
  68. package/dist/pendingStateManager.d.ts +9 -2
  69. package/dist/pendingStateManager.d.ts.map +1 -1
  70. package/dist/pendingStateManager.js +26 -10
  71. package/dist/pendingStateManager.js.map +1 -1
  72. package/dist/scheduleManager.d.ts +2 -2
  73. package/dist/scheduleManager.d.ts.map +1 -1
  74. package/dist/scheduleManager.js.map +1 -1
  75. package/dist/summary/documentSchema.d.ts +3 -1
  76. package/dist/summary/documentSchema.d.ts.map +1 -1
  77. package/dist/summary/documentSchema.js +25 -7
  78. package/dist/summary/documentSchema.js.map +1 -1
  79. package/dist/summary/index.d.ts +1 -1
  80. package/dist/summary/index.d.ts.map +1 -1
  81. package/dist/summary/index.js.map +1 -1
  82. package/dist/summary/orderedClientElection.d.ts +2 -2
  83. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  84. package/dist/summary/orderedClientElection.js.map +1 -1
  85. package/dist/summary/runningSummarizer.js +10 -10
  86. package/dist/summary/runningSummarizer.js.map +1 -1
  87. package/dist/summary/summarizer.d.ts +1 -2
  88. package/dist/summary/summarizer.d.ts.map +1 -1
  89. package/dist/summary/summarizer.js.map +1 -1
  90. package/dist/summary/summarizerClientElection.d.ts +1 -1
  91. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  92. package/dist/summary/summarizerClientElection.js.map +1 -1
  93. package/dist/summary/summarizerHeuristics.d.ts +1 -1
  94. package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
  95. package/dist/summary/summarizerHeuristics.js.map +1 -1
  96. package/dist/summary/summarizerNode/summarizerNode.d.ts +4 -3
  97. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  98. package/dist/summary/summarizerNode/summarizerNode.js +4 -10
  99. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  100. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -3
  101. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  102. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  103. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -2
  104. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  105. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +2 -9
  106. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  107. package/dist/summary/summarizerTypes.d.ts +3 -5
  108. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  109. package/dist/summary/summarizerTypes.js.map +1 -1
  110. package/dist/summary/summaryCollection.d.ts +2 -2
  111. package/dist/summary/summaryCollection.d.ts.map +1 -1
  112. package/dist/summary/summaryCollection.js.map +1 -1
  113. package/dist/summary/summaryFormat.d.ts +25 -5
  114. package/dist/summary/summaryFormat.d.ts.map +1 -1
  115. package/dist/summary/summaryFormat.js.map +1 -1
  116. package/dist/summary/summaryGenerator.d.ts +1 -2
  117. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  118. package/dist/summary/summaryGenerator.js +12 -11
  119. package/dist/summary/summaryGenerator.js.map +1 -1
  120. package/dist/summary/summaryManager.d.ts.map +1 -1
  121. package/dist/summary/summaryManager.js +5 -5
  122. package/dist/summary/summaryManager.js.map +1 -1
  123. package/lib/batchTracker.d.ts +1 -1
  124. package/lib/batchTracker.d.ts.map +1 -1
  125. package/lib/batchTracker.js.map +1 -1
  126. package/lib/blobManager.d.ts +7 -7
  127. package/lib/blobManager.d.ts.map +1 -1
  128. package/lib/blobManager.js +3 -5
  129. package/lib/blobManager.js.map +1 -1
  130. package/lib/channelCollection.d.ts +6 -4
  131. package/lib/channelCollection.d.ts.map +1 -1
  132. package/lib/channelCollection.js +21 -8
  133. package/lib/channelCollection.js.map +1 -1
  134. package/lib/connectionTelemetry.d.ts +2 -2
  135. package/lib/connectionTelemetry.d.ts.map +1 -1
  136. package/lib/connectionTelemetry.js +49 -0
  137. package/lib/connectionTelemetry.js.map +1 -1
  138. package/lib/containerRuntime.d.ts +17 -35
  139. package/lib/containerRuntime.d.ts.map +1 -1
  140. package/lib/containerRuntime.js +195 -164
  141. package/lib/containerRuntime.js.map +1 -1
  142. package/lib/dataStore.d.ts +1 -1
  143. package/lib/dataStore.d.ts.map +1 -1
  144. package/lib/dataStore.js +1 -1
  145. package/lib/dataStore.js.map +1 -1
  146. package/lib/dataStoreContext.d.ts +9 -6
  147. package/lib/dataStoreContext.d.ts.map +1 -1
  148. package/lib/dataStoreContext.js +21 -7
  149. package/lib/dataStoreContext.js.map +1 -1
  150. package/lib/dataStoreContexts.d.ts.map +1 -1
  151. package/lib/dataStoreContexts.js.map +1 -1
  152. package/lib/deltaManagerProxies.d.ts +81 -0
  153. package/lib/deltaManagerProxies.d.ts.map +1 -0
  154. package/lib/{deltaManagerSummarizerProxy.js → deltaManagerProxies.js} +72 -19
  155. package/lib/deltaManagerProxies.js.map +1 -0
  156. package/lib/deltaScheduler.d.ts +2 -2
  157. package/lib/deltaScheduler.d.ts.map +1 -1
  158. package/lib/deltaScheduler.js.map +1 -1
  159. package/lib/gc/garbageCollection.d.ts +1 -1
  160. package/lib/gc/garbageCollection.d.ts.map +1 -1
  161. package/lib/gc/garbageCollection.js.map +1 -1
  162. package/lib/gc/gcDefinitions.d.ts +1 -1
  163. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  164. package/lib/gc/gcDefinitions.js.map +1 -1
  165. package/lib/gc/gcTelemetry.d.ts +1 -2
  166. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  167. package/lib/gc/gcTelemetry.js.map +1 -1
  168. package/lib/index.d.ts +1 -1
  169. package/lib/index.d.ts.map +1 -1
  170. package/lib/index.js.map +1 -1
  171. package/lib/legacy.d.ts +6 -1
  172. package/lib/messageTypes.d.ts +5 -2
  173. package/lib/messageTypes.d.ts.map +1 -1
  174. package/lib/messageTypes.js.map +1 -1
  175. package/lib/metadata.d.ts +2 -2
  176. package/lib/metadata.d.ts.map +1 -1
  177. package/lib/metadata.js.map +1 -1
  178. package/lib/opLifecycle/batchManager.d.ts +4 -1
  179. package/lib/opLifecycle/batchManager.d.ts.map +1 -1
  180. package/lib/opLifecycle/batchManager.js +0 -10
  181. package/lib/opLifecycle/batchManager.js.map +1 -1
  182. package/lib/opLifecycle/outbox.d.ts +0 -4
  183. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  184. package/lib/opLifecycle/outbox.js +7 -38
  185. package/lib/opLifecycle/outbox.js.map +1 -1
  186. package/lib/packageVersion.d.ts +1 -1
  187. package/lib/packageVersion.js +1 -1
  188. package/lib/packageVersion.js.map +1 -1
  189. package/lib/pendingStateManager.d.ts +9 -2
  190. package/lib/pendingStateManager.d.ts.map +1 -1
  191. package/lib/pendingStateManager.js +27 -11
  192. package/lib/pendingStateManager.js.map +1 -1
  193. package/lib/scheduleManager.d.ts +2 -2
  194. package/lib/scheduleManager.d.ts.map +1 -1
  195. package/lib/scheduleManager.js.map +1 -1
  196. package/lib/summary/documentSchema.d.ts +3 -1
  197. package/lib/summary/documentSchema.d.ts.map +1 -1
  198. package/lib/summary/documentSchema.js +25 -7
  199. package/lib/summary/documentSchema.js.map +1 -1
  200. package/lib/summary/index.d.ts +1 -1
  201. package/lib/summary/index.d.ts.map +1 -1
  202. package/lib/summary/index.js.map +1 -1
  203. package/lib/summary/orderedClientElection.d.ts +2 -2
  204. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  205. package/lib/summary/orderedClientElection.js +1 -1
  206. package/lib/summary/orderedClientElection.js.map +1 -1
  207. package/lib/summary/runningSummarizer.js +1 -1
  208. package/lib/summary/runningSummarizer.js.map +1 -1
  209. package/lib/summary/summarizer.d.ts +1 -2
  210. package/lib/summary/summarizer.d.ts.map +1 -1
  211. package/lib/summary/summarizer.js.map +1 -1
  212. package/lib/summary/summarizerClientElection.d.ts +1 -1
  213. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  214. package/lib/summary/summarizerClientElection.js.map +1 -1
  215. package/lib/summary/summarizerHeuristics.d.ts +1 -1
  216. package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
  217. package/lib/summary/summarizerHeuristics.js.map +1 -1
  218. package/lib/summary/summarizerNode/summarizerNode.d.ts +4 -3
  219. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  220. package/lib/summary/summarizerNode/summarizerNode.js +4 -10
  221. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  222. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -3
  223. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  224. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  225. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -2
  226. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  227. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +2 -9
  228. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  229. package/lib/summary/summarizerTypes.d.ts +3 -5
  230. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  231. package/lib/summary/summarizerTypes.js.map +1 -1
  232. package/lib/summary/summaryCollection.d.ts +2 -2
  233. package/lib/summary/summaryCollection.d.ts.map +1 -1
  234. package/lib/summary/summaryCollection.js.map +1 -1
  235. package/lib/summary/summaryFormat.d.ts +25 -5
  236. package/lib/summary/summaryFormat.d.ts.map +1 -1
  237. package/lib/summary/summaryFormat.js.map +1 -1
  238. package/lib/summary/summaryGenerator.d.ts +1 -2
  239. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  240. package/lib/summary/summaryGenerator.js +5 -4
  241. package/lib/summary/summaryGenerator.js.map +1 -1
  242. package/lib/summary/summaryManager.d.ts.map +1 -1
  243. package/lib/summary/summaryManager.js +2 -2
  244. package/lib/summary/summaryManager.js.map +1 -1
  245. package/lib/tsdoc-metadata.json +1 -1
  246. package/package.json +28 -50
  247. package/src/batchTracker.ts +1 -2
  248. package/src/blobManager.ts +11 -10
  249. package/src/channelCollection.ts +30 -12
  250. package/src/connectionTelemetry.ts +59 -4
  251. package/src/containerRuntime.ts +262 -239
  252. package/src/dataStore.ts +7 -4
  253. package/src/dataStoreContext.ts +57 -16
  254. package/src/dataStoreContexts.ts +1 -2
  255. package/src/{deltaManagerSummarizerProxy.ts → deltaManagerProxies.ts} +98 -24
  256. package/src/deltaScheduler.ts +2 -3
  257. package/src/gc/garbageCollection.ts +1 -1
  258. package/src/gc/gcDefinitions.ts +1 -1
  259. package/src/gc/gcTelemetry.ts +1 -3
  260. package/src/index.ts +5 -0
  261. package/src/messageTypes.ts +4 -2
  262. package/src/metadata.ts +2 -2
  263. package/src/opLifecycle/README.md +4 -4
  264. package/src/opLifecycle/batchManager.ts +5 -14
  265. package/src/opLifecycle/outbox.ts +7 -53
  266. package/src/packageVersion.ts +1 -1
  267. package/src/pendingStateManager.ts +38 -15
  268. package/src/scheduleManager.ts +2 -2
  269. package/src/summary/documentSchema.ts +37 -12
  270. package/src/summary/index.ts +4 -0
  271. package/src/summary/orderedClientElection.ts +6 -3
  272. package/src/summary/runningSummarizer.ts +1 -1
  273. package/src/summary/summarizer.ts +1 -1
  274. package/src/summary/summarizerClientElection.ts +1 -1
  275. package/src/summary/summarizerHeuristics.ts +1 -1
  276. package/src/summary/summarizerNode/summarizerNode.ts +3 -12
  277. package/src/summary/summarizerNode/summarizerNodeUtils.ts +2 -3
  278. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +1 -10
  279. package/src/summary/summarizerTypes.ts +6 -5
  280. package/src/summary/summaryCollection.ts +2 -2
  281. package/src/summary/summaryFormat.ts +30 -4
  282. package/src/summary/summaryGenerator.ts +20 -9
  283. package/src/summary/summaryManager.ts +6 -3
  284. package/dist/deltaManagerSummarizerProxy.d.ts +0 -44
  285. package/dist/deltaManagerSummarizerProxy.d.ts.map +0 -1
  286. package/dist/deltaManagerSummarizerProxy.js.map +0 -1
  287. package/lib/deltaManagerSummarizerProxy.d.ts +0 -44
  288. package/lib/deltaManagerSummarizerProxy.d.ts.map +0 -1
  289. package/lib/deltaManagerSummarizerProxy.js.map +0 -1
@@ -6,7 +6,8 @@ import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
6
  import { ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
7
7
  import { ITelemetryContext } from "@fluidframework/runtime-definitions";
8
8
  import { CreateChildSummarizerNodeParam, ISummarizeResult, ISummarizerNode, ISummarizerNodeConfig, SummarizeInternalFn } from "@fluidframework/runtime-definitions/internal";
9
- import { type ITelemetryErrorEventExt, ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
9
+ import { type ITelemetryErrorEventExt } from "@fluidframework/telemetry-utils/internal";
10
+ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
10
11
  import { EscapedPath, ICreateChildDetails, IRefreshSummaryResult, IStartSummaryResult, ISummarizerNodeRootContract, SummaryNode, ValidateSummaryResult } from "./summarizerNodeUtils.js";
11
12
  export interface IRootSummarizerNode extends ISummarizerNode, ISummarizerNodeRootContract {
12
13
  }
@@ -88,7 +89,7 @@ export declare class SummarizerNode implements IRootSummarizerNode {
88
89
  * queue. We track this until we get an ack from the server for this summary.
89
90
  * @param proposalHandle - The handle of the summary that was uploaded to the server.
90
91
  */
91
- completeSummary(proposalHandle: string, validate: boolean): void;
92
+ completeSummary(proposalHandle: string): void;
92
93
  /**
93
94
  * Recursive implementation for completeSummary, with additional internal-only parameters.
94
95
  * @param proposalHandle - The handle of the summary that was uploaded to the server.
@@ -97,7 +98,7 @@ export declare class SummarizerNode implements IRootSummarizerNode {
97
98
  * In that case, the children will not have work-in-progress state.
98
99
  * @param validate - true to validate that the in-progress summary is correct for all nodes.
99
100
  */
100
- protected completeSummaryCore(proposalHandle: string, parentPath: EscapedPath | undefined, parentSkipRecursion: boolean, validate: boolean): void;
101
+ protected completeSummaryCore(proposalHandle: string, parentPath: EscapedPath | undefined, parentSkipRecursion: boolean): void;
101
102
  clearSummary(): void;
102
103
  /**
103
104
  * Refreshes the latest summary tracked by this node. If we have a pending summary for the given proposal handle,
@@ -1 +1 @@
1
- {"version":3,"file":"summarizerNode.d.ts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EACN,yBAAyB,EACzB,aAAa,EAEb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAEN,i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,WAAW;IACjB,yBAAyB;IACzB,mBAAmB,EAAE,mBAAmB;IACxC,2CAA2C;IAC3C,EAAE,EAAE,MAAM;IACV;;;;OAIG;IACH,WAAW,EAAE,8BAA8B,EAC3C,MAAM,GAAE,qBAA0B,GAChC,eAAe;IAuBX,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAIxD;;;;;OAKG;IACH,SAAS,CAAC,wBAAwB,CACjC,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,8BAA8B,GACzC,mBAAmB;IAsCtB;;;;;;;;OAQG;IACH,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM;IAoBjE,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW;IAI7D;;OAEG;IACI,mBAAmB,IAAI,OAAO;IAIrC;;OAEG;IACH,SAAS,CAAC,oBAAoB,CAAC,UAAU,EAAE,uBAAuB,GAAG,KAAK;CAW1E;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,WAC5B,mBAAmB,uBACN,mBAAmB,wBAClB,MAAM,2BACH,MAAM,GAAG,SAAS,WACnC,qBAAqB,KAC3B,mBAWD,CAAC"}
1
+ {"version":3,"file":"summarizerNode.d.ts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EACN,yBAAyB,EACzB,aAAa,EAEb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAEN,iBAAiB,EACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACN,8BAA8B,EAE9B,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,0CAA0C,CAAC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AG,eAAe,GAAG,SAAS;IAIxD;;;;;OAKG;IACH,SAAS,CAAC,wBAAwB,CACjC,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,8BAA8B,GACzC,mBAAmB;IAsCtB;;;;;;;;OAQG;IACH,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM;IAoBjE,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW;IAI7D;;OAEG;IACI,mBAAmB,IAAI,OAAO;IAIrC;;OAEG;IACH,SAAS,CAAC,oBAAoB,CAAC,UAAU,EAAE,uBAAuB,GAAG,KAAK;CAW1E;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,WAC5B,mBAAmB,uBACN,mBAAmB,wBAClB,MAAM,2BACH,MAAM,GAAG,SAAS,WACnC,qBAAqB,KAC3B,mBAWD,CAAC"}
@@ -209,8 +209,8 @@ export class SummarizerNode {
209
209
  * queue. We track this until we get an ack from the server for this summary.
210
210
  * @param proposalHandle - The handle of the summary that was uploaded to the server.
211
211
  */
212
- completeSummary(proposalHandle, validate) {
213
- this.completeSummaryCore(proposalHandle, undefined /* parentPath */, false /* parentSkipRecursion */, validate);
212
+ completeSummary(proposalHandle) {
213
+ this.completeSummaryCore(proposalHandle, undefined /* parentPath */, false /* parentSkipRecursion */);
214
214
  }
215
215
  /**
216
216
  * Recursive implementation for completeSummary, with additional internal-only parameters.
@@ -220,13 +220,7 @@ export class SummarizerNode {
220
220
  * In that case, the children will not have work-in-progress state.
221
221
  * @param validate - true to validate that the in-progress summary is correct for all nodes.
222
222
  */
223
- completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion, validate) {
224
- if (validate && this.wasSummarizeMissed(parentSkipRecursion)) {
225
- this.throwUnexpectedError({
226
- eventName: "NodeDidNotSummarize",
227
- proposalHandle,
228
- });
229
- }
223
+ completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion) {
230
224
  assert(this.wipReferenceSequenceNumber !== undefined, 0x1a4 /* "Not tracking a summary" */);
231
225
  let localPathsToUse = this.wipLocalPaths;
232
226
  if (parentSkipRecursion) {
@@ -264,7 +258,7 @@ export class SummarizerNode {
264
258
  });
265
259
  const fullPathForChildren = summary.fullPathForChildren;
266
260
  for (const child of this.children.values()) {
267
- child.completeSummaryCore(proposalHandle, fullPathForChildren, this.wipSkipRecursion || parentSkipRecursion, validate);
261
+ child.completeSummaryCore(proposalHandle, fullPathForChildren, this.wipSkipRecursion || parentSkipRecursion);
268
262
  }
269
263
  // Note that this overwrites existing pending summary with
270
264
  // the same proposalHandle. If proposalHandle is something like
@@ -1 +1 @@
1
- {"version":3,"file":"summarizerNode.js","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAGN,WAAW,GACX,MAAM,sCAAsC,CAAC;AAK9C,OAAO,EAEN,0BAA0B,GAK1B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EACN,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EACN,WAAW,EAKX,WAAW,EAEX,uBAAuB,GACvB,MAAM,0BAA0B,CAAC;AAIlC;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,cAAc;IAC1B;;;OAGG;IACH,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,cAAc,EAAE,uBAAuB,IAAI,CAAC,CAAC;IAC1D,CAAC;IAUD;;;OAGG;IACH,YACC,UAAgC,EACf,mBAAwC,EACzD,MAA6B,EACrB,qBAA6B;IACrC,8CAA8C;IACtC,cAA4B,EAC1B,gBAAuC;IACjD,oEAAoE;IAC1D,eAAwB;QAPjB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AW,EAAE,OAAoB;QAC5D,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,mBAAmB;QACzB,OAAO,IAAI,CAAC,0BAA0B,KAAK,SAAS,CAAC;IACtD,CAAC;IAED;;OAEG;IACO,oBAAoB,CAAC,UAAmC;QACjE,MAAM,KAAK,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,SAAS,EAAE;YACpD,GAAG,UAAU;YACb,uBAAuB,EAAE,IAAI,CAAC,0BAA0B;YACxD,GAAG,gBAAgB,CAAC;gBACnB,EAAE,EAAE,IAAI,CAAC,eAAe;aACxB,CAAC;SACF,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAC9C,MAAM,KAAK,CAAC;IACb,CAAC;CACD;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACvC,MAA2B,EAC3B,mBAAwC,EACxC,oBAA4B,EAC5B,uBAA2C,EAC3C,SAAgC,EAAE,EACZ,EAAE,CACxB,IAAI,cAAc,CACjB,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,oBAAoB,EACpB,uBAAuB,KAAK,SAAS;IACpC,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,uBAAuB,CAAC,EACrD,SAAS,CAAC,sBAAsB,EAChC,EAAE,CAAC,qBAAqB,CACxB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n\tSummaryType,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n\tIExperimentalIncrementalSummaryContext,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tCreateChildSummarizerNodeParam,\n\tCreateSummarizerNodeSource,\n\tISummarizeResult,\n\tISummarizerNode,\n\tISummarizerNodeConfig,\n\tSummarizeInternalFn,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { mergeStats } from \"@fluidframework/runtime-utils/internal\";\nimport { type ITelemetryErrorEventExt, ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport {\n\tLoggingError,\n\tPerformanceEvent,\n\tTelemetryDataTag,\n\tcreateChildLogger,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\tEscapedPath,\n\tICreateChildDetails,\n\tIRefreshSummaryResult,\n\tIStartSummaryResult,\n\tISummarizerNodeRootContract,\n\tSummaryNode,\n\tValidateSummaryResult,\n\tparseSummaryForSubtrees,\n} from \"./summarizerNodeUtils.js\";\n\nexport interface IRootSummarizerNode extends ISummarizerNode, ISummarizerNodeRootContract {}\n\n/**\n * Encapsulates the summarizing work and state of an individual tree node in the\n * summary tree. It tracks changes and allows for optimizations when unchanged, or\n * can allow for fallback summaries to be generated when an error is encountered.\n * Usage is for the root node to call startSummary first to begin tracking a WIP\n * (work in progress) summary. Then all nodes will call summarize to summaries their\n * individual parts. Once completed and uploaded to storage, the root node will call\n * completeSummary or clearSummary to clear the WIP summary tracking state if something\n * went wrong. The SummarizerNodes will track all pending summaries that have been\n * recorded by the completeSummary call. When one of them is acked, the root node should\n * call refreshLatestSummary to inform the tree of SummarizerNodes of the new baseline\n * latest successful summary.\n */\nexport class SummarizerNode implements IRootSummarizerNode {\n\t/**\n\t * The reference sequence number of the most recent acked summary.\n\t * Returns 0 if there is not yet an acked summary.\n\t */\n\tpublic get referenceSequenceNumber() {\n\t\treturn this._latestSummary?.referenceSequenceNumber ?? 0;\n\t}\n\n\tprotected readonly children = new Map<string, SummarizerNode>();\n\tprotected readonly pendingSummaries = new Map<string, SummaryNode>();\n\tprotected wipReferenceSequenceNumber: number | undefined;\n\tprivate wipLocalPaths: { localPath: EscapedPath; additionalPath?: EscapedPath } | undefined;\n\tprivate wipSkipRecursion = false;\n\n\tprotected readonly logger: ITelemetryLoggerExt;\n\n\t/**\n\t * Do not call constructor directly.\n\t * Use createRootSummarizerNode to create root node, or createChild to create child nodes.\n\t */\n\tpublic constructor(\n\t\tbaseLogger: ITelemetryBaseLogger,\n\t\tprivate readonly summarizeInternalFn: SummarizeInternalFn,\n\t\tconfig: ISummarizerNodeConfig,\n\t\tprivate _changeSequenceNumber: number,\n\t\t/** Undefined means created without summary */\n\t\tprivate _latestSummary?: SummaryNode,\n\t\tprotected wipSummaryLogger?: ITelemetryBaseLogger,\n\t\t/** A unique id of this node to be logged when sending telemetry. */\n\t\tprotected telemetryNodeId?: string,\n\t) {\n\t\tthis.canReuseHandle = config.canReuseHandle ?? true;\n\t\t// All logs posted by the summarizer node should include the telemetryNodeId.\n\t\tthis.logger = createChildLogger({\n\t\t\tlogger: baseLogger,\n\t\t\tproperties: {\n\t\t\t\tall: tagCodeArtifacts({ id: this.telemetryNodeId }),\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * In order to produce a summary with a summarizer node, the summarizer node system must be notified a summary has\n\t * started. This is done by calling startSummary. This will track the reference sequence number of the summary and\n\t * run some validation checks to ensure the summary is correct.\n\t * @param referenceSequenceNumber - the number of ops processed up to this point\n\t * @param summaryLogger - the logger to use for the summary\n\t * @param latestSummaryRefSeqNum - the reference sequence number of the latest summary. Another way to think about\n\t * it is the reference sequence number of the previous summary.\n\t * @returns the number of nodes in the tree, the number of nodes that are invalid, and the different types of\n\t * sequence number mismatches\n\t */\n\tpublic startSummary(\n\t\treferenceSequenceNumber: number,\n\t\tsummaryLogger: ITelemetryBaseLogger,\n\t\tlatestSummaryRefSeqNum: number,\n\t): IStartSummaryResult {\n\t\tassert(\n\t\t\tthis.wipSummaryLogger === undefined,\n\t\t\t0x19f /* \"wipSummaryLogger should not be set yet in startSummary\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.wipReferenceSequenceNumber === undefined,\n\t\t\t0x1a0 /* \"Already tracking a summary\" */,\n\t\t);\n\n\t\tlet nodes = 1;\n\t\tlet invalidNodes = 0;\n\t\tconst sequenceNumberMismatchKeySet = new Set<string>();\n\t\tconst nodeLatestSummaryRefSeqNum = this._latestSummary?.referenceSequenceNumber;\n\t\tif (\n\t\t\tnodeLatestSummaryRefSeqNum !== undefined &&\n\t\t\tlatestSummaryRefSeqNum !== nodeLatestSummaryRefSeqNum\n\t\t) {\n\t\t\tinvalidNodes++;\n\t\t\tsequenceNumberMismatchKeySet.add(\n\t\t\t\t`${latestSummaryRefSeqNum}-${nodeLatestSummaryRefSeqNum}`,\n\t\t\t);\n\t\t}\n\n\t\tthis.wipSummaryLogger = summaryLogger;\n\n\t\tfor (const child of this.children.values()) {\n\t\t\tconst childStartSummaryResult = child.startSummary(\n\t\t\t\treferenceSequenceNumber,\n\t\t\t\tthis.wipSummaryLogger,\n\t\t\t\tlatestSummaryRefSeqNum,\n\t\t\t);\n\t\t\tnodes += childStartSummaryResult.nodes;\n\t\t\tinvalidNodes += childStartSummaryResult.invalidNodes;\n\t\t\tfor (const invalidSequenceNumber of childStartSummaryResult.mismatchNumbers) {\n\t\t\t\tsequenceNumberMismatchKeySet.add(invalidSequenceNumber);\n\t\t\t}\n\t\t}\n\t\tthis.wipReferenceSequenceNumber = referenceSequenceNumber;\n\t\treturn {\n\t\t\tnodes,\n\t\t\tinvalidNodes,\n\t\t\tmismatchNumbers: sequenceNumberMismatchKeySet,\n\t\t};\n\t}\n\n\tpublic async summarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult> {\n\t\tassert(\n\t\t\tthis.isSummaryInProgress(),\n\t\t\t0x1a1 /* \"summarize should not be called when not tracking the summary\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.wipSummaryLogger !== undefined,\n\t\t\t0x1a2 /* \"wipSummaryLogger should have been set in startSummary or ctor\" */,\n\t\t);\n\n\t\t// Try to reuse the tree if unchanged\n\t\tif (this.canReuseHandle && !fullTree && !this.hasChanged()) {\n\t\t\tconst latestSummary = this._latestSummary;\n\t\t\tif (latestSummary !== undefined) {\n\t\t\t\tthis.wipLocalPaths = {\n\t\t\t\t\tlocalPath: latestSummary.localPath,\n\t\t\t\t\tadditionalPath: latestSummary.additionalPath,\n\t\t\t\t};\n\t\t\t\tthis.wipSkipRecursion = true;\n\t\t\t\tconst stats = mergeStats();\n\t\t\t\tstats.handleNodeCount++;\n\t\t\t\treturn {\n\t\t\t\t\tsummary: {\n\t\t\t\t\t\ttype: SummaryType.Handle,\n\t\t\t\t\t\thandle: latestSummary.fullPath.path,\n\t\t\t\t\t\thandleType: SummaryType.Tree,\n\t\t\t\t\t},\n\t\t\t\t\tstats,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// This assert is the same the other 0a1x1 assert `isSummaryInProgress`, the only difference is that typescript\n\t\t// complains if this assert isn't done this way\n\t\tassert(\n\t\t\tthis.wipReferenceSequenceNumber !== undefined,\n\t\t\t0x5df /* Summarize should not be called when not tracking the summary */,\n\t\t);\n\t\tconst incrementalSummaryContext: IExperimentalIncrementalSummaryContext | undefined =\n\t\t\tthis._latestSummary !== undefined\n\t\t\t\t? {\n\t\t\t\t\t\tsummarySequenceNumber: this.wipReferenceSequenceNumber,\n\t\t\t\t\t\tlatestSummarySequenceNumber: this._latestSummary.referenceSequenceNumber,\n\t\t\t\t\t\t// TODO: remove summaryPath\n\t\t\t\t\t\tsummaryPath: this._latestSummary.fullPath.path,\n\t\t\t\t }\n\t\t\t\t: undefined;\n\n\t\tconst result = await this.summarizeInternalFn(\n\t\t\tfullTree,\n\t\t\ttrue,\n\t\t\ttelemetryContext,\n\t\t\tincrementalSummaryContext,\n\t\t);\n\t\tthis.wipLocalPaths = { localPath: EscapedPath.create(result.id) };\n\t\tif (result.pathPartsForChildren !== undefined) {\n\t\t\tthis.wipLocalPaths.additionalPath = EscapedPath.createAndConcat(\n\t\t\t\tresult.pathPartsForChildren,\n\t\t\t);\n\t\t}\n\t\treturn { summary: result.summary, stats: result.stats };\n\t}\n\n\t/**\n\t * Validates that the in-progress summary is correct, i.e., summarize should have run for all non-skipped\n\t * nodes. This will only be called for the root summarizer node and is called by it recursively on all child nodes.\n\t *\n\t * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.\n\t * In case of failure, additional information is returned indicating type of failure and where it was.\n\t */\n\tpublic validateSummary(): ValidateSummaryResult {\n\t\treturn this.validateSummaryCore(false /* parentSkipRecursion */);\n\t}\n\n\t/**\n\t * Validates that the in-progress summary is correct for all nodes, i.e., summarize should have run for all\n\t * non-skipped nodes.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.\n\t * In that case, the children will not have work-in-progress state.\n\t *\n\t * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.\n\t * In case of failure, additional information is returned indicating type of failure and where it was.\n\t */\n\tprotected validateSummaryCore(parentSkipRecursion: boolean): ValidateSummaryResult {\n\t\tif (this.wasSummarizeMissed(parentSkipRecursion)) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\treason: \"NodeDidNotSummarize\",\n\t\t\t\tid: {\n\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\tvalue: this.telemetryNodeId,\n\t\t\t\t},\n\t\t\t\t// These errors are usually transient and should go away when summarize is retried.\n\t\t\t\tretryAfterSeconds: 1,\n\t\t\t};\n\t\t}\n\t\tif (parentSkipRecursion) {\n\t\t\treturn { success: true };\n\t\t}\n\n\t\tfor (const child of this.children.values()) {\n\t\t\tconst result = child.validateSummaryCore(this.wipSkipRecursion || parentSkipRecursion);\n\t\t\t// If any child fails, return the failure.\n\t\t\tif (!result.success) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn { success: true };\n\t}\n\n\tprivate wasSummarizeMissed(parentSkipRecursion: boolean): boolean {\n\t\tassert(\n\t\t\tthis.wipSummaryLogger !== undefined,\n\t\t\t0x6fc /* wipSummaryLogger should have been set in startSummary or ctor */,\n\t\t);\n\t\tassert(this.wipReferenceSequenceNumber !== undefined, 0x6fd /* Not tracking a summary */);\n\n\t\t// If the parent node skipped recursion, it did not call summarize on this node. So, summarize was not missed\n\t\t// but was intentionally not called.\n\t\t// Otherwise, summarize should have been called on this node and wipLocalPaths must be set.\n\t\tif (parentSkipRecursion || this.wipLocalPaths !== undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * The absence of wip local path indicates that summarize was not called for this node. Return failure.\n\t\t * This can happen if:\n\t\t * 1. A child node was created after summarize was already called on the parent. For example, a data store\n\t\t * is realized (loaded) after summarize was called on it creating summarizer nodes for its DDSes. In this case,\n\t\t * parentSkipRecursion will be true and the if block above would handle it.\n\t\t * 2. A new node was created but summarize was never called on it. This can mean that the summary that is\n\t\t * generated may not have the data from this node. We should not continue, log and throw an error. This\n\t\t * will help us identify these cases and take appropriate action.\n\t\t *\n\t\t * This happens due to scenarios such as data store created during summarize. Such errors should go away when\n\t\t * summarize is attempted again.\n\t\t */\n\t\treturn true;\n\t}\n\n\t/**\n\t * Called after summary has been uploaded to the server. Add the work-in-progress state to the pending summary\n\t * queue. We track this until we get an ack from the server for this summary.\n\t * @param proposalHandle - The handle of the summary that was uploaded to the server.\n\t */\n\tpublic completeSummary(proposalHandle: string, validate: boolean) {\n\t\tthis.completeSummaryCore(\n\t\t\tproposalHandle,\n\t\t\tundefined /* parentPath */,\n\t\t\tfalse /* parentSkipRecursion */,\n\t\t\tvalidate,\n\t\t);\n\t}\n\n\t/**\n\t * Recursive implementation for completeSummary, with additional internal-only parameters.\n\t * @param proposalHandle - The handle of the summary that was uploaded to the server.\n\t * @param parentPath - The path of the parent node which is used to build the path of this node.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.\n\t * In that case, the children will not have work-in-progress state.\n\t * @param validate - true to validate that the in-progress summary is correct for all nodes.\n\t */\n\tprotected completeSummaryCore(\n\t\tproposalHandle: string,\n\t\tparentPath: EscapedPath | undefined,\n\t\tparentSkipRecursion: boolean,\n\t\tvalidate: boolean,\n\t) {\n\t\tif (validate && this.wasSummarizeMissed(parentSkipRecursion)) {\n\t\t\tthis.throwUnexpectedError({\n\t\t\t\teventName: \"NodeDidNotSummarize\",\n\t\t\t\tproposalHandle,\n\t\t\t});\n\t\t}\n\n\t\tassert(this.wipReferenceSequenceNumber !== undefined, 0x1a4 /* \"Not tracking a summary\" */);\n\t\tlet localPathsToUse = this.wipLocalPaths;\n\n\t\tif (parentSkipRecursion) {\n\t\t\tconst latestSummary = this._latestSummary;\n\t\t\tif (latestSummary !== undefined) {\n\t\t\t\t// This case the parent node created a failure summary or was reused.\n\t\t\t\t// This node and all children should only try to reference their path\n\t\t\t\t// by its last known good state in the actual summary tree.\n\t\t\t\t// If parent fails or is reused, the child summarize is not called so\n\t\t\t\t// it did not get a chance to change its paths.\n\t\t\t\t// In this case, essentially only propagate the new summary ref seq num.\n\t\t\t\tlocalPathsToUse = {\n\t\t\t\t\tlocalPath: latestSummary.localPath,\n\t\t\t\t\tadditionalPath: latestSummary.additionalPath,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// This case the child is added after the latest non-failure summary.\n\t\t\t\t// This node and all children should consider themselves as still not\n\t\t\t\t// having a successful summary yet.\n\t\t\t\t// We cannot \"reuse\" this node if unchanged since that summary, because\n\t\t\t\t// handles will be unable to point to that node. It never made it to the\n\t\t\t\t// tree itself, and only exists as an attach op in the _outstandingOps.\n\t\t\t\tthis.clearSummary();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// If localPathsToUse is undefined, it means summarize didn't run for this node and in that case the validate\n\t\t// step should have failed.\n\t\tassert(localPathsToUse !== undefined, 0x6fe /* summarize didn't run for node */);\n\t\tconst summary = new SummaryNode({\n\t\t\t...localPathsToUse,\n\t\t\treferenceSequenceNumber: this.wipReferenceSequenceNumber,\n\t\t\tbasePath: parentPath,\n\t\t});\n\t\tconst fullPathForChildren = summary.fullPathForChildren;\n\t\tfor (const child of this.children.values()) {\n\t\t\tchild.completeSummaryCore(\n\t\t\t\tproposalHandle,\n\t\t\t\tfullPathForChildren,\n\t\t\t\tthis.wipSkipRecursion || parentSkipRecursion,\n\t\t\t\tvalidate,\n\t\t\t);\n\t\t}\n\t\t// Note that this overwrites existing pending summary with\n\t\t// the same proposalHandle. If proposalHandle is something like\n\t\t// a hash or unique identifier, this should be fine. If storage\n\t\t// can return the same proposalHandle for a different summary,\n\t\t// this should still be okay, because we should be proposing the\n\t\t// newer one later which would have to overwrite the previous one.\n\t\tthis.pendingSummaries.set(proposalHandle, summary);\n\t\tthis.clearSummary();\n\t}\n\n\tpublic clearSummary() {\n\t\tthis.wipReferenceSequenceNumber = undefined;\n\t\tthis.wipLocalPaths = undefined;\n\t\tthis.wipSkipRecursion = false;\n\t\tthis.wipSummaryLogger = undefined;\n\t\tfor (const child of this.children.values()) {\n\t\t\tchild.clearSummary();\n\t\t}\n\t}\n\n\t/**\n\t * Refreshes the latest summary tracked by this node. If we have a pending summary for the given proposal handle,\n\t * it becomes the latest summary. If the current summary is already ahead, we skip the update.\n\t * If the current summary is behind, then we do not refresh.\n\t *\n\t * @returns true if the summary is tracked by this node, false otherwise.\n\t */\n\tpublic async refreshLatestSummary(\n\t\tproposalHandle: string,\n\t\tsummaryRefSeq: number,\n\t): Promise<IRefreshSummaryResult> {\n\t\tconst eventProps: {\n\t\t\tproposalHandle: string | undefined;\n\t\t\tsummaryRefSeq: number;\n\t\t\treferenceSequenceNumber: number;\n\t\t\tisSummaryTracked?: boolean;\n\t\t\tpendingSummaryFound?: boolean;\n\t\t} = {\n\t\t\tproposalHandle,\n\t\t\tsummaryRefSeq,\n\t\t\treferenceSequenceNumber: this.referenceSequenceNumber,\n\t\t};\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"refreshLatestSummary\",\n\t\t\t\t...eventProps,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\t// Refresh latest summary should not happen while a summary is in progress. If it does, it can result\n\t\t\t\t// in inconsistent state, so, we should not continue;\n\t\t\t\tif (this.isSummaryInProgress()) {\n\t\t\t\t\tthrow new LoggingError(\"UnexpectedRefreshDuringSummarize\", {\n\t\t\t\t\t\tinProgressSummaryRefSeq: this.wipReferenceSequenceNumber,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tlet isSummaryTracked = false;\n\t\t\t\tlet isSummaryNewer = false;\n\n\t\t\t\tif (summaryRefSeq > this.referenceSequenceNumber) {\n\t\t\t\t\tisSummaryNewer = true;\n\t\t\t\t}\n\t\t\t\tconst maybeSummaryNode = this.pendingSummaries.get(proposalHandle);\n\t\t\t\tif (maybeSummaryNode !== undefined) {\n\t\t\t\t\tthis.refreshLatestSummaryFromPending(\n\t\t\t\t\t\tproposalHandle,\n\t\t\t\t\t\tmaybeSummaryNode.referenceSequenceNumber,\n\t\t\t\t\t);\n\t\t\t\t\tisSummaryTracked = true;\n\t\t\t\t}\n\t\t\t\tevent.end({ ...eventProps, isSummaryNewer, pendingSummaryFound: isSummaryTracked });\n\t\t\t\treturn { isSummaryTracked, isSummaryNewer };\n\t\t\t},\n\t\t\t{ start: true, end: true, cancel: \"error\" },\n\t\t);\n\t}\n\t/**\n\t * Called when we get an ack from the server for a summary we've just sent. Updates the reference state of this node\n\t * from the state in the pending summary queue.\n\t * @param proposalHandle - Handle for the current proposal.\n\t * @param referenceSequenceNumber - Reference sequence number of sent summary.\n\t */\n\tprotected refreshLatestSummaryFromPending(\n\t\tproposalHandle: string,\n\t\treferenceSequenceNumber: number,\n\t): void {\n\t\tconst summaryNode = this.pendingSummaries.get(proposalHandle);\n\t\tif (summaryNode === undefined) {\n\t\t\t// This should only happen if parent skipped recursion AND no prior summary existed.\n\t\t\tassert(\n\t\t\t\tthis._latestSummary === undefined,\n\t\t\t\t0x1a6 /* \"Not found pending summary, but this node has previously completed a summary\" */,\n\t\t\t);\n\t\t\treturn;\n\t\t} else {\n\t\t\tassert(\n\t\t\t\treferenceSequenceNumber === summaryNode.referenceSequenceNumber,\n\t\t\t\t0x1a7 /* Pending summary reference sequence number should be consistent */,\n\t\t\t);\n\n\t\t\t// Clear earlier pending summaries\n\t\t\tthis.pendingSummaries.delete(proposalHandle);\n\t\t}\n\n\t\tthis.refreshLatestSummaryCore(referenceSequenceNumber);\n\n\t\tthis._latestSummary = summaryNode;\n\t\t// Propagate update to all child nodes\n\t\tfor (const child of this.children.values()) {\n\t\t\tchild.refreshLatestSummaryFromPending(proposalHandle, referenceSequenceNumber);\n\t\t}\n\t}\n\n\tprivate refreshLatestSummaryCore(referenceSequenceNumber: number): void {\n\t\tfor (const [key, value] of this.pendingSummaries) {\n\t\t\tif (value.referenceSequenceNumber < referenceSequenceNumber) {\n\t\t\t\tthis.pendingSummaries.delete(key);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic updateBaseSummaryState(snapshot: ISnapshotTree) {\n\t\t// Check base summary to see if it has any additional path parts\n\t\t// separating child SummarizerNodes. Checks for .channels subtrees.\n\t\tconst { childrenPathPart } = parseSummaryForSubtrees(snapshot);\n\t\tif (childrenPathPart !== undefined && this._latestSummary !== undefined) {\n\t\t\tthis._latestSummary.additionalPath = EscapedPath.create(childrenPathPart);\n\t\t}\n\t}\n\n\tpublic recordChange(op: ISequencedDocumentMessage): void {\n\t\tthis.invalidate(op.sequenceNumber);\n\t}\n\n\tpublic invalidate(sequenceNumber: number): void {\n\t\tif (sequenceNumber > this._changeSequenceNumber) {\n\t\t\tthis._changeSequenceNumber = sequenceNumber;\n\t\t}\n\t}\n\n\t/**\n\t * True if a change has been recorded with sequence number exceeding\n\t * the latest successfully acked summary reference sequence number.\n\t * False implies that the previous summary can be reused.\n\t */\n\tprotected hasChanged(): boolean {\n\t\treturn this._changeSequenceNumber > this.referenceSequenceNumber;\n\t}\n\n\tpublic get latestSummary(): Readonly<SummaryNode> | undefined {\n\t\treturn this._latestSummary;\n\t}\n\n\tprotected readonly canReuseHandle: boolean;\n\n\tpublic createChild(\n\t\t/** Summarize function */\n\t\tsummarizeInternalFn: SummarizeInternalFn,\n\t\t/** Initial id or path part of this node */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t\tconfig: ISummarizerNodeConfig = {},\n\t): ISummarizerNode {\n\t\tassert(!this.children.has(id), 0x1ab /* \"Create SummarizerNode child already exists\" */);\n\n\t\tconst createDetails: ICreateChildDetails = this.getCreateDetailsForChild(id, createParam);\n\t\tconst child = new SummarizerNode(\n\t\t\tthis.logger,\n\t\t\tsummarizeInternalFn,\n\t\t\tconfig,\n\t\t\tcreateDetails.changeSequenceNumber,\n\t\t\tcreateDetails.latestSummary,\n\t\t\tthis.wipSummaryLogger,\n\t\t\tcreateDetails.telemetryNodeId,\n\t\t);\n\n\t\t// There may be additional state that has to be updated in this child. For example, if a summary is being\n\t\t// tracked, the child's summary tracking state needs to be updated too. Same goes for pendingSummaries we might\n\t\t// have outstanding on the parent in case we realize nodes in between Summary Op and Summary Ack.\n\t\tthis.maybeUpdateChildState(child, id);\n\n\t\tthis.children.set(id, child);\n\t\treturn child;\n\t}\n\n\tpublic getChild(id: string): ISummarizerNode | undefined {\n\t\treturn this.children.get(id);\n\t}\n\n\t/**\n\t * Returns the details needed to create a child node.\n\t * @param id - Initial id or path part of the child node.\n\t * @param createParam - Information needed to create the node.\n\t * @returns the details needed to create the child node.\n\t */\n\tprotected getCreateDetailsForChild(\n\t\tid: string,\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t): ICreateChildDetails {\n\t\tlet latestSummary: SummaryNode | undefined;\n\t\tlet changeSequenceNumber: number;\n\n\t\tconst parentLatestSummary = this._latestSummary;\n\t\tswitch (createParam.type) {\n\t\t\tcase CreateSummarizerNodeSource.FromAttach: {\n\t\t\t\tif (\n\t\t\t\t\tparentLatestSummary !== undefined &&\n\t\t\t\t\tcreateParam.sequenceNumber <= parentLatestSummary.referenceSequenceNumber\n\t\t\t\t) {\n\t\t\t\t\t// Prioritize latest summary if it was after this node was attached.\n\t\t\t\t\tlatestSummary = parentLatestSummary.createForChild(id);\n\t\t\t\t}\n\t\t\t\tchangeSequenceNumber = createParam.sequenceNumber;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase CreateSummarizerNodeSource.FromSummary:\n\t\t\tcase CreateSummarizerNodeSource.Local: {\n\t\t\t\tlatestSummary = parentLatestSummary?.createForChild(id);\n\t\t\t\tchangeSequenceNumber = parentLatestSummary?.referenceSequenceNumber ?? -1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tconst type = (createParam as unknown as CreateChildSummarizerNodeParam).type;\n\t\t\t\tunreachableCase(createParam, `Unexpected CreateSummarizerNodeSource: ${type}`);\n\t\t\t}\n\t\t}\n\n\t\tconst childTelemetryNodeId = `${this.telemetryNodeId ?? \"\"}/${id}`;\n\n\t\treturn {\n\t\t\tlatestSummary,\n\t\t\tchangeSequenceNumber,\n\t\t\ttelemetryNodeId: childTelemetryNodeId,\n\t\t};\n\t}\n\n\t/**\n\t * Updates the state of the child if required. For example, if a summary is currently being tracked, the child's\n\t * summary tracking state needs to be updated too.\n\t * Also, in case a child node gets realized in between Summary Op and Summary Ack, let's initialize the child's\n\t * pending summary as well.\n\t * @param child - The child node whose state is to be updated.\n\t * @param id - Initial id or path part of this node\n\t *\n\t */\n\tprotected maybeUpdateChildState(child: SummarizerNode, id: string) {\n\t\t// If a summary is in progress, this child was created after the summary started. So, we need to update the\n\t\t// child's summary state as well.\n\t\tif (this.isSummaryInProgress()) {\n\t\t\tchild.wipReferenceSequenceNumber = this.wipReferenceSequenceNumber;\n\t\t}\n\t\t// In case we have pending summaries on the parent, let's initialize it on the child.\n\t\tif (child._latestSummary !== undefined) {\n\t\t\tfor (const [key, value] of this.pendingSummaries.entries()) {\n\t\t\t\tconst newLatestSummaryNode = new SummaryNode({\n\t\t\t\t\treferenceSequenceNumber: value.referenceSequenceNumber,\n\t\t\t\t\tbasePath: child._latestSummary.basePath,\n\t\t\t\t\tlocalPath: child._latestSummary.localPath,\n\t\t\t\t});\n\n\t\t\t\tchild.addPendingSummary(key, newLatestSummaryNode);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected addPendingSummary(key: string, summary: SummaryNode) {\n\t\tthis.pendingSummaries.set(key, summary);\n\t}\n\n\t/**\n\t * Tells whether summary tracking is in progress. True if \"startSummary\" API is called before summarize.\n\t */\n\tpublic isSummaryInProgress(): boolean {\n\t\treturn this.wipReferenceSequenceNumber !== undefined;\n\t}\n\n\t/**\n\t * Creates and throws an error due to unexpected conditions.\n\t */\n\tprotected throwUnexpectedError(eventProps: ITelemetryErrorEventExt): never {\n\t\tconst error = new LoggingError(eventProps.eventName, {\n\t\t\t...eventProps,\n\t\t\treferenceSequenceNumber: this.wipReferenceSequenceNumber,\n\t\t\t...tagCodeArtifacts({\n\t\t\t\tid: this.telemetryNodeId,\n\t\t\t}),\n\t\t});\n\t\tthis.logger.sendErrorEvent(eventProps, error);\n\t\tthrow error;\n\t}\n}\n\n/**\n * Creates a root summarizer node.\n * @param logger - Logger to use within SummarizerNode\n * @param summarizeInternalFn - Function to generate summary\n * @param changeSequenceNumber - Sequence number of latest change to new node/subtree\n * @param referenceSequenceNumber - Reference sequence number of last acked summary,\n * or undefined if not loaded from summary\n * @param config - Configure behavior of summarizer node\n */\nexport const createRootSummarizerNode = (\n\tlogger: ITelemetryLoggerExt,\n\tsummarizeInternalFn: SummarizeInternalFn,\n\tchangeSequenceNumber: number,\n\treferenceSequenceNumber: number | undefined,\n\tconfig: ISummarizerNodeConfig = {},\n): IRootSummarizerNode =>\n\tnew SummarizerNode(\n\t\tlogger,\n\t\tsummarizeInternalFn,\n\t\tconfig,\n\t\tchangeSequenceNumber,\n\t\treferenceSequenceNumber === undefined\n\t\t\t? undefined\n\t\t\t: SummaryNode.createForRoot(referenceSequenceNumber),\n\t\tundefined /* wipSummaryLogger */,\n\t\t\"\" /* telemetryNodeId */,\n\t);\n"]}
1
+ {"version":3,"file":"summarizerNode.js","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAGN,WAAW,GACX,MAAM,sCAAsC,CAAC;AAK9C,OAAO,EAEN,0BAA0B,GAK1B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAEN,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EACN,WAAW,EAKX,WAAW,EAEX,uBAAuB,GACvB,MAAM,0BAA0B,CAAC;AAIlC;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,cAAc;IAC1B;;;OAGG;IACH,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,cAAc,EAAE,uBAAuB,IAAI,CAAC,CAAC;IAC1D,CAAC;IAUD;;;OAGG;IACH,YACC,UAAgC,EACf,mBAAwC,EACzD,MAA6B,EACrB,qBAA6B;IACrC,8CAA8C;IACtC,cAA4B,EAC1B,gBAAuC;IACjD,oEAAoE;IAC1D,eAAwB;QAPjB,wBAAmB,GAAnB,mBAAmB,CAAqB;QAEjD,0BAAqB,GAArB,qBAAqB,CAAQ;QAE7B,mBAAc,GAAd,cAAc,CAAc;QAC1B,qBAAgB,GAAhB,gBAAgB,CAAuB;QAEvC,oBAAe,GAAf,eAAe,CAAS;QArBhB,aAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;QAC7C,qBAAg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,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAC9C,MAAM,KAAK,CAAC;IACb,CAAC;CACD;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACvC,MAA2B,EAC3B,mBAAwC,EACxC,oBAA4B,EAC5B,uBAA2C,EAC3C,SAAgC,EAAE,EACZ,EAAE,CACxB,IAAI,cAAc,CACjB,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,oBAAoB,EACpB,uBAAuB,KAAK,SAAS;IACpC,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,uBAAuB,CAAC,EACrD,SAAS,CAAC,sBAAsB,EAChC,EAAE,CAAC,qBAAqB,CACxB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n\tSummaryType,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n\tIExperimentalIncrementalSummaryContext,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tCreateChildSummarizerNodeParam,\n\tCreateSummarizerNodeSource,\n\tISummarizeResult,\n\tISummarizerNode,\n\tISummarizerNodeConfig,\n\tSummarizeInternalFn,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { mergeStats } from \"@fluidframework/runtime-utils/internal\";\nimport { type ITelemetryErrorEventExt } from \"@fluidframework/telemetry-utils/internal\";\nimport {\n\tITelemetryLoggerExt,\n\tLoggingError,\n\tPerformanceEvent,\n\tTelemetryDataTag,\n\tcreateChildLogger,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\tEscapedPath,\n\tICreateChildDetails,\n\tIRefreshSummaryResult,\n\tIStartSummaryResult,\n\tISummarizerNodeRootContract,\n\tSummaryNode,\n\tValidateSummaryResult,\n\tparseSummaryForSubtrees,\n} from \"./summarizerNodeUtils.js\";\n\nexport interface IRootSummarizerNode extends ISummarizerNode, ISummarizerNodeRootContract {}\n\n/**\n * Encapsulates the summarizing work and state of an individual tree node in the\n * summary tree. It tracks changes and allows for optimizations when unchanged, or\n * can allow for fallback summaries to be generated when an error is encountered.\n * Usage is for the root node to call startSummary first to begin tracking a WIP\n * (work in progress) summary. Then all nodes will call summarize to summaries their\n * individual parts. Once completed and uploaded to storage, the root node will call\n * completeSummary or clearSummary to clear the WIP summary tracking state if something\n * went wrong. The SummarizerNodes will track all pending summaries that have been\n * recorded by the completeSummary call. When one of them is acked, the root node should\n * call refreshLatestSummary to inform the tree of SummarizerNodes of the new baseline\n * latest successful summary.\n */\nexport class SummarizerNode implements IRootSummarizerNode {\n\t/**\n\t * The reference sequence number of the most recent acked summary.\n\t * Returns 0 if there is not yet an acked summary.\n\t */\n\tpublic get referenceSequenceNumber() {\n\t\treturn this._latestSummary?.referenceSequenceNumber ?? 0;\n\t}\n\n\tprotected readonly children = new Map<string, SummarizerNode>();\n\tprotected readonly pendingSummaries = new Map<string, SummaryNode>();\n\tprotected wipReferenceSequenceNumber: number | undefined;\n\tprivate wipLocalPaths: { localPath: EscapedPath; additionalPath?: EscapedPath } | undefined;\n\tprivate wipSkipRecursion = false;\n\n\tprotected readonly logger: ITelemetryLoggerExt;\n\n\t/**\n\t * Do not call constructor directly.\n\t * Use createRootSummarizerNode to create root node, or createChild to create child nodes.\n\t */\n\tpublic constructor(\n\t\tbaseLogger: ITelemetryBaseLogger,\n\t\tprivate readonly summarizeInternalFn: SummarizeInternalFn,\n\t\tconfig: ISummarizerNodeConfig,\n\t\tprivate _changeSequenceNumber: number,\n\t\t/** Undefined means created without summary */\n\t\tprivate _latestSummary?: SummaryNode,\n\t\tprotected wipSummaryLogger?: ITelemetryBaseLogger,\n\t\t/** A unique id of this node to be logged when sending telemetry. */\n\t\tprotected telemetryNodeId?: string,\n\t) {\n\t\tthis.canReuseHandle = config.canReuseHandle ?? true;\n\t\t// All logs posted by the summarizer node should include the telemetryNodeId.\n\t\tthis.logger = createChildLogger({\n\t\t\tlogger: baseLogger,\n\t\t\tproperties: {\n\t\t\t\tall: tagCodeArtifacts({ id: this.telemetryNodeId }),\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * In order to produce a summary with a summarizer node, the summarizer node system must be notified a summary has\n\t * started. This is done by calling startSummary. This will track the reference sequence number of the summary and\n\t * run some validation checks to ensure the summary is correct.\n\t * @param referenceSequenceNumber - the number of ops processed up to this point\n\t * @param summaryLogger - the logger to use for the summary\n\t * @param latestSummaryRefSeqNum - the reference sequence number of the latest summary. Another way to think about\n\t * it is the reference sequence number of the previous summary.\n\t * @returns the number of nodes in the tree, the number of nodes that are invalid, and the different types of\n\t * sequence number mismatches\n\t */\n\tpublic startSummary(\n\t\treferenceSequenceNumber: number,\n\t\tsummaryLogger: ITelemetryBaseLogger,\n\t\tlatestSummaryRefSeqNum: number,\n\t): IStartSummaryResult {\n\t\tassert(\n\t\t\tthis.wipSummaryLogger === undefined,\n\t\t\t0x19f /* \"wipSummaryLogger should not be set yet in startSummary\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.wipReferenceSequenceNumber === undefined,\n\t\t\t0x1a0 /* \"Already tracking a summary\" */,\n\t\t);\n\n\t\tlet nodes = 1;\n\t\tlet invalidNodes = 0;\n\t\tconst sequenceNumberMismatchKeySet = new Set<string>();\n\t\tconst nodeLatestSummaryRefSeqNum = this._latestSummary?.referenceSequenceNumber;\n\t\tif (\n\t\t\tnodeLatestSummaryRefSeqNum !== undefined &&\n\t\t\tlatestSummaryRefSeqNum !== nodeLatestSummaryRefSeqNum\n\t\t) {\n\t\t\tinvalidNodes++;\n\t\t\tsequenceNumberMismatchKeySet.add(\n\t\t\t\t`${latestSummaryRefSeqNum}-${nodeLatestSummaryRefSeqNum}`,\n\t\t\t);\n\t\t}\n\n\t\tthis.wipSummaryLogger = summaryLogger;\n\n\t\tfor (const child of this.children.values()) {\n\t\t\tconst childStartSummaryResult = child.startSummary(\n\t\t\t\treferenceSequenceNumber,\n\t\t\t\tthis.wipSummaryLogger,\n\t\t\t\tlatestSummaryRefSeqNum,\n\t\t\t);\n\t\t\tnodes += childStartSummaryResult.nodes;\n\t\t\tinvalidNodes += childStartSummaryResult.invalidNodes;\n\t\t\tfor (const invalidSequenceNumber of childStartSummaryResult.mismatchNumbers) {\n\t\t\t\tsequenceNumberMismatchKeySet.add(invalidSequenceNumber);\n\t\t\t}\n\t\t}\n\t\tthis.wipReferenceSequenceNumber = referenceSequenceNumber;\n\t\treturn {\n\t\t\tnodes,\n\t\t\tinvalidNodes,\n\t\t\tmismatchNumbers: sequenceNumberMismatchKeySet,\n\t\t};\n\t}\n\n\tpublic async summarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult> {\n\t\tassert(\n\t\t\tthis.isSummaryInProgress(),\n\t\t\t0x1a1 /* \"summarize should not be called when not tracking the summary\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.wipSummaryLogger !== undefined,\n\t\t\t0x1a2 /* \"wipSummaryLogger should have been set in startSummary or ctor\" */,\n\t\t);\n\n\t\t// Try to reuse the tree if unchanged\n\t\tif (this.canReuseHandle && !fullTree && !this.hasChanged()) {\n\t\t\tconst latestSummary = this._latestSummary;\n\t\t\tif (latestSummary !== undefined) {\n\t\t\t\tthis.wipLocalPaths = {\n\t\t\t\t\tlocalPath: latestSummary.localPath,\n\t\t\t\t\tadditionalPath: latestSummary.additionalPath,\n\t\t\t\t};\n\t\t\t\tthis.wipSkipRecursion = true;\n\t\t\t\tconst stats = mergeStats();\n\t\t\t\tstats.handleNodeCount++;\n\t\t\t\treturn {\n\t\t\t\t\tsummary: {\n\t\t\t\t\t\ttype: SummaryType.Handle,\n\t\t\t\t\t\thandle: latestSummary.fullPath.path,\n\t\t\t\t\t\thandleType: SummaryType.Tree,\n\t\t\t\t\t},\n\t\t\t\t\tstats,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// This assert is the same the other 0a1x1 assert `isSummaryInProgress`, the only difference is that typescript\n\t\t// complains if this assert isn't done this way\n\t\tassert(\n\t\t\tthis.wipReferenceSequenceNumber !== undefined,\n\t\t\t0x5df /* Summarize should not be called when not tracking the summary */,\n\t\t);\n\t\tconst incrementalSummaryContext: IExperimentalIncrementalSummaryContext | undefined =\n\t\t\tthis._latestSummary !== undefined\n\t\t\t\t? {\n\t\t\t\t\t\tsummarySequenceNumber: this.wipReferenceSequenceNumber,\n\t\t\t\t\t\tlatestSummarySequenceNumber: this._latestSummary.referenceSequenceNumber,\n\t\t\t\t\t\t// TODO: remove summaryPath\n\t\t\t\t\t\tsummaryPath: this._latestSummary.fullPath.path,\n\t\t\t\t }\n\t\t\t\t: undefined;\n\n\t\tconst result = await this.summarizeInternalFn(\n\t\t\tfullTree,\n\t\t\ttrue,\n\t\t\ttelemetryContext,\n\t\t\tincrementalSummaryContext,\n\t\t);\n\t\tthis.wipLocalPaths = { localPath: EscapedPath.create(result.id) };\n\t\tif (result.pathPartsForChildren !== undefined) {\n\t\t\tthis.wipLocalPaths.additionalPath = EscapedPath.createAndConcat(\n\t\t\t\tresult.pathPartsForChildren,\n\t\t\t);\n\t\t}\n\t\treturn { summary: result.summary, stats: result.stats };\n\t}\n\n\t/**\n\t * Validates that the in-progress summary is correct, i.e., summarize should have run for all non-skipped\n\t * nodes. This will only be called for the root summarizer node and is called by it recursively on all child nodes.\n\t *\n\t * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.\n\t * In case of failure, additional information is returned indicating type of failure and where it was.\n\t */\n\tpublic validateSummary(): ValidateSummaryResult {\n\t\treturn this.validateSummaryCore(false /* parentSkipRecursion */);\n\t}\n\n\t/**\n\t * Validates that the in-progress summary is correct for all nodes, i.e., summarize should have run for all\n\t * non-skipped nodes.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.\n\t * In that case, the children will not have work-in-progress state.\n\t *\n\t * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.\n\t * In case of failure, additional information is returned indicating type of failure and where it was.\n\t */\n\tprotected validateSummaryCore(parentSkipRecursion: boolean): ValidateSummaryResult {\n\t\tif (this.wasSummarizeMissed(parentSkipRecursion)) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\treason: \"NodeDidNotSummarize\",\n\t\t\t\tid: {\n\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\tvalue: this.telemetryNodeId,\n\t\t\t\t},\n\t\t\t\t// These errors are usually transient and should go away when summarize is retried.\n\t\t\t\tretryAfterSeconds: 1,\n\t\t\t};\n\t\t}\n\t\tif (parentSkipRecursion) {\n\t\t\treturn { success: true };\n\t\t}\n\n\t\tfor (const child of this.children.values()) {\n\t\t\tconst result = child.validateSummaryCore(this.wipSkipRecursion || parentSkipRecursion);\n\t\t\t// If any child fails, return the failure.\n\t\t\tif (!result.success) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn { success: true };\n\t}\n\n\tprivate wasSummarizeMissed(parentSkipRecursion: boolean): boolean {\n\t\tassert(\n\t\t\tthis.wipSummaryLogger !== undefined,\n\t\t\t0x6fc /* wipSummaryLogger should have been set in startSummary or ctor */,\n\t\t);\n\t\tassert(this.wipReferenceSequenceNumber !== undefined, 0x6fd /* Not tracking a summary */);\n\n\t\t// If the parent node skipped recursion, it did not call summarize on this node. So, summarize was not missed\n\t\t// but was intentionally not called.\n\t\t// Otherwise, summarize should have been called on this node and wipLocalPaths must be set.\n\t\tif (parentSkipRecursion || this.wipLocalPaths !== undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * The absence of wip local path indicates that summarize was not called for this node. Return failure.\n\t\t * This can happen if:\n\t\t * 1. A child node was created after summarize was already called on the parent. For example, a data store\n\t\t * is realized (loaded) after summarize was called on it creating summarizer nodes for its DDSes. In this case,\n\t\t * parentSkipRecursion will be true and the if block above would handle it.\n\t\t * 2. A new node was created but summarize was never called on it. This can mean that the summary that is\n\t\t * generated may not have the data from this node. We should not continue, log and throw an error. This\n\t\t * will help us identify these cases and take appropriate action.\n\t\t *\n\t\t * This happens due to scenarios such as data store created during summarize. Such errors should go away when\n\t\t * summarize is attempted again.\n\t\t */\n\t\treturn true;\n\t}\n\n\t/**\n\t * Called after summary has been uploaded to the server. Add the work-in-progress state to the pending summary\n\t * queue. We track this until we get an ack from the server for this summary.\n\t * @param proposalHandle - The handle of the summary that was uploaded to the server.\n\t */\n\tpublic completeSummary(proposalHandle: string) {\n\t\tthis.completeSummaryCore(\n\t\t\tproposalHandle,\n\t\t\tundefined /* parentPath */,\n\t\t\tfalse /* parentSkipRecursion */,\n\t\t);\n\t}\n\n\t/**\n\t * Recursive implementation for completeSummary, with additional internal-only parameters.\n\t * @param proposalHandle - The handle of the summary that was uploaded to the server.\n\t * @param parentPath - The path of the parent node which is used to build the path of this node.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.\n\t * In that case, the children will not have work-in-progress state.\n\t * @param validate - true to validate that the in-progress summary is correct for all nodes.\n\t */\n\tprotected completeSummaryCore(\n\t\tproposalHandle: string,\n\t\tparentPath: EscapedPath | undefined,\n\t\tparentSkipRecursion: boolean,\n\t) {\n\t\tassert(this.wipReferenceSequenceNumber !== undefined, 0x1a4 /* \"Not tracking a summary\" */);\n\t\tlet localPathsToUse = this.wipLocalPaths;\n\n\t\tif (parentSkipRecursion) {\n\t\t\tconst latestSummary = this._latestSummary;\n\t\t\tif (latestSummary !== undefined) {\n\t\t\t\t// This case the parent node created a failure summary or was reused.\n\t\t\t\t// This node and all children should only try to reference their path\n\t\t\t\t// by its last known good state in the actual summary tree.\n\t\t\t\t// If parent fails or is reused, the child summarize is not called so\n\t\t\t\t// it did not get a chance to change its paths.\n\t\t\t\t// In this case, essentially only propagate the new summary ref seq num.\n\t\t\t\tlocalPathsToUse = {\n\t\t\t\t\tlocalPath: latestSummary.localPath,\n\t\t\t\t\tadditionalPath: latestSummary.additionalPath,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// This case the child is added after the latest non-failure summary.\n\t\t\t\t// This node and all children should consider themselves as still not\n\t\t\t\t// having a successful summary yet.\n\t\t\t\t// We cannot \"reuse\" this node if unchanged since that summary, because\n\t\t\t\t// handles will be unable to point to that node. It never made it to the\n\t\t\t\t// tree itself, and only exists as an attach op in the _outstandingOps.\n\t\t\t\tthis.clearSummary();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// If localPathsToUse is undefined, it means summarize didn't run for this node and in that case the validate\n\t\t// step should have failed.\n\t\tassert(localPathsToUse !== undefined, 0x6fe /* summarize didn't run for node */);\n\t\tconst summary = new SummaryNode({\n\t\t\t...localPathsToUse,\n\t\t\treferenceSequenceNumber: this.wipReferenceSequenceNumber,\n\t\t\tbasePath: parentPath,\n\t\t});\n\t\tconst fullPathForChildren = summary.fullPathForChildren;\n\t\tfor (const child of this.children.values()) {\n\t\t\tchild.completeSummaryCore(\n\t\t\t\tproposalHandle,\n\t\t\t\tfullPathForChildren,\n\t\t\t\tthis.wipSkipRecursion || parentSkipRecursion,\n\t\t\t);\n\t\t}\n\t\t// Note that this overwrites existing pending summary with\n\t\t// the same proposalHandle. If proposalHandle is something like\n\t\t// a hash or unique identifier, this should be fine. If storage\n\t\t// can return the same proposalHandle for a different summary,\n\t\t// this should still be okay, because we should be proposing the\n\t\t// newer one later which would have to overwrite the previous one.\n\t\tthis.pendingSummaries.set(proposalHandle, summary);\n\t\tthis.clearSummary();\n\t}\n\n\tpublic clearSummary() {\n\t\tthis.wipReferenceSequenceNumber = undefined;\n\t\tthis.wipLocalPaths = undefined;\n\t\tthis.wipSkipRecursion = false;\n\t\tthis.wipSummaryLogger = undefined;\n\t\tfor (const child of this.children.values()) {\n\t\t\tchild.clearSummary();\n\t\t}\n\t}\n\n\t/**\n\t * Refreshes the latest summary tracked by this node. If we have a pending summary for the given proposal handle,\n\t * it becomes the latest summary. If the current summary is already ahead, we skip the update.\n\t * If the current summary is behind, then we do not refresh.\n\t *\n\t * @returns true if the summary is tracked by this node, false otherwise.\n\t */\n\tpublic async refreshLatestSummary(\n\t\tproposalHandle: string,\n\t\tsummaryRefSeq: number,\n\t): Promise<IRefreshSummaryResult> {\n\t\tconst eventProps: {\n\t\t\tproposalHandle: string | undefined;\n\t\t\tsummaryRefSeq: number;\n\t\t\treferenceSequenceNumber: number;\n\t\t\tisSummaryTracked?: boolean;\n\t\t\tpendingSummaryFound?: boolean;\n\t\t} = {\n\t\t\tproposalHandle,\n\t\t\tsummaryRefSeq,\n\t\t\treferenceSequenceNumber: this.referenceSequenceNumber,\n\t\t};\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"refreshLatestSummary\",\n\t\t\t\t...eventProps,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\t// Refresh latest summary should not happen while a summary is in progress. If it does, it can result\n\t\t\t\t// in inconsistent state, so, we should not continue;\n\t\t\t\tif (this.isSummaryInProgress()) {\n\t\t\t\t\tthrow new LoggingError(\"UnexpectedRefreshDuringSummarize\", {\n\t\t\t\t\t\tinProgressSummaryRefSeq: this.wipReferenceSequenceNumber,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tlet isSummaryTracked = false;\n\t\t\t\tlet isSummaryNewer = false;\n\n\t\t\t\tif (summaryRefSeq > this.referenceSequenceNumber) {\n\t\t\t\t\tisSummaryNewer = true;\n\t\t\t\t}\n\t\t\t\tconst maybeSummaryNode = this.pendingSummaries.get(proposalHandle);\n\t\t\t\tif (maybeSummaryNode !== undefined) {\n\t\t\t\t\tthis.refreshLatestSummaryFromPending(\n\t\t\t\t\t\tproposalHandle,\n\t\t\t\t\t\tmaybeSummaryNode.referenceSequenceNumber,\n\t\t\t\t\t);\n\t\t\t\t\tisSummaryTracked = true;\n\t\t\t\t}\n\t\t\t\tevent.end({ ...eventProps, isSummaryNewer, pendingSummaryFound: isSummaryTracked });\n\t\t\t\treturn { isSummaryTracked, isSummaryNewer };\n\t\t\t},\n\t\t\t{ start: true, end: true, cancel: \"error\" },\n\t\t);\n\t}\n\t/**\n\t * Called when we get an ack from the server for a summary we've just sent. Updates the reference state of this node\n\t * from the state in the pending summary queue.\n\t * @param proposalHandle - Handle for the current proposal.\n\t * @param referenceSequenceNumber - Reference sequence number of sent summary.\n\t */\n\tprotected refreshLatestSummaryFromPending(\n\t\tproposalHandle: string,\n\t\treferenceSequenceNumber: number,\n\t): void {\n\t\tconst summaryNode = this.pendingSummaries.get(proposalHandle);\n\t\tif (summaryNode === undefined) {\n\t\t\t// This should only happen if parent skipped recursion AND no prior summary existed.\n\t\t\tassert(\n\t\t\t\tthis._latestSummary === undefined,\n\t\t\t\t0x1a6 /* \"Not found pending summary, but this node has previously completed a summary\" */,\n\t\t\t);\n\t\t\treturn;\n\t\t} else {\n\t\t\tassert(\n\t\t\t\treferenceSequenceNumber === summaryNode.referenceSequenceNumber,\n\t\t\t\t0x1a7 /* Pending summary reference sequence number should be consistent */,\n\t\t\t);\n\n\t\t\t// Clear earlier pending summaries\n\t\t\tthis.pendingSummaries.delete(proposalHandle);\n\t\t}\n\n\t\tthis.refreshLatestSummaryCore(referenceSequenceNumber);\n\n\t\tthis._latestSummary = summaryNode;\n\t\t// Propagate update to all child nodes\n\t\tfor (const child of this.children.values()) {\n\t\t\tchild.refreshLatestSummaryFromPending(proposalHandle, referenceSequenceNumber);\n\t\t}\n\t}\n\n\tprivate refreshLatestSummaryCore(referenceSequenceNumber: number): void {\n\t\tfor (const [key, value] of this.pendingSummaries) {\n\t\t\tif (value.referenceSequenceNumber < referenceSequenceNumber) {\n\t\t\t\tthis.pendingSummaries.delete(key);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic updateBaseSummaryState(snapshot: ISnapshotTree) {\n\t\t// Check base summary to see if it has any additional path parts\n\t\t// separating child SummarizerNodes. Checks for .channels subtrees.\n\t\tconst { childrenPathPart } = parseSummaryForSubtrees(snapshot);\n\t\tif (childrenPathPart !== undefined && this._latestSummary !== undefined) {\n\t\t\tthis._latestSummary.additionalPath = EscapedPath.create(childrenPathPart);\n\t\t}\n\t}\n\n\tpublic recordChange(op: ISequencedDocumentMessage): void {\n\t\tthis.invalidate(op.sequenceNumber);\n\t}\n\n\tpublic invalidate(sequenceNumber: number): void {\n\t\tif (sequenceNumber > this._changeSequenceNumber) {\n\t\t\tthis._changeSequenceNumber = sequenceNumber;\n\t\t}\n\t}\n\n\t/**\n\t * True if a change has been recorded with sequence number exceeding\n\t * the latest successfully acked summary reference sequence number.\n\t * False implies that the previous summary can be reused.\n\t */\n\tprotected hasChanged(): boolean {\n\t\treturn this._changeSequenceNumber > this.referenceSequenceNumber;\n\t}\n\n\tpublic get latestSummary(): Readonly<SummaryNode> | undefined {\n\t\treturn this._latestSummary;\n\t}\n\n\tprotected readonly canReuseHandle: boolean;\n\n\tpublic createChild(\n\t\t/** Summarize function */\n\t\tsummarizeInternalFn: SummarizeInternalFn,\n\t\t/** Initial id or path part of this node */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t\tconfig: ISummarizerNodeConfig = {},\n\t): ISummarizerNode {\n\t\tassert(!this.children.has(id), 0x1ab /* \"Create SummarizerNode child already exists\" */);\n\n\t\tconst createDetails: ICreateChildDetails = this.getCreateDetailsForChild(id, createParam);\n\t\tconst child = new SummarizerNode(\n\t\t\tthis.logger,\n\t\t\tsummarizeInternalFn,\n\t\t\tconfig,\n\t\t\tcreateDetails.changeSequenceNumber,\n\t\t\tcreateDetails.latestSummary,\n\t\t\tthis.wipSummaryLogger,\n\t\t\tcreateDetails.telemetryNodeId,\n\t\t);\n\n\t\t// There may be additional state that has to be updated in this child. For example, if a summary is being\n\t\t// tracked, the child's summary tracking state needs to be updated too. Same goes for pendingSummaries we might\n\t\t// have outstanding on the parent in case we realize nodes in between Summary Op and Summary Ack.\n\t\tthis.maybeUpdateChildState(child, id);\n\n\t\tthis.children.set(id, child);\n\t\treturn child;\n\t}\n\n\tpublic getChild(id: string): ISummarizerNode | undefined {\n\t\treturn this.children.get(id);\n\t}\n\n\t/**\n\t * Returns the details needed to create a child node.\n\t * @param id - Initial id or path part of the child node.\n\t * @param createParam - Information needed to create the node.\n\t * @returns the details needed to create the child node.\n\t */\n\tprotected getCreateDetailsForChild(\n\t\tid: string,\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t): ICreateChildDetails {\n\t\tlet latestSummary: SummaryNode | undefined;\n\t\tlet changeSequenceNumber: number;\n\n\t\tconst parentLatestSummary = this._latestSummary;\n\t\tswitch (createParam.type) {\n\t\t\tcase CreateSummarizerNodeSource.FromAttach: {\n\t\t\t\tif (\n\t\t\t\t\tparentLatestSummary !== undefined &&\n\t\t\t\t\tcreateParam.sequenceNumber <= parentLatestSummary.referenceSequenceNumber\n\t\t\t\t) {\n\t\t\t\t\t// Prioritize latest summary if it was after this node was attached.\n\t\t\t\t\tlatestSummary = parentLatestSummary.createForChild(id);\n\t\t\t\t}\n\t\t\t\tchangeSequenceNumber = createParam.sequenceNumber;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase CreateSummarizerNodeSource.FromSummary:\n\t\t\tcase CreateSummarizerNodeSource.Local: {\n\t\t\t\tlatestSummary = parentLatestSummary?.createForChild(id);\n\t\t\t\tchangeSequenceNumber = parentLatestSummary?.referenceSequenceNumber ?? -1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tconst type = (createParam as unknown as CreateChildSummarizerNodeParam).type;\n\t\t\t\tunreachableCase(createParam, `Unexpected CreateSummarizerNodeSource: ${type}`);\n\t\t\t}\n\t\t}\n\n\t\tconst childTelemetryNodeId = `${this.telemetryNodeId ?? \"\"}/${id}`;\n\n\t\treturn {\n\t\t\tlatestSummary,\n\t\t\tchangeSequenceNumber,\n\t\t\ttelemetryNodeId: childTelemetryNodeId,\n\t\t};\n\t}\n\n\t/**\n\t * Updates the state of the child if required. For example, if a summary is currently being tracked, the child's\n\t * summary tracking state needs to be updated too.\n\t * Also, in case a child node gets realized in between Summary Op and Summary Ack, let's initialize the child's\n\t * pending summary as well.\n\t * @param child - The child node whose state is to be updated.\n\t * @param id - Initial id or path part of this node\n\t *\n\t */\n\tprotected maybeUpdateChildState(child: SummarizerNode, id: string) {\n\t\t// If a summary is in progress, this child was created after the summary started. So, we need to update the\n\t\t// child's summary state as well.\n\t\tif (this.isSummaryInProgress()) {\n\t\t\tchild.wipReferenceSequenceNumber = this.wipReferenceSequenceNumber;\n\t\t}\n\t\t// In case we have pending summaries on the parent, let's initialize it on the child.\n\t\tif (child._latestSummary !== undefined) {\n\t\t\tfor (const [key, value] of this.pendingSummaries.entries()) {\n\t\t\t\tconst newLatestSummaryNode = new SummaryNode({\n\t\t\t\t\treferenceSequenceNumber: value.referenceSequenceNumber,\n\t\t\t\t\tbasePath: child._latestSummary.basePath,\n\t\t\t\t\tlocalPath: child._latestSummary.localPath,\n\t\t\t\t});\n\n\t\t\t\tchild.addPendingSummary(key, newLatestSummaryNode);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected addPendingSummary(key: string, summary: SummaryNode) {\n\t\tthis.pendingSummaries.set(key, summary);\n\t}\n\n\t/**\n\t * Tells whether summary tracking is in progress. True if \"startSummary\" API is called before summarize.\n\t */\n\tpublic isSummaryInProgress(): boolean {\n\t\treturn this.wipReferenceSequenceNumber !== undefined;\n\t}\n\n\t/**\n\t * Creates and throws an error due to unexpected conditions.\n\t */\n\tprotected throwUnexpectedError(eventProps: ITelemetryErrorEventExt): never {\n\t\tconst error = new LoggingError(eventProps.eventName, {\n\t\t\t...eventProps,\n\t\t\treferenceSequenceNumber: this.wipReferenceSequenceNumber,\n\t\t\t...tagCodeArtifacts({\n\t\t\t\tid: this.telemetryNodeId,\n\t\t\t}),\n\t\t});\n\t\tthis.logger.sendErrorEvent(eventProps, error);\n\t\tthrow error;\n\t}\n}\n\n/**\n * Creates a root summarizer node.\n * @param logger - Logger to use within SummarizerNode\n * @param summarizeInternalFn - Function to generate summary\n * @param changeSequenceNumber - Sequence number of latest change to new node/subtree\n * @param referenceSequenceNumber - Reference sequence number of last acked summary,\n * or undefined if not loaded from summary\n * @param config - Configure behavior of summarizer node\n */\nexport const createRootSummarizerNode = (\n\tlogger: ITelemetryLoggerExt,\n\tsummarizeInternalFn: SummarizeInternalFn,\n\tchangeSequenceNumber: number,\n\treferenceSequenceNumber: number | undefined,\n\tconfig: ISummarizerNodeConfig = {},\n): IRootSummarizerNode =>\n\tnew SummarizerNode(\n\t\tlogger,\n\t\tsummarizeInternalFn,\n\t\tconfig,\n\t\tchangeSequenceNumber,\n\t\treferenceSequenceNumber === undefined\n\t\t\t? undefined\n\t\t\t: SummaryNode.createForRoot(referenceSequenceNumber),\n\t\tundefined /* wipSummaryLogger */,\n\t\t\"\" /* telemetryNodeId */,\n\t);\n"]}
@@ -3,8 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { ISnapshotTree, SummaryObject } from "@fluidframework/protocol-definitions";
6
- import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
7
- import { TelemetryDataTag } from "@fluidframework/telemetry-utils/internal";
6
+ import { ITelemetryLoggerExt, TelemetryDataTag } from "@fluidframework/telemetry-utils/internal";
8
7
  export interface IRefreshSummaryResult {
9
8
  /** Tells whether this summary is tracked by this client. */
10
9
  isSummaryTracked: boolean;
@@ -41,7 +40,7 @@ export type ValidateSummaryResult = {
41
40
  export interface ISummarizerNodeRootContract {
42
41
  startSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryLoggerExt, latestSummaryRefSeqNum: number): IStartSummaryResult;
43
42
  validateSummary(): ValidateSummaryResult;
44
- completeSummary(proposalHandle: string, validate: boolean): void;
43
+ completeSummary(proposalHandle: string): void;
45
44
  clearSummary(): void;
46
45
  refreshLatestSummary(proposalHandle: string, summaryRefSeq: number): Promise<IRefreshSummaryResult>;
47
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"summarizerNodeUtils.d.ts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAEpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE5E,MAAM,WAAW,qBAAqB;IACrC,4DAA4D;IAC5D,gBAAgB,EAAE,OAAO,CAAC;IAC1B,sFAAsF;IACtF,cAAc,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IACnC,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,6HAA6H;IAC7H,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAC9B;IACA,OAAO,EAAE,IAAI,CAAC;CACb,GACD;IACA,OAAO,EAAE,KAAK,CAAC;IACf,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,EAAE,EAAE;QACH,GAAG,EAAE,gBAAgB,CAAC,YAAY,CAAC;QACnC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;KAC1B,CAAC;IACF,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEL,MAAM,WAAW,2BAA2B;IAC3C,YAAY,CACX,uBAAuB,EAAE,MAAM,EAC/B,aAAa,EAAE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,QAAQ,IAAI,WAAW,CAEjC;IAED;;;OAGG;IACH,IAAW,mBAAmB,IAAI,WAAW,CAI5C;IAED;;;OAGG;IACI,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW;CAO9C;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,2CAA2C;IAC3C,aAAa,EAAE,WAAW,GAAG,SAAS,CAAC;IACvC,yDAAyD;IACzD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qEAAqE;IACrE,eAAe,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa;IACpE,4CAA4C;IAC5C,YAAY,EAAE,CAAC,CAAC;IAChB,uDAAuD;IACvD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC,CAa/F"}
1
+ {"version":3,"file":"summarizerNodeUtils.d.ts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAEpF,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjG,MAAM,WAAW,qBAAqB;IACrC,4DAA4D;IAC5D,gBAAgB,EAAE,OAAO,CAAC;IAC1B,sFAAsF;IACtF,cAAc,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IACnC,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,6HAA6H;IAC7H,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAC9B;IACA,OAAO,EAAE,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yright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISnapshotTree, SummaryObject } from \"@fluidframework/protocol-definitions\";\nimport { channelsTreeName } from \"@fluidframework/runtime-definitions/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { TelemetryDataTag } from \"@fluidframework/telemetry-utils/internal\";\n\nexport interface IRefreshSummaryResult {\n\t/** Tells whether this summary is tracked by this client. */\n\tisSummaryTracked: boolean;\n\t/** Tells whether this summary is newer than the latest one tracked by this client. */\n\tisSummaryNewer: boolean;\n}\n\nexport interface IStartSummaryResult {\n\t/** The number of summarizerNodes at the start of the summary. */\n\tnodes: number;\n\t/** The number of summarizerNodes in the wrong state. */\n\tinvalidNodes: number;\n\t/** The invalid sequence numbers and their values. It should be in the format of validateSequenceNumber-nodeSequenceNumber */\n\tmismatchNumbers: Set<string>;\n}\n\n/**\n * Return type of validateSummary function. In case of success, the object returned should have success: true.\n * In case of failure, the object returned should have success: false and additional properties to indicate what\n * the failure was, where it was, can it be retried, etc.\n */\nexport type ValidateSummaryResult =\n\t| {\n\t\t\tsuccess: true;\n\t }\n\t| {\n\t\t\tsuccess: false;\n\t\t\t/** The failure reason */\n\t\t\treason: string;\n\t\t\t/** id of the node that failed during validation */\n\t\t\tid: {\n\t\t\t\ttag: TelemetryDataTag.CodeArtifact;\n\t\t\t\tvalue: string | undefined;\n\t\t\t};\n\t\t\t/** If the error can be retried, time to wait before retrying */\n\t\t\tretryAfterSeconds?: number;\n\t };\n\nexport interface ISummarizerNodeRootContract {\n\tstartSummary(\n\t\treferenceSequenceNumber: number,\n\t\tsummaryLogger: ITelemetryLoggerExt,\n\t\tlatestSummaryRefSeqNum: number,\n\t): IStartSummaryResult;\n\tvalidateSummary(): ValidateSummaryResult;\n\tcompleteSummary(proposalHandle: string, validate: boolean): void;\n\tclearSummary(): void;\n\trefreshLatestSummary(\n\t\tproposalHandle: string,\n\t\tsummaryRefSeq: number,\n\t): Promise<IRefreshSummaryResult>;\n}\n\n/** Path for nodes in a tree with escaped special characters */\nexport class EscapedPath {\n\tprivate constructor(public readonly path: string) {}\n\tpublic static create(path: string): EscapedPath {\n\t\treturn new EscapedPath(encodeURIComponent(path));\n\t}\n\tpublic static createAndConcat(pathParts: string[]): EscapedPath {\n\t\tlet ret = EscapedPath.create(pathParts[0] ?? \"\");\n\t\tfor (let i = 1; i < pathParts.length; i++) {\n\t\t\tret = ret.concat(EscapedPath.create(pathParts[i]));\n\t\t}\n\t\treturn ret;\n\t}\n\tpublic toString(): string {\n\t\treturn this.path;\n\t}\n\tpublic concat(path: EscapedPath): EscapedPath {\n\t\treturn new EscapedPath(`${this.path}/${path.path}`);\n\t}\n}\n\n/** Information about a summary relevant to a specific node in the tree */\nexport class SummaryNode {\n\t/** Creates an instance that is valid for the root with specific basePath and localPath */\n\tpublic static createForRoot(referenceSequenceNumber: number): SummaryNode {\n\t\treturn new SummaryNode({\n\t\t\treferenceSequenceNumber,\n\t\t\tbasePath: undefined,\n\t\t\tlocalPath: EscapedPath.create(\"\"), // root hard-coded to \"\"\n\t\t});\n\t}\n\n\t/** Summary reference sequence number, i.e. last sequence number seen when it was created */\n\tpublic get referenceSequenceNumber(): number {\n\t\treturn this.summary.referenceSequenceNumber;\n\t}\n\t/** Full path to parent node, or undefined if this is the root */\n\tpublic get basePath(): EscapedPath | undefined {\n\t\treturn this.summary.basePath;\n\t}\n\t/** Relative path to this node from its parent node */\n\tpublic get localPath(): EscapedPath {\n\t\treturn this.summary.localPath;\n\t}\n\t/** Relative path from this node to its node innermost base summary */\n\tpublic get additionalPath(): EscapedPath | undefined {\n\t\treturn this.summary.additionalPath;\n\t}\n\tpublic set additionalPath(additionalPath: EscapedPath | undefined) {\n\t\tthis.summary.additionalPath = additionalPath;\n\t}\n\tconstructor(\n\t\tprivate readonly summary: {\n\t\t\treadonly referenceSequenceNumber: number;\n\t\t\treadonly basePath: EscapedPath | undefined;\n\t\t\treadonly localPath: EscapedPath;\n\t\t\tadditionalPath?: EscapedPath;\n\t\t},\n\t) {}\n\n\t/** Gets the full path to this node, to be used when sending a handle */\n\tpublic get fullPath(): EscapedPath {\n\t\treturn this.basePath?.concat(this.localPath) ?? this.localPath;\n\t}\n\n\t/**\n\t * Gets the full path to this node's innermost base summary.\n\t * The children nodes can use this as their basePath to determine their path.\n\t */\n\tpublic get fullPathForChildren(): EscapedPath {\n\t\treturn this.additionalPath !== undefined\n\t\t\t? this.fullPath.concat(this.additionalPath)\n\t\t\t: this.fullPath;\n\t}\n\n\t/**\n\t * Creates a new node within the same summary for a child of this node.\n\t * @param id - id of the child node\n\t */\n\tpublic createForChild(id: string): SummaryNode {\n\t\treturn new SummaryNode({\n\t\t\treferenceSequenceNumber: this.referenceSequenceNumber,\n\t\t\tbasePath: this.fullPathForChildren,\n\t\t\tlocalPath: EscapedPath.create(id),\n\t\t});\n\t}\n}\n\n/**\n * Represents the details needed to create a child summarizer node.\n */\nexport interface ICreateChildDetails {\n\t/** Latest summary from server node data */\n\tlatestSummary: SummaryNode | undefined;\n\t/** Sequence number of latest known change to the node */\n\tchangeSequenceNumber: number;\n\t/** A unique id of this child to be logged when sending telemetry. */\n\ttelemetryNodeId: string;\n}\n\nexport interface ISubtreeInfo<T extends ISnapshotTree | SummaryObject> {\n\t/** Tree to use to find children subtrees */\n\tchildrenTree: T;\n\t/** Additional path part where children are isolated */\n\tchildrenPathPart: string | undefined;\n}\n\n/**\n * Checks if the summary contains .channels subtree where the children subtrees\n * would be located if exists.\n * @param baseSummary - summary to check\n */\nexport function parseSummaryForSubtrees(baseSummary: ISnapshotTree): ISubtreeInfo<ISnapshotTree> {\n\t// New versions of snapshots have child nodes isolated in .channels subtree\n\tconst channelsSubtree = baseSummary.trees[channelsTreeName];\n\tif (channelsSubtree !== undefined) {\n\t\treturn {\n\t\t\tchildrenTree: channelsSubtree,\n\t\t\tchildrenPathPart: channelsTreeName,\n\t\t};\n\t}\n\treturn {\n\t\tchildrenTree: baseSummary,\n\t\tchildrenPathPart: undefined,\n\t};\n}\n"]}
1
+ {"version":3,"file":"summarizerNodeUtils.js","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAwDhF,+DAA+D;AAC/D,MAAM,OAAO,WAAW;IACvB,YAAoC,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;IAC7C,MAAM,CAAC,MAAM,CAAC,IAAY;QAChC,OAAO,IAAI,WAAW,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;IACM,MAAM,CAAC,eAAe,CAAC,SAAmB;QAChD,IAAI,GAAG,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC1C,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACnD;QACD,OAAO,GAAG,CAAC;IACZ,CAAC;IACM,QAAQ;QACd,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IACM,MAAM,CAAC,IAAiB;QAC9B,OAAO,IAAI,WAAW,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACrD,CAAC;CACD;AAED,0EAA0E;AAC1E,MAAM,OAAO,WAAW;IACvB,0FAA0F;IACnF,MAAM,CAAC,aAAa,CAAC,uBAA+B;QAC1D,OAAO,IAAI,WAAW,CAAC;YACtB,uBAAuB;YACvB,QAAQ,EAAE,SAAS;YACnB,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,wBAAw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AA2E;IAC3E,MAAM,eAAe,GAAG,WAAW,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC5D,IAAI,eAAe,KAAK,SAAS,EAAE;QAClC,OAAO;YACN,YAAY,EAAE,eAAe;YAC7B,gBAAgB,EAAE,gBAAgB;SAClC,CAAC;KACF;IACD,OAAO;QACN,YAAY,EAAE,WAAW;QACzB,gBAAgB,EAAE,SAAS;KAC3B,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISnapshotTree, SummaryObject } from \"@fluidframework/protocol-definitions\";\nimport { channelsTreeName } from \"@fluidframework/runtime-definitions/internal\";\nimport { ITelemetryLoggerExt, TelemetryDataTag } from \"@fluidframework/telemetry-utils/internal\";\n\nexport interface IRefreshSummaryResult {\n\t/** Tells whether this summary is tracked by this client. */\n\tisSummaryTracked: boolean;\n\t/** Tells whether this summary is newer than the latest one tracked by this client. */\n\tisSummaryNewer: boolean;\n}\n\nexport interface IStartSummaryResult {\n\t/** The number of summarizerNodes at the start of the summary. */\n\tnodes: number;\n\t/** The number of summarizerNodes in the wrong state. */\n\tinvalidNodes: number;\n\t/** The invalid sequence numbers and their values. It should be in the format of validateSequenceNumber-nodeSequenceNumber */\n\tmismatchNumbers: Set<string>;\n}\n\n/**\n * Return type of validateSummary function. In case of success, the object returned should have success: true.\n * In case of failure, the object returned should have success: false and additional properties to indicate what\n * the failure was, where it was, can it be retried, etc.\n */\nexport type ValidateSummaryResult =\n\t| {\n\t\t\tsuccess: true;\n\t }\n\t| {\n\t\t\tsuccess: false;\n\t\t\t/** The failure reason */\n\t\t\treason: string;\n\t\t\t/** id of the node that failed during validation */\n\t\t\tid: {\n\t\t\t\ttag: TelemetryDataTag.CodeArtifact;\n\t\t\t\tvalue: string | undefined;\n\t\t\t};\n\t\t\t/** If the error can be retried, time to wait before retrying */\n\t\t\tretryAfterSeconds?: number;\n\t };\n\nexport interface ISummarizerNodeRootContract {\n\tstartSummary(\n\t\treferenceSequenceNumber: number,\n\t\tsummaryLogger: ITelemetryLoggerExt,\n\t\tlatestSummaryRefSeqNum: number,\n\t): IStartSummaryResult;\n\tvalidateSummary(): ValidateSummaryResult;\n\tcompleteSummary(proposalHandle: string): void;\n\tclearSummary(): void;\n\trefreshLatestSummary(\n\t\tproposalHandle: string,\n\t\tsummaryRefSeq: number,\n\t): Promise<IRefreshSummaryResult>;\n}\n\n/** Path for nodes in a tree with escaped special characters */\nexport class EscapedPath {\n\tprivate constructor(public readonly path: string) {}\n\tpublic static create(path: string): EscapedPath {\n\t\treturn new EscapedPath(encodeURIComponent(path));\n\t}\n\tpublic static createAndConcat(pathParts: string[]): EscapedPath {\n\t\tlet ret = EscapedPath.create(pathParts[0] ?? \"\");\n\t\tfor (let i = 1; i < pathParts.length; i++) {\n\t\t\tret = ret.concat(EscapedPath.create(pathParts[i]));\n\t\t}\n\t\treturn ret;\n\t}\n\tpublic toString(): string {\n\t\treturn this.path;\n\t}\n\tpublic concat(path: EscapedPath): EscapedPath {\n\t\treturn new EscapedPath(`${this.path}/${path.path}`);\n\t}\n}\n\n/** Information about a summary relevant to a specific node in the tree */\nexport class SummaryNode {\n\t/** Creates an instance that is valid for the root with specific basePath and localPath */\n\tpublic static createForRoot(referenceSequenceNumber: number): SummaryNode {\n\t\treturn new SummaryNode({\n\t\t\treferenceSequenceNumber,\n\t\t\tbasePath: undefined,\n\t\t\tlocalPath: EscapedPath.create(\"\"), // root hard-coded to \"\"\n\t\t});\n\t}\n\n\t/** Summary reference sequence number, i.e. last sequence number seen when it was created */\n\tpublic get referenceSequenceNumber(): number {\n\t\treturn this.summary.referenceSequenceNumber;\n\t}\n\t/** Full path to parent node, or undefined if this is the root */\n\tpublic get basePath(): EscapedPath | undefined {\n\t\treturn this.summary.basePath;\n\t}\n\t/** Relative path to this node from its parent node */\n\tpublic get localPath(): EscapedPath {\n\t\treturn this.summary.localPath;\n\t}\n\t/** Relative path from this node to its node innermost base summary */\n\tpublic get additionalPath(): EscapedPath | undefined {\n\t\treturn this.summary.additionalPath;\n\t}\n\tpublic set additionalPath(additionalPath: EscapedPath | undefined) {\n\t\tthis.summary.additionalPath = additionalPath;\n\t}\n\tconstructor(\n\t\tprivate readonly summary: {\n\t\t\treadonly referenceSequenceNumber: number;\n\t\t\treadonly basePath: EscapedPath | undefined;\n\t\t\treadonly localPath: EscapedPath;\n\t\t\tadditionalPath?: EscapedPath;\n\t\t},\n\t) {}\n\n\t/** Gets the full path to this node, to be used when sending a handle */\n\tpublic get fullPath(): EscapedPath {\n\t\treturn this.basePath?.concat(this.localPath) ?? this.localPath;\n\t}\n\n\t/**\n\t * Gets the full path to this node's innermost base summary.\n\t * The children nodes can use this as their basePath to determine their path.\n\t */\n\tpublic get fullPathForChildren(): EscapedPath {\n\t\treturn this.additionalPath !== undefined\n\t\t\t? this.fullPath.concat(this.additionalPath)\n\t\t\t: this.fullPath;\n\t}\n\n\t/**\n\t * Creates a new node within the same summary for a child of this node.\n\t * @param id - id of the child node\n\t */\n\tpublic createForChild(id: string): SummaryNode {\n\t\treturn new SummaryNode({\n\t\t\treferenceSequenceNumber: this.referenceSequenceNumber,\n\t\t\tbasePath: this.fullPathForChildren,\n\t\t\tlocalPath: EscapedPath.create(id),\n\t\t});\n\t}\n}\n\n/**\n * Represents the details needed to create a child summarizer node.\n */\nexport interface ICreateChildDetails {\n\t/** Latest summary from server node data */\n\tlatestSummary: SummaryNode | undefined;\n\t/** Sequence number of latest known change to the node */\n\tchangeSequenceNumber: number;\n\t/** A unique id of this child to be logged when sending telemetry. */\n\ttelemetryNodeId: string;\n}\n\nexport interface ISubtreeInfo<T extends ISnapshotTree | SummaryObject> {\n\t/** Tree to use to find children subtrees */\n\tchildrenTree: T;\n\t/** Additional path part where children are isolated */\n\tchildrenPathPart: string | undefined;\n}\n\n/**\n * Checks if the summary contains .channels subtree where the children subtrees\n * would be located if exists.\n * @param baseSummary - summary to check\n */\nexport function parseSummaryForSubtrees(baseSummary: ISnapshotTree): ISubtreeInfo<ISnapshotTree> {\n\t// New versions of snapshots have child nodes isolated in .channels subtree\n\tconst channelsSubtree = baseSummary.trees[channelsTreeName];\n\tif (channelsSubtree !== undefined) {\n\t\treturn {\n\t\t\tchildrenTree: channelsSubtree,\n\t\t\tchildrenPathPart: channelsTreeName,\n\t\t};\n\t}\n\treturn {\n\t\tchildrenTree: baseSummary,\n\t\tchildrenPathPart: undefined,\n\t};\n}\n"]}
@@ -77,9 +77,8 @@ export declare class SummarizerNodeWithGC extends SummarizerNode implements IRoo
77
77
  * @param parentPath - The path of the parent node which is used to build the path of this node.
78
78
  * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.
79
79
  * In that case, the children will not have work-in-progress state.
80
- * @param validate - true to validate that the in-progress summary is correct for all nodes.
81
80
  */
82
- protected completeSummaryCore(proposalHandle: string, parentPath: EscapedPath | undefined, parentSkipRecursion: boolean, validate: boolean): void;
81
+ protected completeSummaryCore(proposalHandle: string, parentPath: EscapedPath | undefined, parentSkipRecursion: boolean): void;
83
82
  /**
84
83
  * Clears the work-in-progress state.
85
84
  */
@@ -1 +1 @@
1
- {"version":3,"file":"summarizerNodeWithGc.d.ts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeWithGc.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EACN,sCAAsC,EACtC,sBAAsB,EACtB,iBAAiB,EACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACN,8BAA8B,EAC9B,6BAA6B,EAC7B,wBAAwB,EACxB,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,mBAAmB,EACnB,MAAM,8CAA8C,CAAC;AAUtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACN,WAAW,EAEX,mBAAmB,EACnB,2BAA2B,EAC3B,WAAW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
177
177
  * @param parentPath - The path of the parent node which is used to build the path of this node.
178
178
  * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.
179
179
  * In that case, the children will not have work-in-progress state.
180
- * @param validate - true to validate that the in-progress summary is correct for all nodes.
181
180
  */
182
- completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion, validate) {
183
- if (validate && this.wasGCMissed()) {
184
- this.throwUnexpectedError({
185
- eventName: "NodeDidNotRunGC",
186
- proposalHandle,
187
- });
188
- }
181
+ completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion) {
189
182
  let wipSerializedUsedRoutes;
190
183
  // If GC is disabled, don't set wip used routes.
191
184
  if (!this.gcDisabled) {
192
185
  wipSerializedUsedRoutes = this.wipSerializedUsedRoutes;
193
186
  }
194
- super.completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion, validate);
187
+ super.completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion);
195
188
  // If GC is disabled, skip setting pending summary with GC state.
196
189
  if (!this.gcDisabled) {
197
190
  const summaryNode = this.pendingSummaries.get(proposalHandle);
@@ -1 +1 @@
1
- {"version":3,"file":"summarizerNodeWithGc.js","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeWithGc.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAe1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EACN,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAKN,WAAW,GAEX,MAAM,0BAA0B,CAAC;AAMlC,wDAAwD;AACxD,MAAM,iBAAkB,SAAQ,WAAW;IAC1C,YACiB,oBAAwC,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UAAU,CAAC,CAAC;SAC/D;IACF,CAAC;IAED;;OAEG;IACO,UAAU;QACnB,OAAO,IAAI,CAAC,cAAc,EAAE,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC5D,CAAC;IAED;;OAEG;IACK,cAAc;QACrB,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACK,mBAAmB;QAC1B,mEAAmE;QACnE,IAAI,IAAI,CAAC,UAAU,EAAE;YACpB,OAAO,KAAK,CAAC;SACb;QAED,OAAO,CACN,IAAI,CAAC,mBAAmB,KAAK,SAAS;YACtC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAC5E,CAAC;IACH,CAAC;CACD;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC7C,MAA4B,EAC5B,mBAAwC,EACxC,oBAA4B,EAC5B,uBAA2C,EAC3C,SAAsC,EAAE,EACxC,WAAmE,EACnE,kBAAiE,EACrC,EAAE,CAC9B,IAAI,oBAAoB,CACvB,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,oBAAoB,EACpB,uBAAuB,KAAK,SAAS;IACpC,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,uBAAuB,CAAC,EACrD,SAAS,CAAC,sBAAsB,EAChC,WAAW,EACX,kBAAkB,EAClB,EAAE,CAAC,iBAAiB,CACpB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { assert, LazyPromise } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIExperimentalIncrementalSummaryContext,\n\tIGarbageCollectionData,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tCreateChildSummarizerNodeParam,\n\tIGarbageCollectionDetailsBase,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNodeConfigWithGC,\n\tISummarizerNodeWithGC,\n\tSummarizeInternalFn,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { unpackChildNodesUsedRoutes } from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tLoggingError,\n\tTelemetryDataTag,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { cloneGCData, unpackChildNodesGCDetails } from \"../../gc/index.js\";\n\nimport { SummarizerNode } from \"./summarizerNode.js\";\nimport {\n\tEscapedPath,\n\tICreateChildDetails,\n\tIStartSummaryResult,\n\tISummarizerNodeRootContract,\n\tSummaryNode,\n\tValidateSummaryResult,\n} from \"./summarizerNodeUtils.js\";\n\nexport interface IRootSummarizerNodeWithGC\n\textends ISummarizerNodeWithGC,\n\t\tISummarizerNodeRootContract {}\n\n// Extend SummaryNode to add used routes tracking to it.\nclass SummaryNodeWithGC extends SummaryNode {\n\tconstructor(\n\t\tpublic readonly serializedUsedRoutes: string | undefined,\n\t\tsummary: {\n\t\t\treadonly referenceSequenceNumber: number;\n\t\t\treadonly basePath: EscapedPath | undefined;\n\t\t\treadonly localPath: EscapedPath;\n\t\t\tadditionalPath?: EscapedPath;\n\t\t},\n\t) {\n\t\tsuper(summary);\n\t}\n}\n\n/**\n * Extends the functionality of SummarizerNode to manage this node's garbage collection data:\n *\n * - Adds a new API `getGCData` to return GC data of this node.\n *\n * - Caches the result of `getGCData` to be used if nothing changes between summaries.\n *\n * - Manages the used routes of this node. These are used to identify if this node is referenced in the document\n * and to determine if the node's used state changed since last summary.\n *\n * - Adds trackState param to summarize. If trackState is false, it bypasses the SummarizerNode and calls\n * directly into summarizeInternal method.\n */\nexport class SummarizerNodeWithGC extends SummarizerNode implements IRootSummarizerNodeWithGC {\n\t// Tracks the work-in-progress used routes during summary.\n\tprivate wipSerializedUsedRoutes: string | undefined;\n\n\t// This is the last known used routes of this node as seen by the server as part of a summary.\n\tprivate referenceUsedRoutes: string[] | undefined;\n\n\t// The base GC details of this node used to initialize the GC state.\n\tprivate readonly baseGCDetailsP: LazyPromise<IGarbageCollectionDetailsBase>;\n\n\t// Keeps track of whether we have loaded the base details to ensure that we only do it once.\n\tprivate baseGCDetailsLoaded: boolean = false;\n\n\t// The base GC details for the child nodes. This is passed to child nodes when creating them.\n\tprivate readonly childNodesBaseGCDetailsP: LazyPromise<\n\t\tMap<string, IGarbageCollectionDetailsBase>\n\t>;\n\n\tprivate gcData: IGarbageCollectionData | undefined;\n\n\t// Set used routes to have self route by default. This makes the node referenced by default. This is done to ensure\n\t// that this node is not marked as collected when running GC has been disabled. Once, the option to disable GC is\n\t// removed (from runGC flag in IContainerRuntimeOptions), this should be changed to be have no routes by default.\n\tprivate usedRoutes: string[] = [\"\"];\n\n\t// True if GC is disabled for this node. If so, do not track GC specific state for a summary.\n\tprivate readonly gcDisabled: boolean;\n\n\t/**\n\t * Do not call constructor directly.\n\t * Use createRootSummarizerNodeWithGC to create root node, or createChild to create child nodes.\n\t */\n\tpublic constructor(\n\t\tlogger: ITelemetryBaseLogger,\n\t\tprivate readonly summarizeFn: (\n\t\t\tfullTree: boolean,\n\t\t\ttrackState: boolean,\n\t\t\ttelemetryContext?: ITelemetryContext,\n\t\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t\t) => Promise<ISummarizeInternalResult>,\n\t\tconfig: ISummarizerNodeConfigWithGC,\n\t\tchangeSequenceNumber: number,\n\t\t/** Undefined means created without summary */\n\t\tlatestSummary?: SummaryNode,\n\t\twipSummaryLogger?: ITelemetryBaseLogger,\n\t\tprivate readonly getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n\t\t/** A unique id of this node to be logged when sending telemetry. */\n\t\ttelemetryId?: string,\n\t) {\n\t\tsuper(\n\t\t\tlogger,\n\t\t\tasync (\n\t\t\t\tfullTree: boolean,\n\t\t\t\t_trackState: boolean,\n\t\t\t\ttelemetryContext?: ITelemetryContext,\n\t\t\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t\t\t) =>\n\t\t\t\tsummarizeFn(\n\t\t\t\t\tfullTree,\n\t\t\t\t\ttrue /* trackState */,\n\t\t\t\t\ttelemetryContext,\n\t\t\t\t\tincrementalSummaryContext,\n\t\t\t\t),\n\t\t\tconfig,\n\t\t\tchangeSequenceNumber,\n\t\t\tlatestSummary,\n\t\t\twipSummaryLogger,\n\t\t\ttelemetryId,\n\t\t);\n\n\t\tthis.gcDisabled = config.gcDisabled === true;\n\n\t\tthis.baseGCDetailsP = new LazyPromise(async () => {\n\t\t\treturn (await getBaseGCDetailsFn?.()) ?? { usedRoutes: [] };\n\t\t});\n\n\t\tthis.childNodesBaseGCDetailsP = new LazyPromise(async () => {\n\t\t\tawait this.loadBaseGCDetails();\n\t\t\treturn unpackChildNodesGCDetails({ gcData: this.gcData, usedRoutes: this.usedRoutes });\n\t\t});\n\t}\n\n\t/**\n\t * Loads state from this node's initial GC summary details. This contains the following data from the last summary\n\t * seen by the server for this client:\n\t * - usedRoutes: This is used to figure out if the used state of this node changed since last summary.\n\t * - gcData: The garbage collection data of this node that is required for running GC.\n\t */\n\tprivate async loadBaseGCDetails() {\n\t\tif (this.baseGCDetailsLoaded) {\n\t\t\treturn;\n\t\t}\n\t\tconst baseGCDetails = await this.baseGCDetailsP;\n\n\t\t// Possible race - If there were parallel calls to loadBaseGCDetails, we want to make sure that we update\n\t\t// the state from the base details only once.\n\t\tif (this.baseGCDetailsLoaded) {\n\t\t\treturn;\n\t\t}\n\t\tthis.baseGCDetailsLoaded = true;\n\n\t\t// Update GC data, used routes and reference used routes. The used routes are sorted because they are compared\n\t\t// across GC runs to check if they changed. Sorting ensures that the elements are in the same order.\n\t\t// If the GC details has GC data, initialize our GC data from it.\n\t\tif (baseGCDetails.gcData !== undefined) {\n\t\t\tthis.gcData = cloneGCData(baseGCDetails.gcData);\n\t\t}\n\t\tif (baseGCDetails.usedRoutes !== undefined) {\n\t\t\tthis.usedRoutes = Array.from(baseGCDetails.usedRoutes).sort();\n\t\t\tthis.referenceUsedRoutes = Array.from(baseGCDetails.usedRoutes).sort();\n\t\t}\n\t}\n\n\tpublic async summarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult> {\n\t\t// If GC is not disabled and a summary is in progress, GC should have run and updated the used routes for this\n\t\t// summary by calling updateUsedRoutes which sets wipSerializedUsedRoutes.\n\t\tif (!this.gcDisabled && this.isSummaryInProgress()) {\n\t\t\tassert(\n\t\t\t\tthis.wipSerializedUsedRoutes !== undefined,\n\t\t\t\t0x1b1 /* \"wip used routes should be set if tracking a summary\" */,\n\t\t\t);\n\t\t}\n\n\t\t// If trackState is true, get summary from base summarizer node which tracks summary state.\n\t\t// If trackState is false, get summary from summarizeInternal.\n\t\treturn trackState\n\t\t\t? super.summarize(fullTree, true /* trackState */, telemetryContext)\n\t\t\t: this.summarizeFn(fullTree, trackState, telemetryContext);\n\t}\n\n\t/**\n\t * Returns the GC data of this node. If nothing has changed since last summary, it tries to reuse the data from\n\t * the previous summary. Else, it gets new GC data from the underlying Fluid object.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tassert(\n\t\t\t!this.gcDisabled,\n\t\t\t0x1b2 /* \"Getting GC data should not be called when GC is disabled!\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.getGCDataFn !== undefined,\n\t\t\t0x1b3 /* \"GC data cannot be retrieved without getGCDataFn\" */,\n\t\t);\n\n\t\t// Load GC details from the initial summary, if not already loaded. If this is the first time this function is\n\t\t// called and the node's data has not changed since last summary, the GC data in initial details is returned.\n\t\tawait this.loadBaseGCDetails();\n\n\t\t// If there is no new data since last summary and we have GC data from the previous run, return it. The previous\n\t\t// GC data may not be available if loaded from a snapshot with either GC disabled or before GC was added.\n\t\t// Note - canReuseHandle is checked to be consistent with summarize - generate GC data for nodes for which\n\t\t// summary must be generated.\n\t\tif (this.canReuseHandle && !fullGC && !this.hasDataChanged() && this.gcData !== undefined) {\n\t\t\treturn cloneGCData(this.gcData);\n\t\t}\n\n\t\tconst gcData = await this.getGCDataFn(fullGC);\n\t\tthis.gcData = cloneGCData(gcData);\n\t\treturn gcData;\n\t}\n\n\t/**\n\t * Called during the start of a summary. Updates the work-in-progress used routes.\n\t */\n\tpublic startSummary(\n\t\treferenceSequenceNumber: number,\n\t\tsummaryLogger: ITelemetryBaseLogger,\n\t\tlatestSummaryRefSeqNum: number,\n\t): IStartSummaryResult {\n\t\t// If GC is disabled, skip setting wip used routes since we should not track GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tassert(\n\t\t\t\tthis.wipSerializedUsedRoutes === undefined,\n\t\t\t\t0x1b4 /* \"We should not already be tracking used routes when to track a new summary\" */,\n\t\t\t);\n\t\t}\n\t\treturn super.startSummary(referenceSequenceNumber, summaryLogger, latestSummaryRefSeqNum);\n\t}\n\n\t/**\n\t * Validates that the in-progress summary is correct for all nodes, i.e., GC should have run for non-skipped nodes.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when running GC.\n\t * In that case, the children will not have work-in-progress state.\n\t *\n\t * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.\n\t * In case of failure, additional information is returned indicating type of failure and where it was.\n\t */\n\tprotected validateSummaryCore(parentSkipRecursion: boolean): ValidateSummaryResult {\n\t\tif (this.wasGCMissed()) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\treason: \"NodeDidNotRunGC\",\n\t\t\t\tid: {\n\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\tvalue: this.telemetryNodeId,\n\t\t\t\t},\n\t\t\t\t// These errors are usually transient and should go away when summarize / GC is retried.\n\t\t\t\tretryAfterSeconds: 1,\n\t\t\t};\n\t\t}\n\t\treturn super.validateSummaryCore(parentSkipRecursion);\n\t}\n\n\tprivate wasGCMissed(): boolean {\n\t\t// If GC is disabled, it should not have run so it was not missed.\n\t\t// Otherwise, GC should have been called on this node and wipSerializedUsedRoutes must be set.\n\t\tif (this.gcDisabled || this.wipSerializedUsedRoutes !== undefined) {\n\t\t\treturn false;\n\t\t}\n\t\t/**\n\t\t * The absence of wip used routes indicates that GC was not run on this node. This can happen if:\n\t\t * 1. A child node was created after GC was already run on the parent. For example, a data store\n\t\t * is realized (loaded) after GC was run on it creating summarizer nodes for its DDSes. In this\n\t\t * case, the parent will pass on used routes to the child nodes and it will have wip used routes.\n\t\t * 2. A new node was created but GC was never run on it. This can mean that the GC data generated\n\t\t * during summarize is incomplete.\n\t\t *\n\t\t * This happens due to scenarios such as data store created during summarize. Such errors should go away when\n\t\t * summarize is attempted again.\n\t\t */\n\t\treturn true;\n\t}\n\n\t/**\n\t * Called after summary has been uploaded to the server. Add the work-in-progress state to the pending\n\t * summary queue. We track this until we get an ack from the server for this summary.\n\t * @param proposalHandle - The handle of the summary that was uploaded to the server.\n\t * @param parentPath - The path of the parent node which is used to build the path of this node.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.\n\t * In that case, the children will not have work-in-progress state.\n\t * @param validate - true to validate that the in-progress summary is correct for all nodes.\n\t */\n\tprotected completeSummaryCore(\n\t\tproposalHandle: string,\n\t\tparentPath: EscapedPath | undefined,\n\t\tparentSkipRecursion: boolean,\n\t\tvalidate: boolean,\n\t) {\n\t\tif (validate && this.wasGCMissed()) {\n\t\t\tthis.throwUnexpectedError({\n\t\t\t\teventName: \"NodeDidNotRunGC\",\n\t\t\t\tproposalHandle,\n\t\t\t});\n\t\t}\n\n\t\tlet wipSerializedUsedRoutes: string | undefined;\n\t\t// If GC is disabled, don't set wip used routes.\n\t\tif (!this.gcDisabled) {\n\t\t\twipSerializedUsedRoutes = this.wipSerializedUsedRoutes;\n\t\t}\n\n\t\tsuper.completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion, validate);\n\n\t\t// If GC is disabled, skip setting pending summary with GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tconst summaryNode = this.pendingSummaries.get(proposalHandle);\n\t\t\tif (summaryNode !== undefined) {\n\t\t\t\tconst summaryNodeWithGC = new SummaryNodeWithGC(\n\t\t\t\t\twipSerializedUsedRoutes,\n\t\t\t\t\tsummaryNode,\n\t\t\t\t);\n\t\t\t\tthis.pendingSummaries.set(proposalHandle, summaryNodeWithGC);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Clears the work-in-progress state.\n\t */\n\tpublic clearSummary() {\n\t\tthis.wipSerializedUsedRoutes = undefined;\n\t\tsuper.clearSummary();\n\t}\n\n\t/**\n\t * Called when we get an ack from the server for a summary we sent. Update the reference state of this node\n\t * from the state in the pending summary queue.\n\t */\n\tprotected refreshLatestSummaryFromPending(\n\t\tproposalHandle: string,\n\t\treferenceSequenceNumber: number,\n\t): void {\n\t\t// If GC is disabled, skip setting referenced used routes since we are not tracking GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tconst summaryNode = this.pendingSummaries.get(proposalHandle);\n\t\t\tif (summaryNode !== undefined) {\n\t\t\t\t// If a pending summary exists, it must have used routes since GC is enabled.\n\t\t\t\tconst summaryNodeWithGC = summaryNode as SummaryNodeWithGC;\n\t\t\t\tif (summaryNodeWithGC.serializedUsedRoutes === undefined) {\n\t\t\t\t\tconst error = new LoggingError(\"MissingGCStateInPendingSummary\", {\n\t\t\t\t\t\tproposalHandle,\n\t\t\t\t\t\treferenceSequenceNumber,\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tid: this.telemetryNodeId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t});\n\t\t\t\t\tthis.logger.sendErrorEvent(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\teventName: error.message,\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror,\n\t\t\t\t\t);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tthis.referenceUsedRoutes = JSON.parse(summaryNodeWithGC.serializedUsedRoutes);\n\t\t\t}\n\t\t}\n\n\t\treturn super.refreshLatestSummaryFromPending(proposalHandle, referenceSequenceNumber);\n\t}\n\n\t/**\n\t * Override the createChild method to return an instance of SummarizerNodeWithGC.\n\t */\n\tpublic createChild(\n\t\t/** Summarize function */\n\t\tsummarizeInternalFn: SummarizeInternalFn,\n\t\t/** Initial id or path part of this node */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t\tconfig: ISummarizerNodeConfigWithGC = {},\n\t\tgetGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t): ISummarizerNodeWithGC {\n\t\tassert(!this.children.has(id), 0x1b6 /* \"Create SummarizerNode child already exists\" */);\n\t\t/**\n\t\t * Update the child node's base GC details from this node's current GC details instead of updating from the base\n\t\t * GC details of this node. This will handle scenarios where the GC details was updated during refresh from\n\t\t * snapshot and the child node wasn't created then. If a child is created after that, its GC details should be\n\t\t * the one from the downloaded snapshot and not the base GC details.\n\t\t */\n\t\tconst getChildBaseGCDetailsFn = async () => {\n\t\t\tconst childNodesBaseGCDetails = await this.childNodesBaseGCDetailsP;\n\t\t\treturn childNodesBaseGCDetails.get(id) ?? {};\n\t\t};\n\n\t\tconst createDetails: ICreateChildDetails = this.getCreateDetailsForChild(id, createParam);\n\t\tconst child = new SummarizerNodeWithGC(\n\t\t\tthis.logger,\n\t\t\tsummarizeInternalFn,\n\t\t\t{\n\t\t\t\t...config,\n\t\t\t\t// Propagate our gcDisabled state to the child if its not explicity specified in child's config.\n\t\t\t\tgcDisabled: config.gcDisabled ?? this.gcDisabled,\n\t\t\t},\n\t\t\tcreateDetails.changeSequenceNumber,\n\t\t\tcreateDetails.latestSummary,\n\t\t\tthis.wipSummaryLogger,\n\t\t\tgetGCDataFn,\n\t\t\tgetChildBaseGCDetailsFn,\n\t\t\tcreateDetails.telemetryNodeId,\n\t\t);\n\n\t\t// There may be additional state that has to be updated in this child. For example, if a summary is being\n\t\t// tracked, the child's summary tracking state needs to be updated too.\n\t\tthis.maybeUpdateChildState(child, id);\n\n\t\tthis.children.set(id, child);\n\t\treturn child;\n\t}\n\n\t/**\n\t * Updates the state of the child if required. For example, if a summary is currently being tracked, the child's\n\t * summary tracking state needs to be updated too.\n\t * Also, in case a child node gets realized in between Summary Op and Summary Ack, let's initialize the child's\n\t * pending summary as well. Finally, if the pendingSummaries entries have serializedRoutes, replicate them to the\n\t * pendingSummaries from the child nodes.\n\t * @param child - The child node whose state is to be updated.\n\t * @param id - Initial id or path part of this node\n\t */\n\tprotected maybeUpdateChildState(child: SummarizerNodeWithGC, id: string) {\n\t\tsuper.maybeUpdateChildState(child, id);\n\n\t\t// In case we have pending summaries on the parent, let's initialize it on the child.\n\t\tif (child.latestSummary !== undefined) {\n\t\t\tfor (const [key, value] of this.pendingSummaries.entries()) {\n\t\t\t\tconst summaryNodeWithGC = value as SummaryNodeWithGC;\n\t\t\t\tif (summaryNodeWithGC.serializedUsedRoutes !== undefined) {\n\t\t\t\t\tconst childNodeUsedRoutes = unpackChildNodesUsedRoutes(\n\t\t\t\t\t\tJSON.parse(summaryNodeWithGC.serializedUsedRoutes),\n\t\t\t\t\t);\n\t\t\t\t\tconst newSerializedRoutes = childNodeUsedRoutes.get(id) ?? [\"\"];\n\t\t\t\t\tconst newLatestSummaryNode = new SummaryNodeWithGC(\n\t\t\t\t\t\tJSON.stringify(newSerializedRoutes),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treferenceSequenceNumber: value.referenceSequenceNumber,\n\t\t\t\t\t\t\tbasePath: child.latestSummary.basePath,\n\t\t\t\t\t\t\tlocalPath: child.latestSummary.localPath,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t\tchild.addPendingSummary(key, newLatestSummaryNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Deletes the child node with the given id.\n\t */\n\tpublic deleteChild(id: string): void {\n\t\tthis.children.delete(id);\n\t}\n\n\t/**\n\t * Override the getChild method to return an instance of SummarizerNodeWithGC.\n\t */\n\tpublic getChild(id: string): ISummarizerNodeWithGC | undefined {\n\t\treturn this.children.get(id) as SummarizerNodeWithGC;\n\t}\n\n\tpublic isReferenced(): boolean {\n\t\treturn this.usedRoutes.includes(\"\") || this.usedRoutes.includes(\"/\");\n\t}\n\n\tpublic updateUsedRoutes(usedRoutes: string[]) {\n\t\t// Sort the given routes before updating. This will ensure that the routes compared in hasUsedStateChanged()\n\t\t// are in the same order.\n\t\tthis.usedRoutes = usedRoutes.sort();\n\n\t\t// If GC is not disabled and a summary is in progress, update the work-in-progress used routes so that it can\n\t\t// be tracked for this summary.\n\t\tif (!this.gcDisabled && this.isSummaryInProgress()) {\n\t\t\tthis.wipSerializedUsedRoutes = JSON.stringify(this.usedRoutes);\n\t\t}\n\t}\n\n\t/**\n\t * Override the hasChanged method. If this node data or its used state changed, the node is considered changed.\n\t */\n\tprotected hasChanged(): boolean {\n\t\treturn this.hasDataChanged() || this.hasUsedStateChanged();\n\t}\n\n\t/**\n\t * This tells whether the data in this node has changed or not.\n\t */\n\tprivate hasDataChanged(): boolean {\n\t\treturn super.hasChanged();\n\t}\n\n\t/**\n\t * This tells whether the used state of this node has changed since last successful summary. If the used routes\n\t * of this node changed, its used state is considered changed. Basically, if this node or any of its child nodes\n\t * was previously used and became unused (or vice versa), its used state has changed.\n\t */\n\tprivate hasUsedStateChanged(): boolean {\n\t\t// If GC is disabled, we are not tracking used state, return false.\n\t\tif (this.gcDisabled) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tthis.referenceUsedRoutes === undefined ||\n\t\t\tJSON.stringify(this.usedRoutes) !== JSON.stringify(this.referenceUsedRoutes)\n\t\t);\n\t}\n}\n\n/**\n * Creates a root summarizer node with GC functionality built-in.\n * @param logger - Logger to use within SummarizerNode\n * @param summarizeInternalFn - Function to generate summary\n * @param changeSequenceNumber - Sequence number of latest change to new node/subtree\n * @param referenceSequenceNumber - Reference sequence number of last acked summary,\n * or undefined if not loaded from summary\n * @param config - Configure behavior of summarizer node\n * @param getGCDataFn - Function to get the GC data of this node\n * @param baseGCDetailsP - Function to get the initial GC details of this node\n */\nexport const createRootSummarizerNodeWithGC = (\n\tlogger: ITelemetryBaseLogger,\n\tsummarizeInternalFn: SummarizeInternalFn,\n\tchangeSequenceNumber: number,\n\treferenceSequenceNumber: number | undefined,\n\tconfig: ISummarizerNodeConfigWithGC = {},\n\tgetGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n): IRootSummarizerNodeWithGC =>\n\tnew SummarizerNodeWithGC(\n\t\tlogger,\n\t\tsummarizeInternalFn,\n\t\tconfig,\n\t\tchangeSequenceNumber,\n\t\treferenceSequenceNumber === undefined\n\t\t\t? undefined\n\t\t\t: SummaryNode.createForRoot(referenceSequenceNumber),\n\t\tundefined /* wipSummaryLogger */,\n\t\tgetGCDataFn,\n\t\tgetBaseGCDetailsFn,\n\t\t\"\" /* telemetryId */,\n\t);\n"]}
1
+ {"version":3,"file":"summarizerNodeWithGc.js","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeWithGc.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAe1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EACN,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,yBAAyB,E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S,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SAC/D;IACF,CAAC;IAED;;OAEG;IACO,UAAU;QACnB,OAAO,IAAI,CAAC,cAAc,EAAE,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC5D,CAAC;IAED;;OAEG;IACK,cAAc;QACrB,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACK,mBAAmB;QAC1B,mEAAmE;QACnE,IAAI,IAAI,CAAC,UAAU,EAAE;YACpB,OAAO,KAAK,CAAC;SACb;QAED,OAAO,CACN,IAAI,CAAC,mBAAmB,KAAK,SAAS;YACtC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAC5E,CAAC;IACH,CAAC;CACD;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC7C,MAA4B,EAC5B,mBAAwC,EACxC,oBAA4B,EAC5B,uBAA2C,EAC3C,SAAsC,EAAE,EACxC,WAAmE,EACnE,kBAAiE,EACrC,EAAE,CAC9B,IAAI,oBAAoB,CACvB,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,oBAAoB,EACpB,uBAAuB,KAAK,SAAS;IACpC,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,uBAAuB,CAAC,EACrD,SAAS,CAAC,sBAAsB,EAChC,WAAW,EACX,kBAAkB,EAClB,EAAE,CAAC,iBAAiB,CACpB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { assert, LazyPromise } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIExperimentalIncrementalSummaryContext,\n\tIGarbageCollectionData,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tCreateChildSummarizerNodeParam,\n\tIGarbageCollectionDetailsBase,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNodeConfigWithGC,\n\tISummarizerNodeWithGC,\n\tSummarizeInternalFn,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { unpackChildNodesUsedRoutes } from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tLoggingError,\n\tTelemetryDataTag,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { cloneGCData, unpackChildNodesGCDetails } from \"../../gc/index.js\";\n\nimport { SummarizerNode } from \"./summarizerNode.js\";\nimport {\n\tEscapedPath,\n\tICreateChildDetails,\n\tIStartSummaryResult,\n\tISummarizerNodeRootContract,\n\tSummaryNode,\n\tValidateSummaryResult,\n} from \"./summarizerNodeUtils.js\";\n\nexport interface IRootSummarizerNodeWithGC\n\textends ISummarizerNodeWithGC,\n\t\tISummarizerNodeRootContract {}\n\n// Extend SummaryNode to add used routes tracking to it.\nclass SummaryNodeWithGC extends SummaryNode {\n\tconstructor(\n\t\tpublic readonly serializedUsedRoutes: string | undefined,\n\t\tsummary: {\n\t\t\treadonly referenceSequenceNumber: number;\n\t\t\treadonly basePath: EscapedPath | undefined;\n\t\t\treadonly localPath: EscapedPath;\n\t\t\tadditionalPath?: EscapedPath;\n\t\t},\n\t) {\n\t\tsuper(summary);\n\t}\n}\n\n/**\n * Extends the functionality of SummarizerNode to manage this node's garbage collection data:\n *\n * - Adds a new API `getGCData` to return GC data of this node.\n *\n * - Caches the result of `getGCData` to be used if nothing changes between summaries.\n *\n * - Manages the used routes of this node. These are used to identify if this node is referenced in the document\n * and to determine if the node's used state changed since last summary.\n *\n * - Adds trackState param to summarize. If trackState is false, it bypasses the SummarizerNode and calls\n * directly into summarizeInternal method.\n */\nexport class SummarizerNodeWithGC extends SummarizerNode implements IRootSummarizerNodeWithGC {\n\t// Tracks the work-in-progress used routes during summary.\n\tprivate wipSerializedUsedRoutes: string | undefined;\n\n\t// This is the last known used routes of this node as seen by the server as part of a summary.\n\tprivate referenceUsedRoutes: string[] | undefined;\n\n\t// The base GC details of this node used to initialize the GC state.\n\tprivate readonly baseGCDetailsP: LazyPromise<IGarbageCollectionDetailsBase>;\n\n\t// Keeps track of whether we have loaded the base details to ensure that we only do it once.\n\tprivate baseGCDetailsLoaded: boolean = false;\n\n\t// The base GC details for the child nodes. This is passed to child nodes when creating them.\n\tprivate readonly childNodesBaseGCDetailsP: LazyPromise<\n\t\tMap<string, IGarbageCollectionDetailsBase>\n\t>;\n\n\tprivate gcData: IGarbageCollectionData | undefined;\n\n\t// Set used routes to have self route by default. This makes the node referenced by default. This is done to ensure\n\t// that this node is not marked as collected when running GC has been disabled. Once, the option to disable GC is\n\t// removed (from runGC flag in IContainerRuntimeOptions), this should be changed to be have no routes by default.\n\tprivate usedRoutes: string[] = [\"\"];\n\n\t// True if GC is disabled for this node. If so, do not track GC specific state for a summary.\n\tprivate readonly gcDisabled: boolean;\n\n\t/**\n\t * Do not call constructor directly.\n\t * Use createRootSummarizerNodeWithGC to create root node, or createChild to create child nodes.\n\t */\n\tpublic constructor(\n\t\tlogger: ITelemetryBaseLogger,\n\t\tprivate readonly summarizeFn: (\n\t\t\tfullTree: boolean,\n\t\t\ttrackState: boolean,\n\t\t\ttelemetryContext?: ITelemetryContext,\n\t\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t\t) => Promise<ISummarizeInternalResult>,\n\t\tconfig: ISummarizerNodeConfigWithGC,\n\t\tchangeSequenceNumber: number,\n\t\t/** Undefined means created without summary */\n\t\tlatestSummary?: SummaryNode,\n\t\twipSummaryLogger?: ITelemetryBaseLogger,\n\t\tprivate readonly getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n\t\t/** A unique id of this node to be logged when sending telemetry. */\n\t\ttelemetryId?: string,\n\t) {\n\t\tsuper(\n\t\t\tlogger,\n\t\t\tasync (\n\t\t\t\tfullTree: boolean,\n\t\t\t\t_trackState: boolean,\n\t\t\t\ttelemetryContext?: ITelemetryContext,\n\t\t\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t\t\t) =>\n\t\t\t\tsummarizeFn(\n\t\t\t\t\tfullTree,\n\t\t\t\t\ttrue /* trackState */,\n\t\t\t\t\ttelemetryContext,\n\t\t\t\t\tincrementalSummaryContext,\n\t\t\t\t),\n\t\t\tconfig,\n\t\t\tchangeSequenceNumber,\n\t\t\tlatestSummary,\n\t\t\twipSummaryLogger,\n\t\t\ttelemetryId,\n\t\t);\n\n\t\tthis.gcDisabled = config.gcDisabled === true;\n\n\t\tthis.baseGCDetailsP = new LazyPromise(async () => {\n\t\t\treturn (await getBaseGCDetailsFn?.()) ?? { usedRoutes: [] };\n\t\t});\n\n\t\tthis.childNodesBaseGCDetailsP = new LazyPromise(async () => {\n\t\t\tawait this.loadBaseGCDetails();\n\t\t\treturn unpackChildNodesGCDetails({ gcData: this.gcData, usedRoutes: this.usedRoutes });\n\t\t});\n\t}\n\n\t/**\n\t * Loads state from this node's initial GC summary details. This contains the following data from the last summary\n\t * seen by the server for this client:\n\t * - usedRoutes: This is used to figure out if the used state of this node changed since last summary.\n\t * - gcData: The garbage collection data of this node that is required for running GC.\n\t */\n\tprivate async loadBaseGCDetails() {\n\t\tif (this.baseGCDetailsLoaded) {\n\t\t\treturn;\n\t\t}\n\t\tconst baseGCDetails = await this.baseGCDetailsP;\n\n\t\t// Possible race - If there were parallel calls to loadBaseGCDetails, we want to make sure that we update\n\t\t// the state from the base details only once.\n\t\tif (this.baseGCDetailsLoaded) {\n\t\t\treturn;\n\t\t}\n\t\tthis.baseGCDetailsLoaded = true;\n\n\t\t// Update GC data, used routes and reference used routes. The used routes are sorted because they are compared\n\t\t// across GC runs to check if they changed. Sorting ensures that the elements are in the same order.\n\t\t// If the GC details has GC data, initialize our GC data from it.\n\t\tif (baseGCDetails.gcData !== undefined) {\n\t\t\tthis.gcData = cloneGCData(baseGCDetails.gcData);\n\t\t}\n\t\tif (baseGCDetails.usedRoutes !== undefined) {\n\t\t\tthis.usedRoutes = Array.from(baseGCDetails.usedRoutes).sort();\n\t\t\tthis.referenceUsedRoutes = Array.from(baseGCDetails.usedRoutes).sort();\n\t\t}\n\t}\n\n\tpublic async summarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult> {\n\t\t// If GC is not disabled and a summary is in progress, GC should have run and updated the used routes for this\n\t\t// summary by calling updateUsedRoutes which sets wipSerializedUsedRoutes.\n\t\tif (!this.gcDisabled && this.isSummaryInProgress()) {\n\t\t\tassert(\n\t\t\t\tthis.wipSerializedUsedRoutes !== undefined,\n\t\t\t\t0x1b1 /* \"wip used routes should be set if tracking a summary\" */,\n\t\t\t);\n\t\t}\n\n\t\t// If trackState is true, get summary from base summarizer node which tracks summary state.\n\t\t// If trackState is false, get summary from summarizeInternal.\n\t\treturn trackState\n\t\t\t? super.summarize(fullTree, true /* trackState */, telemetryContext)\n\t\t\t: this.summarizeFn(fullTree, trackState, telemetryContext);\n\t}\n\n\t/**\n\t * Returns the GC data of this node. If nothing has changed since last summary, it tries to reuse the data from\n\t * the previous summary. Else, it gets new GC data from the underlying Fluid object.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tassert(\n\t\t\t!this.gcDisabled,\n\t\t\t0x1b2 /* \"Getting GC data should not be called when GC is disabled!\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.getGCDataFn !== undefined,\n\t\t\t0x1b3 /* \"GC data cannot be retrieved without getGCDataFn\" */,\n\t\t);\n\n\t\t// Load GC details from the initial summary, if not already loaded. If this is the first time this function is\n\t\t// called and the node's data has not changed since last summary, the GC data in initial details is returned.\n\t\tawait this.loadBaseGCDetails();\n\n\t\t// If there is no new data since last summary and we have GC data from the previous run, return it. The previous\n\t\t// GC data may not be available if loaded from a snapshot with either GC disabled or before GC was added.\n\t\t// Note - canReuseHandle is checked to be consistent with summarize - generate GC data for nodes for which\n\t\t// summary must be generated.\n\t\tif (this.canReuseHandle && !fullGC && !this.hasDataChanged() && this.gcData !== undefined) {\n\t\t\treturn cloneGCData(this.gcData);\n\t\t}\n\n\t\tconst gcData = await this.getGCDataFn(fullGC);\n\t\tthis.gcData = cloneGCData(gcData);\n\t\treturn gcData;\n\t}\n\n\t/**\n\t * Called during the start of a summary. Updates the work-in-progress used routes.\n\t */\n\tpublic startSummary(\n\t\treferenceSequenceNumber: number,\n\t\tsummaryLogger: ITelemetryBaseLogger,\n\t\tlatestSummaryRefSeqNum: number,\n\t): IStartSummaryResult {\n\t\t// If GC is disabled, skip setting wip used routes since we should not track GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tassert(\n\t\t\t\tthis.wipSerializedUsedRoutes === undefined,\n\t\t\t\t0x1b4 /* \"We should not already be tracking used routes when to track a new summary\" */,\n\t\t\t);\n\t\t}\n\t\treturn super.startSummary(referenceSequenceNumber, summaryLogger, latestSummaryRefSeqNum);\n\t}\n\n\t/**\n\t * Validates that the in-progress summary is correct for all nodes, i.e., GC should have run for non-skipped nodes.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when running GC.\n\t * In that case, the children will not have work-in-progress state.\n\t *\n\t * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.\n\t * In case of failure, additional information is returned indicating type of failure and where it was.\n\t */\n\tprotected validateSummaryCore(parentSkipRecursion: boolean): ValidateSummaryResult {\n\t\tif (this.wasGCMissed()) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\treason: \"NodeDidNotRunGC\",\n\t\t\t\tid: {\n\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\tvalue: this.telemetryNodeId,\n\t\t\t\t},\n\t\t\t\t// These errors are usually transient and should go away when summarize / GC is retried.\n\t\t\t\tretryAfterSeconds: 1,\n\t\t\t};\n\t\t}\n\t\treturn super.validateSummaryCore(parentSkipRecursion);\n\t}\n\n\tprivate wasGCMissed(): boolean {\n\t\t// If GC is disabled, it should not have run so it was not missed.\n\t\t// Otherwise, GC should have been called on this node and wipSerializedUsedRoutes must be set.\n\t\tif (this.gcDisabled || this.wipSerializedUsedRoutes !== undefined) {\n\t\t\treturn false;\n\t\t}\n\t\t/**\n\t\t * The absence of wip used routes indicates that GC was not run on this node. This can happen if:\n\t\t * 1. A child node was created after GC was already run on the parent. For example, a data store\n\t\t * is realized (loaded) after GC was run on it creating summarizer nodes for its DDSes. In this\n\t\t * case, the parent will pass on used routes to the child nodes and it will have wip used routes.\n\t\t * 2. A new node was created but GC was never run on it. This can mean that the GC data generated\n\t\t * during summarize is incomplete.\n\t\t *\n\t\t * This happens due to scenarios such as data store created during summarize. Such errors should go away when\n\t\t * summarize is attempted again.\n\t\t */\n\t\treturn true;\n\t}\n\n\t/**\n\t * Called after summary has been uploaded to the server. Add the work-in-progress state to the pending\n\t * summary queue. We track this until we get an ack from the server for this summary.\n\t * @param proposalHandle - The handle of the summary that was uploaded to the server.\n\t * @param parentPath - The path of the parent node which is used to build the path of this node.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.\n\t * In that case, the children will not have work-in-progress state.\n\t */\n\tprotected completeSummaryCore(\n\t\tproposalHandle: string,\n\t\tparentPath: EscapedPath | undefined,\n\t\tparentSkipRecursion: boolean,\n\t) {\n\t\tlet wipSerializedUsedRoutes: string | undefined;\n\t\t// If GC is disabled, don't set wip used routes.\n\t\tif (!this.gcDisabled) {\n\t\t\twipSerializedUsedRoutes = this.wipSerializedUsedRoutes;\n\t\t}\n\n\t\tsuper.completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion);\n\n\t\t// If GC is disabled, skip setting pending summary with GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tconst summaryNode = this.pendingSummaries.get(proposalHandle);\n\t\t\tif (summaryNode !== undefined) {\n\t\t\t\tconst summaryNodeWithGC = new SummaryNodeWithGC(\n\t\t\t\t\twipSerializedUsedRoutes,\n\t\t\t\t\tsummaryNode,\n\t\t\t\t);\n\t\t\t\tthis.pendingSummaries.set(proposalHandle, summaryNodeWithGC);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Clears the work-in-progress state.\n\t */\n\tpublic clearSummary() {\n\t\tthis.wipSerializedUsedRoutes = undefined;\n\t\tsuper.clearSummary();\n\t}\n\n\t/**\n\t * Called when we get an ack from the server for a summary we sent. Update the reference state of this node\n\t * from the state in the pending summary queue.\n\t */\n\tprotected refreshLatestSummaryFromPending(\n\t\tproposalHandle: string,\n\t\treferenceSequenceNumber: number,\n\t): void {\n\t\t// If GC is disabled, skip setting referenced used routes since we are not tracking GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tconst summaryNode = this.pendingSummaries.get(proposalHandle);\n\t\t\tif (summaryNode !== undefined) {\n\t\t\t\t// If a pending summary exists, it must have used routes since GC is enabled.\n\t\t\t\tconst summaryNodeWithGC = summaryNode as SummaryNodeWithGC;\n\t\t\t\tif (summaryNodeWithGC.serializedUsedRoutes === undefined) {\n\t\t\t\t\tconst error = new LoggingError(\"MissingGCStateInPendingSummary\", {\n\t\t\t\t\t\tproposalHandle,\n\t\t\t\t\t\treferenceSequenceNumber,\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tid: this.telemetryNodeId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t});\n\t\t\t\t\tthis.logger.sendErrorEvent(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\teventName: error.message,\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror,\n\t\t\t\t\t);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tthis.referenceUsedRoutes = JSON.parse(summaryNodeWithGC.serializedUsedRoutes);\n\t\t\t}\n\t\t}\n\n\t\treturn super.refreshLatestSummaryFromPending(proposalHandle, referenceSequenceNumber);\n\t}\n\n\t/**\n\t * Override the createChild method to return an instance of SummarizerNodeWithGC.\n\t */\n\tpublic createChild(\n\t\t/** Summarize function */\n\t\tsummarizeInternalFn: SummarizeInternalFn,\n\t\t/** Initial id or path part of this node */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t\tconfig: ISummarizerNodeConfigWithGC = {},\n\t\tgetGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t): ISummarizerNodeWithGC {\n\t\tassert(!this.children.has(id), 0x1b6 /* \"Create SummarizerNode child already exists\" */);\n\t\t/**\n\t\t * Update the child node's base GC details from this node's current GC details instead of updating from the base\n\t\t * GC details of this node. This will handle scenarios where the GC details was updated during refresh from\n\t\t * snapshot and the child node wasn't created then. If a child is created after that, its GC details should be\n\t\t * the one from the downloaded snapshot and not the base GC details.\n\t\t */\n\t\tconst getChildBaseGCDetailsFn = async () => {\n\t\t\tconst childNodesBaseGCDetails = await this.childNodesBaseGCDetailsP;\n\t\t\treturn childNodesBaseGCDetails.get(id) ?? {};\n\t\t};\n\n\t\tconst createDetails: ICreateChildDetails = this.getCreateDetailsForChild(id, createParam);\n\t\tconst child = new SummarizerNodeWithGC(\n\t\t\tthis.logger,\n\t\t\tsummarizeInternalFn,\n\t\t\t{\n\t\t\t\t...config,\n\t\t\t\t// Propagate our gcDisabled state to the child if its not explicity specified in child's config.\n\t\t\t\tgcDisabled: config.gcDisabled ?? this.gcDisabled,\n\t\t\t},\n\t\t\tcreateDetails.changeSequenceNumber,\n\t\t\tcreateDetails.latestSummary,\n\t\t\tthis.wipSummaryLogger,\n\t\t\tgetGCDataFn,\n\t\t\tgetChildBaseGCDetailsFn,\n\t\t\tcreateDetails.telemetryNodeId,\n\t\t);\n\n\t\t// There may be additional state that has to be updated in this child. For example, if a summary is being\n\t\t// tracked, the child's summary tracking state needs to be updated too.\n\t\tthis.maybeUpdateChildState(child, id);\n\n\t\tthis.children.set(id, child);\n\t\treturn child;\n\t}\n\n\t/**\n\t * Updates the state of the child if required. For example, if a summary is currently being tracked, the child's\n\t * summary tracking state needs to be updated too.\n\t * Also, in case a child node gets realized in between Summary Op and Summary Ack, let's initialize the child's\n\t * pending summary as well. Finally, if the pendingSummaries entries have serializedRoutes, replicate them to the\n\t * pendingSummaries from the child nodes.\n\t * @param child - The child node whose state is to be updated.\n\t * @param id - Initial id or path part of this node\n\t */\n\tprotected maybeUpdateChildState(child: SummarizerNodeWithGC, id: string) {\n\t\tsuper.maybeUpdateChildState(child, id);\n\n\t\t// In case we have pending summaries on the parent, let's initialize it on the child.\n\t\tif (child.latestSummary !== undefined) {\n\t\t\tfor (const [key, value] of this.pendingSummaries.entries()) {\n\t\t\t\tconst summaryNodeWithGC = value as SummaryNodeWithGC;\n\t\t\t\tif (summaryNodeWithGC.serializedUsedRoutes !== undefined) {\n\t\t\t\t\tconst childNodeUsedRoutes = unpackChildNodesUsedRoutes(\n\t\t\t\t\t\tJSON.parse(summaryNodeWithGC.serializedUsedRoutes),\n\t\t\t\t\t);\n\t\t\t\t\tconst newSerializedRoutes = childNodeUsedRoutes.get(id) ?? [\"\"];\n\t\t\t\t\tconst newLatestSummaryNode = new SummaryNodeWithGC(\n\t\t\t\t\t\tJSON.stringify(newSerializedRoutes),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treferenceSequenceNumber: value.referenceSequenceNumber,\n\t\t\t\t\t\t\tbasePath: child.latestSummary.basePath,\n\t\t\t\t\t\t\tlocalPath: child.latestSummary.localPath,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t\tchild.addPendingSummary(key, newLatestSummaryNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Deletes the child node with the given id.\n\t */\n\tpublic deleteChild(id: string): void {\n\t\tthis.children.delete(id);\n\t}\n\n\t/**\n\t * Override the getChild method to return an instance of SummarizerNodeWithGC.\n\t */\n\tpublic getChild(id: string): ISummarizerNodeWithGC | undefined {\n\t\treturn this.children.get(id) as SummarizerNodeWithGC;\n\t}\n\n\tpublic isReferenced(): boolean {\n\t\treturn this.usedRoutes.includes(\"\") || this.usedRoutes.includes(\"/\");\n\t}\n\n\tpublic updateUsedRoutes(usedRoutes: string[]) {\n\t\t// Sort the given routes before updating. This will ensure that the routes compared in hasUsedStateChanged()\n\t\t// are in the same order.\n\t\tthis.usedRoutes = usedRoutes.sort();\n\n\t\t// If GC is not disabled and a summary is in progress, update the work-in-progress used routes so that it can\n\t\t// be tracked for this summary.\n\t\tif (!this.gcDisabled && this.isSummaryInProgress()) {\n\t\t\tthis.wipSerializedUsedRoutes = JSON.stringify(this.usedRoutes);\n\t\t}\n\t}\n\n\t/**\n\t * Override the hasChanged method. If this node data or its used state changed, the node is considered changed.\n\t */\n\tprotected hasChanged(): boolean {\n\t\treturn this.hasDataChanged() || this.hasUsedStateChanged();\n\t}\n\n\t/**\n\t * This tells whether the data in this node has changed or not.\n\t */\n\tprivate hasDataChanged(): boolean {\n\t\treturn super.hasChanged();\n\t}\n\n\t/**\n\t * This tells whether the used state of this node has changed since last successful summary. If the used routes\n\t * of this node changed, its used state is considered changed. Basically, if this node or any of its child nodes\n\t * was previously used and became unused (or vice versa), its used state has changed.\n\t */\n\tprivate hasUsedStateChanged(): boolean {\n\t\t// If GC is disabled, we are not tracking used state, return false.\n\t\tif (this.gcDisabled) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tthis.referenceUsedRoutes === undefined ||\n\t\t\tJSON.stringify(this.usedRoutes) !== JSON.stringify(this.referenceUsedRoutes)\n\t\t);\n\t}\n}\n\n/**\n * Creates a root summarizer node with GC functionality built-in.\n * @param logger - Logger to use within SummarizerNode\n * @param summarizeInternalFn - Function to generate summary\n * @param changeSequenceNumber - Sequence number of latest change to new node/subtree\n * @param referenceSequenceNumber - Reference sequence number of last acked summary,\n * or undefined if not loaded from summary\n * @param config - Configure behavior of summarizer node\n * @param getGCDataFn - Function to get the GC data of this node\n * @param baseGCDetailsP - Function to get the initial GC details of this node\n */\nexport const createRootSummarizerNodeWithGC = (\n\tlogger: ITelemetryBaseLogger,\n\tsummarizeInternalFn: SummarizeInternalFn,\n\tchangeSequenceNumber: number,\n\treferenceSequenceNumber: number | undefined,\n\tconfig: ISummarizerNodeConfigWithGC = {},\n\tgetGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n): IRootSummarizerNodeWithGC =>\n\tnew SummarizerNodeWithGC(\n\t\tlogger,\n\t\tsummarizeInternalFn,\n\t\tconfig,\n\t\tchangeSequenceNumber,\n\t\treferenceSequenceNumber === undefined\n\t\t\t? undefined\n\t\t\t: SummaryNode.createForRoot(referenceSequenceNumber),\n\t\tundefined /* wipSummaryLogger */,\n\t\tgetGCDataFn,\n\t\tgetBaseGCDetailsFn,\n\t\t\"\" /* telemetryId */,\n\t);\n"]}
@@ -2,13 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IDeltaManager } from "@fluidframework/container-definitions";
6
- import { ContainerWarning } from "@fluidframework/container-definitions/internal";
5
+ import { IDeltaManager, ContainerWarning } from "@fluidframework/container-definitions/internal";
7
6
  import { IEvent, IEventProvider, ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
8
7
  import { IDocumentMessage, ISequencedDocumentMessage, ISummaryTree } from "@fluidframework/protocol-definitions";
9
8
  import { ISummaryStats } from "@fluidframework/runtime-definitions";
10
- import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
11
- import { ITelemetryLoggerPropertyBag } from "@fluidframework/telemetry-utils/internal";
9
+ import { ITelemetryLoggerExt, ITelemetryLoggerPropertyBag } from "@fluidframework/telemetry-utils/internal";
12
10
  import { ISummaryConfigurationHeuristics } from "../containerRuntime.js";
13
11
  import { ISummaryAckMessage, ISummaryNackMessage, ISummaryOpMessage } from "./summaryCollection.js";
14
12
  import { SummarizeReason } from "./summaryGenerator.js";
@@ -161,7 +159,7 @@ export interface IGeneratedSummaryStats extends ISummaryStats {
161
159
  export interface IBaseSummarizeResult {
162
160
  readonly stage: "base";
163
161
  /** Error object related to failed summarize attempt. */
164
- readonly error: any;
162
+ readonly error: Error | undefined;
165
163
  /** Reference sequence number as of the generate summary attempt. */
166
164
  readonly referenceSequenceNumber: number;
167
165
  readonly minimumSequenceNumber: number;