@fluidframework/container-runtime 2.0.0-dev.4.4.0.162574 → 2.0.0-dev.5.3.2.178189

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 (367) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/batchTracker.d.ts +4 -4
  3. package/dist/batchTracker.d.ts.map +1 -1
  4. package/dist/batchTracker.js +2 -2
  5. package/dist/batchTracker.js.map +1 -1
  6. package/dist/blobManager.d.ts +5 -2
  7. package/dist/blobManager.d.ts.map +1 -1
  8. package/dist/blobManager.js +53 -24
  9. package/dist/blobManager.js.map +1 -1
  10. package/dist/connectionTelemetry.d.ts +2 -2
  11. package/dist/connectionTelemetry.d.ts.map +1 -1
  12. package/dist/connectionTelemetry.js +8 -1
  13. package/dist/connectionTelemetry.js.map +1 -1
  14. package/dist/containerRuntime.d.ts +19 -7
  15. package/dist/containerRuntime.d.ts.map +1 -1
  16. package/dist/containerRuntime.js +98 -22
  17. package/dist/containerRuntime.js.map +1 -1
  18. package/dist/dataStore.d.ts +2 -2
  19. package/dist/dataStore.d.ts.map +1 -1
  20. package/dist/dataStore.js +1 -1
  21. package/dist/dataStore.js.map +1 -1
  22. package/dist/dataStoreContext.d.ts +3 -4
  23. package/dist/dataStoreContext.d.ts.map +1 -1
  24. package/dist/dataStoreContext.js +5 -5
  25. package/dist/dataStoreContext.js.map +1 -1
  26. package/dist/dataStoreContexts.d.ts +2 -1
  27. package/dist/dataStoreContexts.d.ts.map +1 -1
  28. package/dist/dataStoreContexts.js +2 -1
  29. package/dist/dataStoreContexts.js.map +1 -1
  30. package/dist/dataStores.d.ts +1 -1
  31. package/dist/dataStores.d.ts.map +1 -1
  32. package/dist/dataStores.js +2 -1
  33. package/dist/dataStores.js.map +1 -1
  34. package/dist/deltaScheduler.d.ts +2 -2
  35. package/dist/deltaScheduler.d.ts.map +1 -1
  36. package/dist/deltaScheduler.js +1 -1
  37. package/dist/deltaScheduler.js.map +1 -1
  38. package/dist/gc/garbageCollection.d.ts +2 -2
  39. package/dist/gc/garbageCollection.d.ts.map +1 -1
  40. package/dist/gc/garbageCollection.js +4 -3
  41. package/dist/gc/garbageCollection.js.map +1 -1
  42. package/dist/gc/gcDefinitions.d.ts +3 -4
  43. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  44. package/dist/gc/gcDefinitions.js.map +1 -1
  45. package/dist/gc/gcTelemetry.d.ts +5 -5
  46. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  47. package/dist/gc/gcTelemetry.js.map +1 -1
  48. package/dist/id-compressor/idCompressor.d.ts +2 -2
  49. package/dist/id-compressor/idCompressor.d.ts.map +1 -1
  50. package/dist/id-compressor/idCompressor.js.map +1 -1
  51. package/dist/id-compressor/uuidUtilities.d.ts +0 -2
  52. package/dist/id-compressor/uuidUtilities.d.ts.map +1 -1
  53. package/dist/id-compressor/uuidUtilities.js +1 -3
  54. package/dist/id-compressor/uuidUtilities.js.map +1 -1
  55. package/dist/index.d.ts +1 -1
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js.map +1 -1
  58. package/dist/metadata.d.ts +18 -0
  59. package/dist/metadata.d.ts.map +1 -0
  60. package/dist/metadata.js +7 -0
  61. package/dist/metadata.js.map +1 -0
  62. package/dist/opLifecycle/batchManager.d.ts +2 -1
  63. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  64. package/dist/opLifecycle/batchManager.js +5 -1
  65. package/dist/opLifecycle/batchManager.js.map +1 -1
  66. package/dist/opLifecycle/definitions.d.ts +13 -2
  67. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  68. package/dist/opLifecycle/definitions.js.map +1 -1
  69. package/dist/opLifecycle/index.d.ts +1 -1
  70. package/dist/opLifecycle/index.d.ts.map +1 -1
  71. package/dist/opLifecycle/index.js +2 -1
  72. package/dist/opLifecycle/index.js.map +1 -1
  73. package/dist/opLifecycle/opCompressor.d.ts +2 -2
  74. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  75. package/dist/opLifecycle/opCompressor.js +3 -6
  76. package/dist/opLifecycle/opCompressor.js.map +1 -1
  77. package/dist/opLifecycle/opDecompressor.d.ts +2 -2
  78. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  79. package/dist/opLifecycle/opDecompressor.js +14 -8
  80. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  81. package/dist/opLifecycle/opGroupingManager.d.ts +1 -1
  82. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  83. package/dist/opLifecycle/opGroupingManager.js +6 -11
  84. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  85. package/dist/opLifecycle/opSplitter.d.ts +2 -2
  86. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  87. package/dist/opLifecycle/opSplitter.js +5 -3
  88. package/dist/opLifecycle/opSplitter.js.map +1 -1
  89. package/dist/opLifecycle/outbox.d.ts +35 -4
  90. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  91. package/dist/opLifecycle/outbox.js +135 -45
  92. package/dist/opLifecycle/outbox.js.map +1 -1
  93. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  94. package/dist/opLifecycle/remoteMessageProcessor.js +3 -1
  95. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  96. package/dist/packageVersion.d.ts +1 -1
  97. package/dist/packageVersion.js +1 -1
  98. package/dist/packageVersion.js.map +1 -1
  99. package/dist/pendingStateManager.d.ts +24 -15
  100. package/dist/pendingStateManager.d.ts.map +1 -1
  101. package/dist/pendingStateManager.js +67 -72
  102. package/dist/pendingStateManager.js.map +1 -1
  103. package/dist/scheduleManager.d.ts +2 -2
  104. package/dist/scheduleManager.d.ts.map +1 -1
  105. package/dist/scheduleManager.js +8 -2
  106. package/dist/scheduleManager.js.map +1 -1
  107. package/dist/summary/index.d.ts +2 -2
  108. package/dist/summary/index.d.ts.map +1 -1
  109. package/dist/summary/index.js +2 -1
  110. package/dist/summary/index.js.map +1 -1
  111. package/dist/summary/orderedClientElection.d.ts +4 -3
  112. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  113. package/dist/summary/orderedClientElection.js +3 -18
  114. package/dist/summary/orderedClientElection.js.map +1 -1
  115. package/dist/summary/runningSummarizer.d.ts +4 -3
  116. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  117. package/dist/summary/runningSummarizer.js +5 -6
  118. package/dist/summary/runningSummarizer.js.map +1 -1
  119. package/dist/summary/summarizer.d.ts +2 -3
  120. package/dist/summary/summarizer.d.ts.map +1 -1
  121. package/dist/summary/summarizer.js +2 -3
  122. package/dist/summary/summarizer.js.map +1 -1
  123. package/dist/summary/summarizerClientElection.d.ts +3 -2
  124. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  125. package/dist/summary/summarizerClientElection.js.map +1 -1
  126. package/dist/summary/summarizerHeuristics.d.ts +2 -2
  127. package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
  128. package/dist/summary/summarizerHeuristics.js.map +1 -1
  129. package/dist/summary/summarizerNode/index.d.ts +1 -1
  130. package/dist/summary/summarizerNode/index.d.ts.map +1 -1
  131. package/dist/summary/summarizerNode/index.js.map +1 -1
  132. package/dist/summary/summarizerNode/summarizerNode.d.ts +41 -14
  133. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  134. package/dist/summary/summarizerNode/summarizerNode.js +91 -23
  135. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  136. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +24 -4
  137. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  138. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  139. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +23 -8
  140. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  141. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +60 -23
  142. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  143. package/dist/summary/summarizerTypes.d.ts +16 -9
  144. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  145. package/dist/summary/summarizerTypes.js.map +1 -1
  146. package/dist/summary/summaryCollection.d.ts +4 -2
  147. package/dist/summary/summaryCollection.d.ts.map +1 -1
  148. package/dist/summary/summaryCollection.js +4 -0
  149. package/dist/summary/summaryCollection.js.map +1 -1
  150. package/dist/summary/summaryFormat.d.ts +1 -0
  151. package/dist/summary/summaryFormat.d.ts.map +1 -1
  152. package/dist/summary/summaryFormat.js +2 -1
  153. package/dist/summary/summaryFormat.js.map +1 -1
  154. package/dist/summary/summaryGenerator.d.ts +14 -5
  155. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  156. package/dist/summary/summaryGenerator.js +23 -9
  157. package/dist/summary/summaryGenerator.js.map +1 -1
  158. package/dist/summary/summaryManager.d.ts +4 -2
  159. package/dist/summary/summaryManager.d.ts.map +1 -1
  160. package/dist/summary/summaryManager.js.map +1 -1
  161. package/dist/tsdoc-metadata.json +11 -0
  162. package/lib/batchTracker.d.ts +4 -4
  163. package/lib/batchTracker.d.ts.map +1 -1
  164. package/lib/batchTracker.js +2 -2
  165. package/lib/batchTracker.js.map +1 -1
  166. package/lib/blobManager.d.ts +5 -2
  167. package/lib/blobManager.d.ts.map +1 -1
  168. package/lib/blobManager.js +53 -24
  169. package/lib/blobManager.js.map +1 -1
  170. package/lib/connectionTelemetry.d.ts +2 -2
  171. package/lib/connectionTelemetry.d.ts.map +1 -1
  172. package/lib/connectionTelemetry.js +8 -1
  173. package/lib/connectionTelemetry.js.map +1 -1
  174. package/lib/containerRuntime.d.ts +19 -7
  175. package/lib/containerRuntime.d.ts.map +1 -1
  176. package/lib/containerRuntime.js +101 -25
  177. package/lib/containerRuntime.js.map +1 -1
  178. package/lib/dataStore.d.ts +2 -2
  179. package/lib/dataStore.d.ts.map +1 -1
  180. package/lib/dataStore.js +1 -1
  181. package/lib/dataStore.js.map +1 -1
  182. package/lib/dataStoreContext.d.ts +3 -4
  183. package/lib/dataStoreContext.d.ts.map +1 -1
  184. package/lib/dataStoreContext.js +5 -5
  185. package/lib/dataStoreContext.js.map +1 -1
  186. package/lib/dataStoreContexts.d.ts +2 -1
  187. package/lib/dataStoreContexts.d.ts.map +1 -1
  188. package/lib/dataStoreContexts.js +2 -1
  189. package/lib/dataStoreContexts.js.map +1 -1
  190. package/lib/dataStores.d.ts +1 -1
  191. package/lib/dataStores.d.ts.map +1 -1
  192. package/lib/dataStores.js +2 -1
  193. package/lib/dataStores.js.map +1 -1
  194. package/lib/deltaScheduler.d.ts +2 -2
  195. package/lib/deltaScheduler.d.ts.map +1 -1
  196. package/lib/deltaScheduler.js +1 -1
  197. package/lib/deltaScheduler.js.map +1 -1
  198. package/lib/gc/garbageCollection.d.ts +2 -2
  199. package/lib/gc/garbageCollection.d.ts.map +1 -1
  200. package/lib/gc/garbageCollection.js +2 -1
  201. package/lib/gc/garbageCollection.js.map +1 -1
  202. package/lib/gc/gcDefinitions.d.ts +3 -4
  203. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  204. package/lib/gc/gcDefinitions.js.map +1 -1
  205. package/lib/gc/gcTelemetry.d.ts +5 -5
  206. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  207. package/lib/gc/gcTelemetry.js +1 -1
  208. package/lib/gc/gcTelemetry.js.map +1 -1
  209. package/lib/id-compressor/idCompressor.d.ts +2 -2
  210. package/lib/id-compressor/idCompressor.d.ts.map +1 -1
  211. package/lib/id-compressor/idCompressor.js.map +1 -1
  212. package/lib/id-compressor/uuidUtilities.d.ts +0 -2
  213. package/lib/id-compressor/uuidUtilities.d.ts.map +1 -1
  214. package/lib/id-compressor/uuidUtilities.js +1 -3
  215. package/lib/id-compressor/uuidUtilities.js.map +1 -1
  216. package/lib/index.d.ts +1 -1
  217. package/lib/index.d.ts.map +1 -1
  218. package/lib/index.js.map +1 -1
  219. package/lib/metadata.d.ts +18 -0
  220. package/lib/metadata.d.ts.map +1 -0
  221. package/lib/metadata.js +6 -0
  222. package/lib/metadata.js.map +1 -0
  223. package/lib/opLifecycle/batchManager.d.ts +2 -1
  224. package/lib/opLifecycle/batchManager.d.ts.map +1 -1
  225. package/lib/opLifecycle/batchManager.js +5 -1
  226. package/lib/opLifecycle/batchManager.js.map +1 -1
  227. package/lib/opLifecycle/definitions.d.ts +13 -2
  228. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  229. package/lib/opLifecycle/definitions.js.map +1 -1
  230. package/lib/opLifecycle/index.d.ts +1 -1
  231. package/lib/opLifecycle/index.d.ts.map +1 -1
  232. package/lib/opLifecycle/index.js +1 -1
  233. package/lib/opLifecycle/index.js.map +1 -1
  234. package/lib/opLifecycle/opCompressor.d.ts +2 -2
  235. package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
  236. package/lib/opLifecycle/opCompressor.js +3 -6
  237. package/lib/opLifecycle/opCompressor.js.map +1 -1
  238. package/lib/opLifecycle/opDecompressor.d.ts +2 -2
  239. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  240. package/lib/opLifecycle/opDecompressor.js +14 -8
  241. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  242. package/lib/opLifecycle/opGroupingManager.d.ts +1 -1
  243. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  244. package/lib/opLifecycle/opGroupingManager.js +6 -11
  245. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  246. package/lib/opLifecycle/opSplitter.d.ts +2 -2
  247. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  248. package/lib/opLifecycle/opSplitter.js +5 -3
  249. package/lib/opLifecycle/opSplitter.js.map +1 -1
  250. package/lib/opLifecycle/outbox.d.ts +35 -4
  251. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  252. package/lib/opLifecycle/outbox.js +133 -44
  253. package/lib/opLifecycle/outbox.js.map +1 -1
  254. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  255. package/lib/opLifecycle/remoteMessageProcessor.js +3 -1
  256. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  257. package/lib/packageVersion.d.ts +1 -1
  258. package/lib/packageVersion.js +1 -1
  259. package/lib/packageVersion.js.map +1 -1
  260. package/lib/pendingStateManager.d.ts +24 -15
  261. package/lib/pendingStateManager.d.ts.map +1 -1
  262. package/lib/pendingStateManager.js +67 -72
  263. package/lib/pendingStateManager.js.map +1 -1
  264. package/lib/scheduleManager.d.ts +2 -2
  265. package/lib/scheduleManager.d.ts.map +1 -1
  266. package/lib/scheduleManager.js +8 -2
  267. package/lib/scheduleManager.js.map +1 -1
  268. package/lib/summary/index.d.ts +2 -2
  269. package/lib/summary/index.d.ts.map +1 -1
  270. package/lib/summary/index.js +1 -1
  271. package/lib/summary/index.js.map +1 -1
  272. package/lib/summary/orderedClientElection.d.ts +4 -3
  273. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  274. package/lib/summary/orderedClientElection.js +3 -18
  275. package/lib/summary/orderedClientElection.js.map +1 -1
  276. package/lib/summary/runningSummarizer.d.ts +4 -3
  277. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  278. package/lib/summary/runningSummarizer.js +5 -6
  279. package/lib/summary/runningSummarizer.js.map +1 -1
  280. package/lib/summary/summarizer.d.ts +2 -3
  281. package/lib/summary/summarizer.d.ts.map +1 -1
  282. package/lib/summary/summarizer.js +2 -3
  283. package/lib/summary/summarizer.js.map +1 -1
  284. package/lib/summary/summarizerClientElection.d.ts +3 -2
  285. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  286. package/lib/summary/summarizerClientElection.js.map +1 -1
  287. package/lib/summary/summarizerHeuristics.d.ts +2 -2
  288. package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
  289. package/lib/summary/summarizerHeuristics.js.map +1 -1
  290. package/lib/summary/summarizerNode/index.d.ts +1 -1
  291. package/lib/summary/summarizerNode/index.d.ts.map +1 -1
  292. package/lib/summary/summarizerNode/index.js.map +1 -1
  293. package/lib/summary/summarizerNode/summarizerNode.d.ts +41 -14
  294. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  295. package/lib/summary/summarizerNode/summarizerNode.js +91 -23
  296. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  297. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +24 -4
  298. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  299. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  300. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +23 -8
  301. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  302. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +59 -22
  303. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  304. package/lib/summary/summarizerTypes.d.ts +16 -9
  305. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  306. package/lib/summary/summarizerTypes.js.map +1 -1
  307. package/lib/summary/summaryCollection.d.ts +4 -2
  308. package/lib/summary/summaryCollection.d.ts.map +1 -1
  309. package/lib/summary/summaryCollection.js +4 -0
  310. package/lib/summary/summaryCollection.js.map +1 -1
  311. package/lib/summary/summaryFormat.d.ts +1 -0
  312. package/lib/summary/summaryFormat.d.ts.map +1 -1
  313. package/lib/summary/summaryFormat.js +2 -1
  314. package/lib/summary/summaryFormat.js.map +1 -1
  315. package/lib/summary/summaryGenerator.d.ts +14 -5
  316. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  317. package/lib/summary/summaryGenerator.js +21 -8
  318. package/lib/summary/summaryGenerator.js.map +1 -1
  319. package/lib/summary/summaryManager.d.ts +4 -2
  320. package/lib/summary/summaryManager.d.ts.map +1 -1
  321. package/lib/summary/summaryManager.js +1 -1
  322. package/lib/summary/summaryManager.js.map +1 -1
  323. package/package.json +25 -41
  324. package/src/batchTracker.ts +5 -6
  325. package/src/blobManager.ts +70 -29
  326. package/src/connectionTelemetry.ts +14 -6
  327. package/src/containerRuntime.ts +124 -38
  328. package/src/dataStore.ts +3 -4
  329. package/src/dataStoreContext.ts +12 -9
  330. package/src/dataStoreContexts.ts +6 -8
  331. package/src/dataStores.ts +8 -3
  332. package/src/deltaScheduler.ts +2 -3
  333. package/src/gc/garbageCollection.ts +7 -6
  334. package/src/gc/gcDefinitions.ts +3 -4
  335. package/src/gc/gcTelemetry.ts +9 -5
  336. package/src/id-compressor/idCompressor.ts +2 -2
  337. package/src/id-compressor/uuidUtilities.ts +1 -4
  338. package/src/index.ts +2 -0
  339. package/src/metadata.ts +19 -0
  340. package/src/opLifecycle/README.md +20 -0
  341. package/src/opLifecycle/batchManager.ts +9 -1
  342. package/src/opLifecycle/definitions.ts +13 -2
  343. package/src/opLifecycle/index.ts +1 -1
  344. package/src/opLifecycle/opCompressor.ts +4 -8
  345. package/src/opLifecycle/opDecompressor.ts +43 -16
  346. package/src/opLifecycle/opGroupingManager.ts +19 -13
  347. package/src/opLifecycle/opSplitter.ts +7 -6
  348. package/src/opLifecycle/outbox.ts +172 -57
  349. package/src/opLifecycle/remoteMessageProcessor.ts +5 -1
  350. package/src/packageVersion.ts +1 -1
  351. package/src/pendingStateManager.ts +113 -129
  352. package/src/scheduleManager.ts +18 -10
  353. package/src/summary/index.ts +3 -1
  354. package/src/summary/orderedClientElection.ts +7 -20
  355. package/src/summary/runningSummarizer.ts +11 -10
  356. package/src/summary/summarizer.ts +8 -8
  357. package/src/summary/summarizerClientElection.ts +3 -2
  358. package/src/summary/summarizerHeuristics.ts +2 -2
  359. package/src/summary/summarizerNode/index.ts +1 -0
  360. package/src/summary/summarizerNode/summarizerNode.ts +121 -38
  361. package/src/summary/summarizerNode/summarizerNodeUtils.ts +27 -4
  362. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +73 -27
  363. package/src/summary/summarizerTypes.ts +19 -14
  364. package/src/summary/summaryCollection.ts +10 -4
  365. package/src/summary/summaryFormat.ts +5 -1
  366. package/src/summary/summaryGenerator.ts +38 -11
  367. package/src/summary/summaryManager.ts +9 -9
@@ -5,17 +5,17 @@
5
5
 
6
6
  import { EventEmitter } from "events";
7
7
  import { Deferred } from "@fluidframework/common-utils";
8
- import { ITelemetryLogger } from "@fluidframework/common-definitions";
9
- import { ILoader, LoaderHeader } from "@fluidframework/container-definitions";
10
- import { UsageError } from "@fluidframework/container-utils";
11
- import { DriverHeader } from "@fluidframework/driver-definitions";
12
- import { requestFluidObject } from "@fluidframework/runtime-utils";
13
8
  import {
9
+ ITelemetryLoggerExt,
14
10
  ChildLogger,
15
11
  IFluidErrorBase,
16
12
  LoggingError,
17
13
  wrapErrorAndLog,
18
14
  } from "@fluidframework/telemetry-utils";
15
+ import { ILoader, LoaderHeader } from "@fluidframework/container-definitions";
16
+ import { UsageError } from "@fluidframework/container-utils";
17
+ import { DriverHeader } from "@fluidframework/driver-definitions";
18
+ import { requestFluidObject } from "@fluidframework/runtime-utils";
19
19
  import { FluidObject, IFluidHandleContext, IRequest } from "@fluidframework/core-interfaces";
20
20
  import { ISummaryConfiguration } from "../containerRuntime";
21
21
  import { ICancellableSummarizerController } from "./runWhileConnectedCoordinator";
@@ -47,7 +47,7 @@ export class SummarizingWarning
47
47
  super(errorMessage);
48
48
  }
49
49
 
50
- static wrap(error: any, logged: boolean = false, logger: ITelemetryLogger) {
50
+ static wrap(error: any, logged: boolean = false, logger: ITelemetryLoggerExt) {
51
51
  const newErrorFn = (errMsg: string) => new SummarizingWarning(errMsg, logged);
52
52
  return wrapErrorAndLog<SummarizingWarning>(error, newErrorFn, logger);
53
53
  }
@@ -66,7 +66,7 @@ export class Summarizer extends EventEmitter implements ISummarizer {
66
66
  return this;
67
67
  }
68
68
 
69
- private readonly logger: ITelemetryLogger;
69
+ private readonly logger: ITelemetryLoggerExt;
70
70
  private runningSummarizer?: RunningSummarizer;
71
71
  private _disposed: boolean = false;
72
72
  private starting: boolean = false;
@@ -152,7 +152,7 @@ export class Summarizer extends EventEmitter implements ISummarizer {
152
152
  // This will result in "summarizerClientDisconnected" stop reason recorded in telemetry,
153
153
  // unless stop() was called earlier
154
154
  this.dispose();
155
- (this.runtime.disposeFn ?? this.runtime.closeFn)();
155
+ this.runtime.disposeFn();
156
156
  }
157
157
 
158
158
  private async runCore(onBehalfOf: string): Promise<SummarizerStopReason> {
@@ -3,7 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { IEvent, IEventProvider, ITelemetryLogger } from "@fluidframework/common-definitions";
6
+ import { IEvent, IEventProvider } from "@fluidframework/common-definitions";
7
+ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
7
8
  import { TypedEventEmitter } from "@fluidframework/common-utils";
8
9
  import { IClientDetails, MessageType } from "@fluidframework/protocol-definitions";
9
10
  import {
@@ -55,7 +56,7 @@ export class SummarizerClientElection
55
56
  }
56
57
 
57
58
  constructor(
58
- private readonly logger: ITelemetryLogger,
59
+ private readonly logger: ITelemetryLoggerExt,
59
60
  private readonly summaryCollection: IEventProvider<ISummaryCollectionOpEvents>,
60
61
  public readonly clientElection: IOrderedClientElection,
61
62
  private readonly maxOpsSinceLastSummary: number,
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITelemetryLogger } from "@fluidframework/common-definitions";
6
+ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
7
7
  import { Timer } from "@fluidframework/common-utils";
8
8
  import { ISummaryConfigurationHeuristics } from "../containerRuntime";
9
9
  import {
@@ -103,7 +103,7 @@ export class SummarizeHeuristicRunner implements ISummarizeHeuristicRunner {
103
103
  private readonly heuristicData: ISummarizeHeuristicData,
104
104
  private readonly configuration: ISummaryConfigurationHeuristics,
105
105
  trySummarize: (reason: SummarizeReason) => void,
106
- private readonly logger: ITelemetryLogger,
106
+ private readonly logger: ITelemetryLoggerExt,
107
107
  private readonly summarizeStrategies: ISummaryHeuristicStrategy[] = getDefaultSummaryHeuristicStrategies(),
108
108
  ) {
109
109
  this.idleTimer = new Timer(this.idleTime, () => this.runSummarize("idle"));
@@ -7,6 +7,7 @@ export {
7
7
  IFetchSnapshotResult,
8
8
  ISummarizerNodeRootContract,
9
9
  RefreshSummaryResult,
10
+ ValidateSummaryResult,
10
11
  } from "./summarizerNodeUtils";
11
12
  export { IRootSummarizerNode, createRootSummarizerNode } from "./summarizerNode";
12
13
  export { IRootSummarizerNodeWithGC, createRootSummarizerNodeWithGC } from "./summarizerNodeWithGc";
@@ -3,6 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ import { ITelemetryErrorEvent } from "@fluidframework/core-interfaces";
6
7
  import {
7
8
  ISummarizerNode,
8
9
  ISummarizerNodeConfig,
@@ -20,7 +21,13 @@ import {
20
21
  ISnapshotTree,
21
22
  SummaryObject,
22
23
  } from "@fluidframework/protocol-definitions";
23
- import { ITelemetryErrorEvent, ITelemetryLogger } from "@fluidframework/common-definitions";
24
+ import {
25
+ ITelemetryLoggerExt,
26
+ ChildLogger,
27
+ LoggingError,
28
+ PerformanceEvent,
29
+ TelemetryDataTag,
30
+ } from "@fluidframework/telemetry-utils";
24
31
  import { assert, unreachableCase } from "@fluidframework/common-utils";
25
32
  import {
26
33
  convertToSummaryTree,
@@ -28,12 +35,6 @@ import {
28
35
  mergeStats,
29
36
  ReadAndParseBlob,
30
37
  } from "@fluidframework/runtime-utils";
31
- import {
32
- ChildLogger,
33
- LoggingError,
34
- PerformanceEvent,
35
- TelemetryDataTag,
36
- } from "@fluidframework/telemetry-utils";
37
38
  import {
38
39
  EscapedPath,
39
40
  ICreateChildDetails,
@@ -44,6 +45,7 @@ import {
44
45
  parseSummaryTreeForSubtrees,
45
46
  RefreshSummaryResult,
46
47
  SummaryNode,
48
+ ValidateSummaryResult,
47
49
  } from "./summarizerNodeUtils";
48
50
 
49
51
  export interface IRootSummarizerNode extends ISummarizerNode, ISummarizerNodeRootContract {}
@@ -76,21 +78,21 @@ export class SummarizerNode implements IRootSummarizerNode {
76
78
  private wipLocalPaths: { localPath: EscapedPath; additionalPath?: EscapedPath } | undefined;
77
79
  private wipSkipRecursion = false;
78
80
 
79
- protected readonly logger: ITelemetryLogger;
81
+ protected readonly logger: ITelemetryLoggerExt;
80
82
 
81
83
  /**
82
84
  * Do not call constructor directly.
83
85
  * Use createRootSummarizerNode to create root node, or createChild to create child nodes.
84
86
  */
85
87
  public constructor(
86
- baseLogger: ITelemetryLogger,
88
+ baseLogger: ITelemetryLoggerExt,
87
89
  private readonly summarizeInternalFn: SummarizeInternalFn,
88
90
  config: ISummarizerNodeConfig,
89
91
  private _changeSequenceNumber: number,
90
92
  /** Undefined means created without summary */
91
93
  private _latestSummary?: SummaryNode,
92
94
  private readonly initialSummary?: IInitialSummary,
93
- protected wipSummaryLogger?: ITelemetryLogger,
95
+ protected wipSummaryLogger?: ITelemetryLoggerExt,
94
96
  /** A unique id of this node to be logged when sending telemetry. */
95
97
  protected telemetryNodeId?: string,
96
98
  ) {
@@ -106,7 +108,7 @@ export class SummarizerNode implements IRootSummarizerNode {
106
108
  });
107
109
  }
108
110
 
109
- public startSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryLogger) {
111
+ public startSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryLoggerExt) {
110
112
  assert(
111
113
  this.wipSummaryLogger === undefined,
112
114
  0x19f /* "wipSummaryLogger should not be set yet in startSummary" */,
@@ -192,24 +194,117 @@ export class SummarizerNode implements IRootSummarizerNode {
192
194
  }
193
195
 
194
196
  /**
195
- * Complete the WIP summary for the given proposalHandle
197
+ * Validates that the in-progress summary is correct, i.e., summarize should have run for all non-skipped
198
+ * nodes. This will only be called for the root summarizer node and is called by it recursively on all child nodes.
199
+ *
200
+ * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.
201
+ * In case of failure, additional information is returned indicating type of failure and where it was.
202
+ */
203
+ public validateSummary(): ValidateSummaryResult {
204
+ return this.validateSummaryCore(false /* parentSkipRecursion */);
205
+ }
206
+
207
+ /**
208
+ * Validates that the in-progress summary is correct for all nodes, i.e., summarize should have run for all
209
+ * non-skipped nodes.
210
+ * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.
211
+ * In that case, the children will not have work-in-progress state.
212
+ *
213
+ * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.
214
+ * In case of failure, additional information is returned indicating type of failure and where it was.
215
+ */
216
+ protected validateSummaryCore(parentSkipRecursion: boolean): ValidateSummaryResult {
217
+ if (this.wasSummarizeMissed(parentSkipRecursion)) {
218
+ return {
219
+ success: false,
220
+ reason: "NodeDidNotSummarize",
221
+ id: {
222
+ tag: TelemetryDataTag.CodeArtifact,
223
+ value: this.telemetryNodeId,
224
+ },
225
+ // These errors are usually transient and should go away when summarize is retried.
226
+ retryAfterSeconds: 1,
227
+ };
228
+ }
229
+ if (parentSkipRecursion) {
230
+ return { success: true };
231
+ }
232
+
233
+ for (const child of this.children.values()) {
234
+ const result = child.validateSummaryCore(this.wipSkipRecursion || parentSkipRecursion);
235
+ // If any child fails, return the failure.
236
+ if (!result.success) {
237
+ return result;
238
+ }
239
+ }
240
+ return { success: true };
241
+ }
242
+
243
+ private wasSummarizeMissed(parentSkipRecursion: boolean): boolean {
244
+ assert(
245
+ this.wipSummaryLogger !== undefined,
246
+ 0x6fc /* wipSummaryLogger should have been set in startSummary or ctor */,
247
+ );
248
+ assert(this.wipReferenceSequenceNumber !== undefined, 0x6fd /* Not tracking a summary */);
249
+
250
+ // If the parent node skipped recursion, it did not call summarize on this node. So, summarize was not missed
251
+ // but was intentionally not called.
252
+ // Otherwise, summarize should have been called on this node and wipLocalPaths must be set.
253
+ if (parentSkipRecursion || this.wipLocalPaths !== undefined) {
254
+ return false;
255
+ }
256
+
257
+ /**
258
+ * The absence of wip local path indicates that summarize was not called for this node. Return failure.
259
+ * This can happen if:
260
+ * 1. A child node was created after summarize was already called on the parent. For example, a data store
261
+ * is realized (loaded) after summarize was called on it creating summarizer nodes for its DDSes. In this case,
262
+ * parentSkipRecursion will be true and the if block above would handle it.
263
+ * 2. A new node was created but summarize was never called on it. This can mean that the summary that is
264
+ * generated may not have the data from this node. We should not continue, log and throw an error. This
265
+ * will help us identify these cases and take appropriate action.
266
+ *
267
+ * This happens due to scenarios such as data store created during summarize. Such errors should go away when
268
+ * summarize is attempted again.
269
+ */
270
+ return true;
271
+ }
272
+
273
+ /**
274
+ * Called after summary has been uploaded to the server. Add the work-in-progress state to the pending summary
275
+ * queue. We track this until we get an ack from the server for this summary.
276
+ * @param proposalHandle - The handle of the summary that was uploaded to the server.
196
277
  */
197
- public completeSummary(proposalHandle: string) {
198
- this.completeSummaryCore(proposalHandle, undefined, false);
278
+ public completeSummary(proposalHandle: string, validate: boolean) {
279
+ this.completeSummaryCore(
280
+ proposalHandle,
281
+ undefined /* parentPath */,
282
+ false /* parentSkipRecursion */,
283
+ validate,
284
+ );
199
285
  }
200
286
 
201
287
  /**
202
- * Recursive implementation for completeSummary, with additional internal-only parameters
288
+ * Recursive implementation for completeSummary, with additional internal-only parameters.
289
+ * @param proposalHandle - The handle of the summary that was uploaded to the server.
290
+ * @param parentPath - The path of the parent node which is used to build the path of this node.
291
+ * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.
292
+ * In that case, the children will not have work-in-progress state.
293
+ * @param validate - true to validate that the in-progress summary is correct for all nodes.
203
294
  */
204
295
  protected completeSummaryCore(
205
296
  proposalHandle: string,
206
297
  parentPath: EscapedPath | undefined,
207
298
  parentSkipRecursion: boolean,
299
+ validate: boolean,
208
300
  ) {
209
- assert(
210
- this.wipSummaryLogger !== undefined,
211
- 0x1a3 /* "wipSummaryLogger should have been set in startSummary or ctor" */,
212
- );
301
+ if (validate && this.wasSummarizeMissed(parentSkipRecursion)) {
302
+ this.throwUnexpectedError({
303
+ eventName: "NodeDidNotSummarize",
304
+ proposalHandle,
305
+ });
306
+ }
307
+
213
308
  assert(this.wipReferenceSequenceNumber !== undefined, 0x1a4 /* "Not tracking a summary" */);
214
309
  let localPathsToUse = this.wipLocalPaths;
215
310
 
@@ -238,22 +333,9 @@ export class SummarizerNode implements IRootSummarizerNode {
238
333
  }
239
334
  }
240
335
 
241
- /**
242
- * The absence of wip local path indicates that summarize was not called for this node. This can happen if:
243
- * 1. A child node was created after summarize was already called on the parent. For example, a data store
244
- * is realized (loaded) after summarize was called on it creating summarizer nodes for its DDSes. In this case,
245
- * parentSkipRecursion will be true and the if block above would handle it.
246
- * 2. A new node was created but summarize was never called on it. This can mean that the summary that is
247
- * generated may not have the data from this node. We should not continue, log and throw an error. This
248
- * will help us identify these cases and take appropriate action.
249
- */
250
- if (localPathsToUse === undefined) {
251
- this.throwUnexpectedError({
252
- eventName: "NodeNotSummarized",
253
- proposalHandle,
254
- });
255
- }
256
-
336
+ // If localPathsToUse is undefined, it means summarize didn't run for this node and in that case the validate
337
+ // step should have failed.
338
+ assert(localPathsToUse !== undefined, 0x6fe /* summarize didn't run for node */);
257
339
  const summary = new SummaryNode({
258
340
  ...localPathsToUse,
259
341
  referenceSequenceNumber: this.wipReferenceSequenceNumber,
@@ -265,6 +347,7 @@ export class SummarizerNode implements IRootSummarizerNode {
265
347
  proposalHandle,
266
348
  fullPathForChildren,
267
349
  this.wipSkipRecursion || parentSkipRecursion,
350
+ validate,
268
351
  );
269
352
  }
270
353
  // Note that this overwrites existing pending summary with
@@ -306,7 +389,7 @@ export class SummarizerNode implements IRootSummarizerNode {
306
389
  summaryRefSeq: number,
307
390
  fetchLatestSnapshot: () => Promise<IFetchSnapshotResult>,
308
391
  readAndParseBlob: ReadAndParseBlob,
309
- correlatedSummaryLogger: ITelemetryLogger,
392
+ correlatedSummaryLogger: ITelemetryLoggerExt,
310
393
  ): Promise<RefreshSummaryResult> {
311
394
  const eventProps: {
312
395
  proposalHandle: string | undefined;
@@ -449,7 +532,7 @@ export class SummarizerNode implements IRootSummarizerNode {
449
532
  snapshotTree: ISnapshotTree,
450
533
  basePath: EscapedPath | undefined,
451
534
  localPath: EscapedPath,
452
- correlatedSummaryLogger: ITelemetryLogger,
535
+ correlatedSummaryLogger: ITelemetryLoggerExt,
453
536
  readAndParseBlob: ReadAndParseBlob,
454
537
  ): Promise<void> {
455
538
  // Possible re-entrancy. If we have already seen a summary later than this one, ignore it.
@@ -746,7 +829,7 @@ export class SummarizerNode implements IRootSummarizerNode {
746
829
  * @param config - Configure behavior of summarizer node
747
830
  */
748
831
  export const createRootSummarizerNode = (
749
- logger: ITelemetryLogger,
832
+ logger: ITelemetryLoggerExt,
750
833
  summarizeInternalFn: SummarizeInternalFn,
751
834
  changeSequenceNumber: number,
752
835
  referenceSequenceNumber: number | undefined,
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITelemetryLogger } from "@fluidframework/common-definitions";
6
+ import { ITelemetryLoggerExt, TelemetryDataTag } from "@fluidframework/telemetry-utils";
7
7
  import { ISnapshotTree, ISummaryTree, SummaryObject } from "@fluidframework/protocol-definitions";
8
8
  import { channelsTreeName, ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
9
9
  import { ReadAndParseBlob } from "@fluidframework/runtime-utils";
@@ -42,16 +42,39 @@ export interface IFetchSnapshotResult {
42
42
  snapshotRefSeq: number;
43
43
  }
44
44
 
45
+ /**
46
+ * Return type of validateSummary function. In case of success, the object returned should have success: true.
47
+ * In case of failure, the object returned should have success: false and additional properties to indicate what
48
+ * the failure was, where it was, can it be retried, etc.
49
+ */
50
+ export type ValidateSummaryResult =
51
+ | {
52
+ success: true;
53
+ }
54
+ | {
55
+ success: false;
56
+ /** The failure reason */
57
+ reason: string;
58
+ /** id of the node that failed during validation */
59
+ id: {
60
+ tag: TelemetryDataTag.CodeArtifact;
61
+ value: string | undefined;
62
+ };
63
+ /** If the error can be retried, time to wait before retrying */
64
+ retryAfterSeconds?: number;
65
+ };
66
+
45
67
  export interface ISummarizerNodeRootContract {
46
- startSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryLogger): void;
47
- completeSummary(proposalHandle: string): void;
68
+ startSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryLoggerExt): void;
69
+ validateSummary(): ValidateSummaryResult;
70
+ completeSummary(proposalHandle: string, validate: boolean): void;
48
71
  clearSummary(): void;
49
72
  refreshLatestSummary(
50
73
  proposalHandle: string | undefined,
51
74
  summaryRefSeq: number,
52
75
  fetchLatestSnapshot: () => Promise<IFetchSnapshotResult>,
53
76
  readAndParseBlob: ReadAndParseBlob,
54
- correlatedSummaryLogger: ITelemetryLogger,
77
+ correlatedSummaryLogger: ITelemetryLoggerExt,
55
78
  ): Promise<RefreshSummaryResult>;
56
79
  }
57
80
 
@@ -3,8 +3,13 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITelemetryLogger } from "@fluidframework/common-definitions";
7
- import { assert, LazyPromise } from "@fluidframework/common-utils";
6
+ import {
7
+ ITelemetryLoggerExt,
8
+ LoggingError,
9
+ TelemetryDataTag,
10
+ } from "@fluidframework/telemetry-utils";
11
+ import { assert } from "@fluidframework/common-utils";
12
+ import { LazyPromise } from "@fluidframework/core-utils";
8
13
  import { ISnapshotTree } from "@fluidframework/protocol-definitions";
9
14
  import {
10
15
  CreateChildSummarizerNodeParam,
@@ -19,7 +24,6 @@ import {
19
24
  ITelemetryContext,
20
25
  IExperimentalIncrementalSummaryContext,
21
26
  } from "@fluidframework/runtime-definitions";
22
- import { LoggingError, TelemetryDataTag } from "@fluidframework/telemetry-utils";
23
27
  import { ReadAndParseBlob, unpackChildNodesUsedRoutes } from "@fluidframework/runtime-utils";
24
28
  import {
25
29
  cloneGCData,
@@ -35,6 +39,7 @@ import {
35
39
  ISummarizerNodeRootContract,
36
40
  parseSummaryForSubtrees,
37
41
  SummaryNode,
42
+ ValidateSummaryResult,
38
43
  } from "./summarizerNodeUtils";
39
44
 
40
45
  export interface IRootSummarizerNodeWithGC
@@ -44,7 +49,7 @@ export interface IRootSummarizerNodeWithGC
44
49
  // Extend SummaryNode to add used routes tracking to it.
45
50
  class SummaryNodeWithGC extends SummaryNode {
46
51
  constructor(
47
- public readonly serializedUsedRoutes: string,
52
+ public readonly serializedUsedRoutes: string | undefined,
48
53
  summary: {
49
54
  readonly referenceSequenceNumber: number;
50
55
  readonly basePath: EscapedPath | undefined;
@@ -102,7 +107,7 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
102
107
  * Use createRootSummarizerNodeWithGC to create root node, or createChild to create child nodes.
103
108
  */
104
109
  public constructor(
105
- logger: ITelemetryLogger,
110
+ logger: ITelemetryLoggerExt,
106
111
  private readonly summarizeFn: (
107
112
  fullTree: boolean,
108
113
  trackState: boolean,
@@ -114,7 +119,7 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
114
119
  /** Undefined means created without summary */
115
120
  latestSummary?: SummaryNode,
116
121
  initialSummary?: IInitialSummary,
117
- wipSummaryLogger?: ITelemetryLogger,
122
+ wipSummaryLogger?: ITelemetryLoggerExt,
118
123
  private readonly getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
119
124
  getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,
120
125
  /** A unique id of this node to be logged when sending telemetry. */
@@ -241,7 +246,7 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
241
246
  /**
242
247
  * Called during the start of a summary. Updates the work-in-progress used routes.
243
248
  */
244
- public startSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryLogger) {
249
+ public startSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryLoggerExt) {
245
250
  // If GC is disabled, skip setting wip used routes since we should not track GC state.
246
251
  if (!this.gcDisabled) {
247
252
  assert(
@@ -252,45 +257,86 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
252
257
  super.startSummary(referenceSequenceNumber, summaryLogger);
253
258
  }
254
259
 
260
+ /**
261
+ * Validates that the in-progress summary is correct for all nodes, i.e., GC should have run for non-skipped nodes.
262
+ * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when running GC.
263
+ * In that case, the children will not have work-in-progress state.
264
+ *
265
+ * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.
266
+ * In case of failure, additional information is returned indicating type of failure and where it was.
267
+ */
268
+ protected validateSummaryCore(parentSkipRecursion: boolean): ValidateSummaryResult {
269
+ if (this.wasGCMissed()) {
270
+ return {
271
+ success: false,
272
+ reason: "NodeDidNotRunGC",
273
+ id: {
274
+ tag: TelemetryDataTag.CodeArtifact,
275
+ value: this.telemetryNodeId,
276
+ },
277
+ // These errors are usually transient and should go away when summarize / GC is retried.
278
+ retryAfterSeconds: 1,
279
+ };
280
+ }
281
+ return super.validateSummaryCore(parentSkipRecursion);
282
+ }
283
+
284
+ private wasGCMissed(): boolean {
285
+ // If GC is disabled, it should not have run so it was not missed.
286
+ // Otherwise, GC should have been called on this node and wipSerializedUsedRoutes must be set.
287
+ if (this.gcDisabled || this.wipSerializedUsedRoutes !== undefined) {
288
+ return false;
289
+ }
290
+ /**
291
+ * The absence of wip used routes indicates that GC was not run on this node. This can happen if:
292
+ * 1. A child node was created after GC was already run on the parent. For example, a data store
293
+ * is realized (loaded) after GC was run on it creating summarizer nodes for its DDSes. In this
294
+ * case, the parent will pass on used routes to the child nodes and it will have wip used routes.
295
+ * 2. A new node was created but GC was never run on it. This can mean that the GC data generated
296
+ * during summarize is incomplete.
297
+ *
298
+ * This happens due to scenarios such as data store created during summarize. Such errors should go away when
299
+ * summarize is attempted again.
300
+ */
301
+ return true;
302
+ }
303
+
255
304
  /**
256
305
  * Called after summary has been uploaded to the server. Add the work-in-progress state to the pending
257
306
  * summary queue. We track this until we get an ack from the server for this summary.
307
+ * @param proposalHandle - The handle of the summary that was uploaded to the server.
308
+ * @param parentPath - The path of the parent node which is used to build the path of this node.
309
+ * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.
310
+ * In that case, the children will not have work-in-progress state.
311
+ * @param validate - true to validate that the in-progress summary is correct for all nodes.
258
312
  */
259
313
  protected completeSummaryCore(
260
314
  proposalHandle: string,
261
315
  parentPath: EscapedPath | undefined,
262
316
  parentSkipRecursion: boolean,
317
+ validate: boolean,
263
318
  ) {
319
+ if (validate && this.wasGCMissed()) {
320
+ this.throwUnexpectedError({
321
+ eventName: "NodeDidNotRunGC",
322
+ proposalHandle,
323
+ });
324
+ }
325
+
264
326
  let wipSerializedUsedRoutes: string | undefined;
265
327
  // If GC is disabled, don't set wip used routes.
266
328
  if (!this.gcDisabled) {
267
329
  wipSerializedUsedRoutes = this.wipSerializedUsedRoutes;
268
- /**
269
- * The absence of wip used routes indicates that GC was not run on this node. This can happen if:
270
- * 1. A child node was created after GC was already run on the parent. For example, a data store
271
- * is realized (loaded) after GC was run on it creating summarizer nodes for its DDSes. In this
272
- * case, the used routes of the parent should be passed on the child nodes and it should be fine.
273
- * 2. A new node was created but GC was never run on it. This can mean that the GC data generated
274
- * during summarize is complete . We should not continue, log and throw an error. This will help us
275
- * identify these cases and take appropriate action.
276
- */
277
- if (wipSerializedUsedRoutes === undefined) {
278
- this.throwUnexpectedError({
279
- eventName: "NodeDidNotRunGC",
280
- proposalHandle,
281
- });
282
- }
283
330
  }
284
331
 
285
- super.completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion);
332
+ super.completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion, validate);
286
333
 
287
334
  // If GC is disabled, skip setting pending summary with GC state.
288
335
  if (!this.gcDisabled) {
289
336
  const summaryNode = this.pendingSummaries.get(proposalHandle);
290
337
  if (summaryNode !== undefined) {
291
338
  const summaryNodeWithGC = new SummaryNodeWithGC(
292
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
293
- wipSerializedUsedRoutes!,
339
+ wipSerializedUsedRoutes,
294
340
  summaryNode,
295
341
  );
296
342
  this.pendingSummaries.set(proposalHandle, summaryNodeWithGC);
@@ -352,7 +398,7 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
352
398
  snapshotTree: ISnapshotTree,
353
399
  basePath: EscapedPath | undefined,
354
400
  localPath: EscapedPath,
355
- correlatedSummaryLogger: ITelemetryLogger,
401
+ correlatedSummaryLogger: ITelemetryLoggerExt,
356
402
  readAndParseBlob: ReadAndParseBlob,
357
403
  ): Promise<void> {
358
404
  await this.refreshGCStateFromSnapshot(
@@ -620,7 +666,7 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
620
666
  * @param baseGCDetailsP - Function to get the initial GC details of this node
621
667
  */
622
668
  export const createRootSummarizerNodeWithGC = (
623
- logger: ITelemetryLogger,
669
+ logger: ITelemetryLoggerExt,
624
670
  summarizeInternalFn: SummarizeInternalFn,
625
671
  changeSequenceNumber: number,
626
672
  referenceSequenceNumber: number | undefined,
@@ -3,13 +3,9 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import {
7
- IEvent,
8
- IEventProvider,
9
- ITelemetryLogger,
10
- ITelemetryProperties,
11
- } from "@fluidframework/common-definitions";
12
- import { ITelemetryLoggerPropertyBag } from "@fluidframework/telemetry-utils";
6
+ import { IEvent, IEventProvider } from "@fluidframework/common-definitions";
7
+ import { ITelemetryProperties } from "@fluidframework/core-interfaces";
8
+ import { ITelemetryLoggerExt, ITelemetryLoggerPropertyBag } from "@fluidframework/telemetry-utils";
13
9
  import { ContainerWarning, IDeltaManager } from "@fluidframework/container-definitions";
14
10
  import {
15
11
  ISequencedDocumentMessage,
@@ -72,17 +68,17 @@ export interface IConnectableRuntime {
72
68
  }
73
69
 
74
70
  export interface ISummarizerRuntime extends IConnectableRuntime {
75
- readonly logger: ITelemetryLogger;
71
+ readonly logger: ITelemetryLoggerExt;
76
72
  /** clientId of parent (non-summarizing) container that owns summarizer container */
77
73
  readonly summarizerClientId: string | undefined;
78
74
  readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
79
- disposeFn?(): void;
75
+ disposeFn(): void;
80
76
  closeFn(): void;
81
- on?(
77
+ on(
82
78
  event: "op",
83
79
  listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void,
84
80
  ): this;
85
- off?(
81
+ off(
86
82
  event: "op",
87
83
  listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void,
88
84
  ): this;
@@ -107,12 +103,12 @@ export interface IRefreshSummaryAckOptions {
107
103
  /** Reference sequence number from the ack's summary op */
108
104
  readonly summaryRefSeq: number;
109
105
  /** Telemetry logger to which telemetry events will be forwarded. */
110
- readonly summaryLogger: ITelemetryLogger;
106
+ readonly summaryLogger: ITelemetryLoggerExt;
111
107
  }
112
108
 
113
109
  export interface ISubmitSummaryOptions extends ISummarizeOptions {
114
110
  /** Logger to use for correlated summary events */
115
- readonly summaryLogger: ITelemetryLogger;
111
+ readonly summaryLogger: ITelemetryLoggerExt;
116
112
  /** Tells when summary process should be cancelled */
117
113
  readonly cancellationToken: ISummaryCancellationToken;
118
114
  }
@@ -218,6 +214,13 @@ export type SubmitSummaryResult =
218
214
  | IUploadSummaryResult
219
215
  | ISubmitSummaryOpResult;
220
216
 
217
+ /** The stages of Summarize, used to describe how far progress succeeded in case of a failure at a later stage. */
218
+ export type SummaryStage = SubmitSummaryResult["stage"] | "unknown";
219
+ /** The data in summarizer result when submit summary stage fails. */
220
+ export interface SubmitSummaryFailureData {
221
+ stage: SummaryStage;
222
+ }
223
+
221
224
  export interface IBroadcastSummaryResult {
222
225
  readonly summarizeOp: ISummaryOpMessage;
223
226
  readonly broadcastDuration: number;
@@ -248,7 +251,9 @@ export type SummarizeResultPart<TSuccess, TFailure = undefined> =
248
251
 
249
252
  export interface ISummarizeResults {
250
253
  /** Resolves when we generate, upload, and submit the summary. */
251
- readonly summarySubmitted: Promise<SummarizeResultPart<SubmitSummaryResult>>;
254
+ readonly summarySubmitted: Promise<
255
+ SummarizeResultPart<SubmitSummaryResult, SubmitSummaryFailureData>
256
+ >;
252
257
  /** Resolves when we observe our summarize op broadcast. */
253
258
  readonly summaryOpBroadcasted: Promise<SummarizeResultPart<IBroadcastSummaryResult>>;
254
259
  /** Resolves when we receive a summaryAck or summaryNack. */