@fluidframework/container-runtime 2.0.0-internal.6.1.1 → 2.0.0-internal.6.3.0

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 (477) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +4 -3
  3. package/dist/batchTracker.d.ts +1 -1
  4. package/dist/batchTracker.d.ts.map +1 -1
  5. package/dist/batchTracker.js +5 -4
  6. package/dist/batchTracker.js.map +1 -1
  7. package/dist/blobManager.d.ts +4 -21
  8. package/dist/blobManager.d.ts.map +1 -1
  9. package/dist/blobManager.js +119 -185
  10. package/dist/blobManager.js.map +1 -1
  11. package/dist/connectionTelemetry.d.ts.map +1 -1
  12. package/dist/connectionTelemetry.js +13 -12
  13. package/dist/connectionTelemetry.js.map +1 -1
  14. package/dist/containerRuntime.d.ts +99 -16
  15. package/dist/containerRuntime.d.ts.map +1 -1
  16. package/dist/containerRuntime.js +380 -242
  17. package/dist/containerRuntime.js.map +1 -1
  18. package/dist/dataStore.d.ts.map +1 -1
  19. package/dist/dataStore.js +4 -5
  20. package/dist/dataStore.js.map +1 -1
  21. package/dist/dataStoreContext.d.ts +2 -1
  22. package/dist/dataStoreContext.d.ts.map +1 -1
  23. package/dist/dataStoreContext.js +40 -41
  24. package/dist/dataStoreContext.js.map +1 -1
  25. package/dist/dataStoreContexts.d.ts +1 -2
  26. package/dist/dataStoreContexts.d.ts.map +1 -1
  27. package/dist/dataStoreContexts.js +7 -8
  28. package/dist/dataStoreContexts.js.map +1 -1
  29. package/dist/dataStoreRegistry.js +2 -2
  30. package/dist/dataStoreRegistry.js.map +1 -1
  31. package/dist/dataStores.d.ts.map +1 -1
  32. package/dist/dataStores.js +23 -25
  33. package/dist/dataStores.js.map +1 -1
  34. package/dist/deltaManagerProxyBase.d.ts +1 -1
  35. package/dist/deltaManagerProxyBase.js +2 -2
  36. package/dist/deltaManagerProxyBase.js.map +1 -1
  37. package/dist/deltaScheduler.js +6 -6
  38. package/dist/deltaScheduler.js.map +1 -1
  39. package/dist/error.d.ts +14 -0
  40. package/dist/error.d.ts.map +1 -0
  41. package/dist/error.js +21 -0
  42. package/dist/error.js.map +1 -0
  43. package/dist/gc/garbageCollection.d.ts +4 -6
  44. package/dist/gc/garbageCollection.d.ts.map +1 -1
  45. package/dist/gc/garbageCollection.js +26 -25
  46. package/dist/gc/garbageCollection.js.map +1 -1
  47. package/dist/gc/gcConfigs.d.ts.map +1 -1
  48. package/dist/gc/gcConfigs.js +5 -3
  49. package/dist/gc/gcConfigs.js.map +1 -1
  50. package/dist/gc/gcDefinitions.d.ts +4 -2
  51. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  52. package/dist/gc/gcDefinitions.js.map +1 -1
  53. package/dist/gc/gcHelpers.js +7 -7
  54. package/dist/gc/gcHelpers.js.map +1 -1
  55. package/dist/gc/gcSummaryStateTracker.d.ts +4 -7
  56. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  57. package/dist/gc/gcSummaryStateTracker.js +15 -52
  58. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  59. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  60. package/dist/gc/gcTelemetry.js +2 -0
  61. package/dist/gc/gcTelemetry.js.map +1 -1
  62. package/dist/gc/gcUnreferencedStateTracker.js +4 -4
  63. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  64. package/dist/gc/index.d.ts +1 -1
  65. package/dist/gc/index.d.ts.map +1 -1
  66. package/dist/gc/index.js +1 -2
  67. package/dist/gc/index.js.map +1 -1
  68. package/dist/id-compressor/appendOnlySortedMap.d.ts +8 -30
  69. package/dist/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
  70. package/dist/id-compressor/appendOnlySortedMap.js +26 -68
  71. package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
  72. package/dist/id-compressor/finalSpace.d.ts +29 -0
  73. package/dist/id-compressor/finalSpace.d.ts.map +1 -0
  74. package/dist/id-compressor/finalSpace.js +62 -0
  75. package/dist/id-compressor/finalSpace.js.map +1 -0
  76. package/dist/id-compressor/idCompressor.d.ts +25 -250
  77. package/dist/id-compressor/idCompressor.d.ts.map +1 -1
  78. package/dist/id-compressor/idCompressor.js +387 -1150
  79. package/dist/id-compressor/idCompressor.js.map +1 -1
  80. package/dist/id-compressor/identifiers.d.ts +32 -0
  81. package/dist/id-compressor/identifiers.d.ts.map +1 -0
  82. package/dist/id-compressor/identifiers.js +15 -0
  83. package/dist/id-compressor/identifiers.js.map +1 -0
  84. package/dist/id-compressor/index.d.ts +5 -6
  85. package/dist/id-compressor/index.d.ts.map +1 -1
  86. package/dist/id-compressor/index.js +20 -26
  87. package/dist/id-compressor/index.js.map +1 -1
  88. package/dist/id-compressor/persistanceUtilities.d.ts +22 -0
  89. package/dist/id-compressor/persistanceUtilities.d.ts.map +1 -0
  90. package/dist/id-compressor/persistanceUtilities.js +43 -0
  91. package/dist/id-compressor/persistanceUtilities.js.map +1 -0
  92. package/dist/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
  93. package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
  94. package/dist/id-compressor/sessionSpaceNormalizer.js +80 -0
  95. package/dist/id-compressor/sessionSpaceNormalizer.js.map +1 -0
  96. package/dist/id-compressor/sessions.d.ts +115 -0
  97. package/dist/id-compressor/sessions.d.ts.map +1 -0
  98. package/dist/id-compressor/sessions.js +305 -0
  99. package/dist/id-compressor/sessions.js.map +1 -0
  100. package/dist/id-compressor/utilities.d.ts +49 -0
  101. package/dist/id-compressor/utilities.d.ts.map +1 -0
  102. package/dist/id-compressor/utilities.js +166 -0
  103. package/dist/id-compressor/utilities.js.map +1 -0
  104. package/dist/index.d.ts +3 -3
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.js +6 -4
  107. package/dist/index.js.map +1 -1
  108. package/dist/opLifecycle/opCompressor.js +5 -5
  109. package/dist/opLifecycle/opCompressor.js.map +1 -1
  110. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  111. package/dist/opLifecycle/opDecompressor.js +11 -10
  112. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  113. package/dist/opLifecycle/opGroupingManager.js +3 -3
  114. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  115. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  116. package/dist/opLifecycle/opSplitter.js +14 -15
  117. package/dist/opLifecycle/opSplitter.js.map +1 -1
  118. package/dist/opLifecycle/outbox.d.ts +1 -0
  119. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  120. package/dist/opLifecycle/outbox.js +16 -17
  121. package/dist/opLifecycle/outbox.js.map +1 -1
  122. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  123. package/dist/opLifecycle/remoteMessageProcessor.js +11 -5
  124. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  125. package/dist/packageVersion.d.ts +1 -1
  126. package/dist/packageVersion.js +1 -1
  127. package/dist/packageVersion.js.map +1 -1
  128. package/dist/pendingStateManager.d.ts +12 -5
  129. package/dist/pendingStateManager.d.ts.map +1 -1
  130. package/dist/pendingStateManager.js +36 -23
  131. package/dist/pendingStateManager.js.map +1 -1
  132. package/dist/scheduleManager.d.ts.map +1 -1
  133. package/dist/scheduleManager.js +23 -23
  134. package/dist/scheduleManager.js.map +1 -1
  135. package/dist/summary/index.d.ts +3 -3
  136. package/dist/summary/index.d.ts.map +1 -1
  137. package/dist/summary/index.js +2 -1
  138. package/dist/summary/index.js.map +1 -1
  139. package/dist/summary/orderedClientElection.d.ts +2 -3
  140. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  141. package/dist/summary/orderedClientElection.js +8 -8
  142. package/dist/summary/orderedClientElection.js.map +1 -1
  143. package/dist/summary/runWhileConnectedCoordinator.js +3 -3
  144. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  145. package/dist/summary/runningSummarizer.d.ts +27 -4
  146. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  147. package/dist/summary/runningSummarizer.js +246 -74
  148. package/dist/summary/runningSummarizer.js.map +1 -1
  149. package/dist/summary/summarizer.d.ts +6 -5
  150. package/dist/summary/summarizer.d.ts.map +1 -1
  151. package/dist/summary/summarizer.js +73 -69
  152. package/dist/summary/summarizer.js.map +1 -1
  153. package/dist/summary/summarizerClientElection.d.ts +2 -2
  154. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  155. package/dist/summary/summarizerClientElection.js +2 -2
  156. package/dist/summary/summarizerClientElection.js.map +1 -1
  157. package/dist/summary/summarizerHeuristics.js +2 -2
  158. package/dist/summary/summarizerHeuristics.js.map +1 -1
  159. package/dist/summary/summarizerNode/index.d.ts +1 -1
  160. package/dist/summary/summarizerNode/index.d.ts.map +1 -1
  161. package/dist/summary/summarizerNode/index.js.map +1 -1
  162. package/dist/summary/summarizerNode/summarizerNode.d.ts +5 -14
  163. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  164. package/dist/summary/summarizerNode/summarizerNode.js +32 -109
  165. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  166. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +6 -30
  167. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  168. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  169. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +0 -11
  170. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  171. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +5 -88
  172. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  173. package/dist/summary/summarizerTypes.d.ts +38 -25
  174. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  175. package/dist/summary/summarizerTypes.js.map +1 -1
  176. package/dist/summary/summaryCollection.d.ts +2 -3
  177. package/dist/summary/summaryCollection.d.ts.map +1 -1
  178. package/dist/summary/summaryCollection.js +9 -8
  179. package/dist/summary/summaryCollection.js.map +1 -1
  180. package/dist/summary/summaryFormat.js +2 -2
  181. package/dist/summary/summaryFormat.js.map +1 -1
  182. package/dist/summary/summaryGenerator.d.ts +10 -4
  183. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  184. package/dist/summary/summaryGenerator.js +52 -48
  185. package/dist/summary/summaryGenerator.js.map +1 -1
  186. package/dist/summary/summaryManager.d.ts +7 -6
  187. package/dist/summary/summaryManager.d.ts.map +1 -1
  188. package/dist/summary/summaryManager.js +30 -22
  189. package/dist/summary/summaryManager.js.map +1 -1
  190. package/lib/batchTracker.d.ts +1 -1
  191. package/lib/batchTracker.d.ts.map +1 -1
  192. package/lib/batchTracker.js +3 -2
  193. package/lib/batchTracker.js.map +1 -1
  194. package/lib/blobManager.d.ts +4 -21
  195. package/lib/blobManager.d.ts.map +1 -1
  196. package/lib/blobManager.js +91 -157
  197. package/lib/blobManager.js.map +1 -1
  198. package/lib/connectionTelemetry.d.ts.map +1 -1
  199. package/lib/connectionTelemetry.js +2 -1
  200. package/lib/connectionTelemetry.js.map +1 -1
  201. package/lib/containerRuntime.d.ts +99 -16
  202. package/lib/containerRuntime.d.ts.map +1 -1
  203. package/lib/containerRuntime.js +332 -192
  204. package/lib/containerRuntime.js.map +1 -1
  205. package/lib/dataStore.d.ts.map +1 -1
  206. package/lib/dataStore.js +2 -3
  207. package/lib/dataStore.js.map +1 -1
  208. package/lib/dataStoreContext.d.ts +2 -1
  209. package/lib/dataStoreContext.d.ts.map +1 -1
  210. package/lib/dataStoreContext.js +3 -4
  211. package/lib/dataStoreContext.js.map +1 -1
  212. package/lib/dataStoreContexts.d.ts +1 -2
  213. package/lib/dataStoreContexts.d.ts.map +1 -1
  214. package/lib/dataStoreContexts.js +1 -2
  215. package/lib/dataStoreContexts.js.map +1 -1
  216. package/lib/dataStoreRegistry.js +1 -1
  217. package/lib/dataStoreRegistry.js.map +1 -1
  218. package/lib/dataStores.d.ts.map +1 -1
  219. package/lib/dataStores.js +2 -4
  220. package/lib/dataStores.js.map +1 -1
  221. package/lib/deltaManagerProxyBase.d.ts +1 -1
  222. package/lib/deltaManagerProxyBase.js +1 -1
  223. package/lib/deltaManagerProxyBase.js.map +1 -1
  224. package/lib/deltaScheduler.js +1 -1
  225. package/lib/deltaScheduler.js.map +1 -1
  226. package/lib/error.d.ts +14 -0
  227. package/lib/error.d.ts.map +1 -0
  228. package/lib/error.js +17 -0
  229. package/lib/error.js.map +1 -0
  230. package/lib/gc/garbageCollection.d.ts +4 -6
  231. package/lib/gc/garbageCollection.d.ts.map +1 -1
  232. package/lib/gc/garbageCollection.js +26 -25
  233. package/lib/gc/garbageCollection.js.map +1 -1
  234. package/lib/gc/gcConfigs.d.ts.map +1 -1
  235. package/lib/gc/gcConfigs.js +3 -1
  236. package/lib/gc/gcConfigs.js.map +1 -1
  237. package/lib/gc/gcDefinitions.d.ts +4 -2
  238. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  239. package/lib/gc/gcDefinitions.js.map +1 -1
  240. package/lib/gc/gcHelpers.js +1 -1
  241. package/lib/gc/gcHelpers.js.map +1 -1
  242. package/lib/gc/gcSummaryStateTracker.d.ts +4 -7
  243. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  244. package/lib/gc/gcSummaryStateTracker.js +16 -53
  245. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  246. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  247. package/lib/gc/gcTelemetry.js +2 -0
  248. package/lib/gc/gcTelemetry.js.map +1 -1
  249. package/lib/gc/gcUnreferencedStateTracker.js +1 -1
  250. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  251. package/lib/gc/index.d.ts +1 -1
  252. package/lib/gc/index.d.ts.map +1 -1
  253. package/lib/gc/index.js +1 -1
  254. package/lib/gc/index.js.map +1 -1
  255. package/lib/id-compressor/appendOnlySortedMap.d.ts +8 -30
  256. package/lib/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
  257. package/lib/id-compressor/appendOnlySortedMap.js +25 -66
  258. package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
  259. package/lib/id-compressor/finalSpace.d.ts +29 -0
  260. package/lib/id-compressor/finalSpace.d.ts.map +1 -0
  261. package/lib/id-compressor/finalSpace.js +58 -0
  262. package/lib/id-compressor/finalSpace.js.map +1 -0
  263. package/lib/id-compressor/idCompressor.d.ts +25 -250
  264. package/lib/id-compressor/idCompressor.d.ts.map +1 -1
  265. package/lib/id-compressor/idCompressor.js +382 -1139
  266. package/lib/id-compressor/idCompressor.js.map +1 -1
  267. package/lib/id-compressor/identifiers.d.ts +32 -0
  268. package/lib/id-compressor/identifiers.d.ts.map +1 -0
  269. package/lib/id-compressor/identifiers.js +11 -0
  270. package/lib/id-compressor/identifiers.js.map +1 -0
  271. package/lib/id-compressor/index.d.ts +5 -6
  272. package/lib/id-compressor/index.d.ts.map +1 -1
  273. package/lib/id-compressor/index.js +5 -6
  274. package/lib/id-compressor/index.js.map +1 -1
  275. package/lib/id-compressor/persistanceUtilities.d.ts +22 -0
  276. package/lib/id-compressor/persistanceUtilities.d.ts.map +1 -0
  277. package/lib/id-compressor/persistanceUtilities.js +34 -0
  278. package/lib/id-compressor/persistanceUtilities.js.map +1 -0
  279. package/lib/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
  280. package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
  281. package/lib/id-compressor/sessionSpaceNormalizer.js +76 -0
  282. package/lib/id-compressor/sessionSpaceNormalizer.js.map +1 -0
  283. package/lib/id-compressor/sessions.d.ts +115 -0
  284. package/lib/id-compressor/sessions.d.ts.map +1 -0
  285. package/lib/id-compressor/sessions.js +290 -0
  286. package/lib/id-compressor/sessions.js.map +1 -0
  287. package/lib/id-compressor/utilities.d.ts +49 -0
  288. package/lib/id-compressor/utilities.d.ts.map +1 -0
  289. package/lib/id-compressor/utilities.js +148 -0
  290. package/lib/id-compressor/utilities.js.map +1 -0
  291. package/lib/index.d.ts +3 -3
  292. package/lib/index.d.ts.map +1 -1
  293. package/lib/index.js +2 -2
  294. package/lib/index.js.map +1 -1
  295. package/lib/opLifecycle/opCompressor.js +3 -3
  296. package/lib/opLifecycle/opCompressor.js.map +1 -1
  297. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  298. package/lib/opLifecycle/opDecompressor.js +2 -1
  299. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  300. package/lib/opLifecycle/opGroupingManager.js +1 -1
  301. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  302. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  303. package/lib/opLifecycle/opSplitter.js +2 -3
  304. package/lib/opLifecycle/opSplitter.js.map +1 -1
  305. package/lib/opLifecycle/outbox.d.ts +1 -0
  306. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  307. package/lib/opLifecycle/outbox.js +7 -8
  308. package/lib/opLifecycle/outbox.js.map +1 -1
  309. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  310. package/lib/opLifecycle/remoteMessageProcessor.js +12 -6
  311. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  312. package/lib/packageVersion.d.ts +1 -1
  313. package/lib/packageVersion.js +1 -1
  314. package/lib/packageVersion.js.map +1 -1
  315. package/lib/pendingStateManager.d.ts +12 -5
  316. package/lib/pendingStateManager.d.ts.map +1 -1
  317. package/lib/pendingStateManager.js +21 -8
  318. package/lib/pendingStateManager.js.map +1 -1
  319. package/lib/scheduleManager.d.ts.map +1 -1
  320. package/lib/scheduleManager.js +3 -3
  321. package/lib/scheduleManager.js.map +1 -1
  322. package/lib/summary/index.d.ts +3 -3
  323. package/lib/summary/index.d.ts.map +1 -1
  324. package/lib/summary/index.js +1 -1
  325. package/lib/summary/index.js.map +1 -1
  326. package/lib/summary/orderedClientElection.d.ts +2 -3
  327. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  328. package/lib/summary/orderedClientElection.js +3 -3
  329. package/lib/summary/orderedClientElection.js.map +1 -1
  330. package/lib/summary/runWhileConnectedCoordinator.js +1 -1
  331. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  332. package/lib/summary/runningSummarizer.d.ts +27 -4
  333. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  334. package/lib/summary/runningSummarizer.js +240 -68
  335. package/lib/summary/runningSummarizer.js.map +1 -1
  336. package/lib/summary/summarizer.d.ts +6 -5
  337. package/lib/summary/summarizer.d.ts.map +1 -1
  338. package/lib/summary/summarizer.js +69 -65
  339. package/lib/summary/summarizer.js.map +1 -1
  340. package/lib/summary/summarizerClientElection.d.ts +2 -2
  341. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  342. package/lib/summary/summarizerClientElection.js +1 -1
  343. package/lib/summary/summarizerClientElection.js.map +1 -1
  344. package/lib/summary/summarizerHeuristics.js +1 -1
  345. package/lib/summary/summarizerHeuristics.js.map +1 -1
  346. package/lib/summary/summarizerNode/index.d.ts +1 -1
  347. package/lib/summary/summarizerNode/index.d.ts.map +1 -1
  348. package/lib/summary/summarizerNode/index.js.map +1 -1
  349. package/lib/summary/summarizerNode/summarizerNode.d.ts +5 -14
  350. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  351. package/lib/summary/summarizerNode/summarizerNode.js +16 -93
  352. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  353. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +6 -30
  354. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  355. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  356. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +0 -11
  357. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  358. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +3 -86
  359. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  360. package/lib/summary/summarizerTypes.d.ts +38 -25
  361. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  362. package/lib/summary/summarizerTypes.js.map +1 -1
  363. package/lib/summary/summaryCollection.d.ts +2 -3
  364. package/lib/summary/summaryCollection.d.ts.map +1 -1
  365. package/lib/summary/summaryCollection.js +2 -1
  366. package/lib/summary/summaryCollection.js.map +1 -1
  367. package/lib/summary/summaryFormat.js +1 -1
  368. package/lib/summary/summaryFormat.js.map +1 -1
  369. package/lib/summary/summaryGenerator.d.ts +10 -4
  370. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  371. package/lib/summary/summaryGenerator.js +46 -42
  372. package/lib/summary/summaryGenerator.js.map +1 -1
  373. package/lib/summary/summaryManager.d.ts +7 -6
  374. package/lib/summary/summaryManager.d.ts.map +1 -1
  375. package/lib/summary/summaryManager.js +26 -18
  376. package/lib/summary/summaryManager.js.map +1 -1
  377. package/package.json +30 -29
  378. package/src/batchTracker.ts +3 -2
  379. package/src/blobManager.ts +105 -185
  380. package/src/connectionTelemetry.ts +2 -1
  381. package/src/containerRuntime.ts +481 -267
  382. package/src/dataStore.ts +2 -3
  383. package/src/dataStoreContext.ts +5 -8
  384. package/src/dataStoreContexts.ts +2 -4
  385. package/src/dataStoreRegistry.ts +1 -1
  386. package/src/dataStores.ts +4 -7
  387. package/src/deltaManagerProxyBase.ts +1 -1
  388. package/src/deltaScheduler.ts +1 -1
  389. package/src/error.ts +18 -0
  390. package/src/gc/garbageCollection.ts +39 -41
  391. package/src/gc/gcConfigs.ts +4 -2
  392. package/src/gc/gcDefinitions.ts +4 -6
  393. package/src/gc/gcHelpers.ts +1 -1
  394. package/src/gc/gcSummaryStateTracker.ts +19 -65
  395. package/src/gc/gcTelemetry.ts +2 -0
  396. package/src/gc/gcUnreferencedStateTracker.ts +1 -1
  397. package/src/gc/index.ts +0 -1
  398. package/src/id-compressor/appendOnlySortedMap.ts +26 -87
  399. package/src/id-compressor/finalSpace.ts +67 -0
  400. package/src/id-compressor/idCompressor.ts +456 -1681
  401. package/src/id-compressor/identifiers.ts +42 -0
  402. package/src/id-compressor/index.ts +11 -20
  403. package/src/id-compressor/persistanceUtilities.ts +58 -0
  404. package/src/id-compressor/sessionSpaceNormalizer.ts +83 -0
  405. package/src/id-compressor/sessions.ts +405 -0
  406. package/src/id-compressor/utilities.ts +187 -0
  407. package/src/index.ts +7 -1
  408. package/src/opLifecycle/opCompressor.ts +3 -3
  409. package/src/opLifecycle/opDecompressor.ts +2 -1
  410. package/src/opLifecycle/opGroupingManager.ts +1 -1
  411. package/src/opLifecycle/opSplitter.ts +4 -4
  412. package/src/opLifecycle/outbox.ts +14 -11
  413. package/src/opLifecycle/remoteMessageProcessor.ts +19 -6
  414. package/src/packageVersion.ts +1 -1
  415. package/src/pendingStateManager.ts +50 -29
  416. package/src/scheduleManager.ts +6 -4
  417. package/src/summary/index.ts +4 -3
  418. package/src/summary/orderedClientElection.ts +8 -5
  419. package/src/summary/runWhileConnectedCoordinator.ts +1 -1
  420. package/src/summary/runningSummarizer.ts +273 -97
  421. package/src/summary/summarizer.ts +23 -12
  422. package/src/summary/summarizerClientElection.ts +2 -2
  423. package/src/summary/summarizerHeuristics.ts +1 -1
  424. package/src/summary/summarizerNode/index.ts +1 -2
  425. package/src/summary/summarizerNode/summarizerNode.ts +23 -145
  426. package/src/summary/summarizerNode/summarizerNodeUtils.ts +7 -38
  427. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +3 -123
  428. package/src/summary/summarizerTypes.ts +40 -25
  429. package/src/summary/summaryCollection.ts +3 -3
  430. package/src/summary/summaryFormat.ts +1 -1
  431. package/src/summary/summaryGenerator.ts +52 -55
  432. package/src/summary/summaryManager.ts +36 -13
  433. package/dist/id-compressor/idRange.d.ts +0 -11
  434. package/dist/id-compressor/idRange.d.ts.map +0 -1
  435. package/dist/id-compressor/idRange.js +0 -29
  436. package/dist/id-compressor/idRange.js.map +0 -1
  437. package/dist/id-compressor/numericUuid.d.ts +0 -59
  438. package/dist/id-compressor/numericUuid.d.ts.map +0 -1
  439. package/dist/id-compressor/numericUuid.js +0 -325
  440. package/dist/id-compressor/numericUuid.js.map +0 -1
  441. package/dist/id-compressor/sessionIdNormalizer.d.ts +0 -138
  442. package/dist/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
  443. package/dist/id-compressor/sessionIdNormalizer.js +0 -483
  444. package/dist/id-compressor/sessionIdNormalizer.js.map +0 -1
  445. package/dist/id-compressor/utils.d.ts +0 -57
  446. package/dist/id-compressor/utils.d.ts.map +0 -1
  447. package/dist/id-compressor/utils.js +0 -90
  448. package/dist/id-compressor/utils.js.map +0 -1
  449. package/dist/id-compressor/uuidUtilities.d.ts +0 -28
  450. package/dist/id-compressor/uuidUtilities.d.ts.map +0 -1
  451. package/dist/id-compressor/uuidUtilities.js +0 -104
  452. package/dist/id-compressor/uuidUtilities.js.map +0 -1
  453. package/lib/id-compressor/idRange.d.ts +0 -11
  454. package/lib/id-compressor/idRange.d.ts.map +0 -1
  455. package/lib/id-compressor/idRange.js +0 -25
  456. package/lib/id-compressor/idRange.js.map +0 -1
  457. package/lib/id-compressor/numericUuid.d.ts +0 -59
  458. package/lib/id-compressor/numericUuid.d.ts.map +0 -1
  459. package/lib/id-compressor/numericUuid.js +0 -315
  460. package/lib/id-compressor/numericUuid.js.map +0 -1
  461. package/lib/id-compressor/sessionIdNormalizer.d.ts +0 -138
  462. package/lib/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
  463. package/lib/id-compressor/sessionIdNormalizer.js +0 -479
  464. package/lib/id-compressor/sessionIdNormalizer.js.map +0 -1
  465. package/lib/id-compressor/utils.d.ts +0 -57
  466. package/lib/id-compressor/utils.d.ts.map +0 -1
  467. package/lib/id-compressor/utils.js +0 -79
  468. package/lib/id-compressor/utils.js.map +0 -1
  469. package/lib/id-compressor/uuidUtilities.d.ts +0 -28
  470. package/lib/id-compressor/uuidUtilities.d.ts.map +0 -1
  471. package/lib/id-compressor/uuidUtilities.js +0 -96
  472. package/lib/id-compressor/uuidUtilities.js.map +0 -1
  473. package/src/id-compressor/idRange.ts +0 -35
  474. package/src/id-compressor/numericUuid.ts +0 -383
  475. package/src/id-compressor/sessionIdNormalizer.ts +0 -609
  476. package/src/id-compressor/utils.ts +0 -114
  477. package/src/id-compressor/uuidUtilities.ts +0 -120
@@ -29,22 +29,16 @@ import {
29
29
  TelemetryDataTag,
30
30
  tagCodeArtifacts,
31
31
  } from "@fluidframework/telemetry-utils";
32
- import { assert, unreachableCase } from "@fluidframework/common-utils";
33
- import {
34
- convertToSummaryTree,
35
- calculateStats,
36
- mergeStats,
37
- ReadAndParseBlob,
38
- } from "@fluidframework/runtime-utils";
32
+ import { assert, unreachableCase } from "@fluidframework/core-utils";
33
+ import { convertToSummaryTree, calculateStats, mergeStats } from "@fluidframework/runtime-utils";
39
34
  import {
40
35
  EscapedPath,
41
36
  ICreateChildDetails,
42
- IFetchSnapshotResult,
43
37
  IInitialSummary,
38
+ IRefreshSummaryResult,
44
39
  ISummarizerNodeRootContract,
45
40
  parseSummaryForSubtrees,
46
41
  parseSummaryTreeForSubtrees,
47
- RefreshSummaryResult,
48
42
  SummaryNode,
49
43
  ValidateSummaryResult,
50
44
  } from "./summarizerNodeUtils";
@@ -371,31 +365,21 @@ export class SummarizerNode implements IRootSummarizerNode {
371
365
 
372
366
  /**
373
367
  * Refreshes the latest summary tracked by this node. If we have a pending summary for the given proposal handle,
374
- * it becomes the latest summary. If the current summary is already ahead (e.g., loaded from a service summary),
375
- * we skip the update. Otherwise, we fetch the latest snapshot and update latest summary based off of that.
376
- *
377
- * @returns A RefreshSummaryResult type which returns information based on the following three scenarios:
378
- *
379
- * 1. The latest summary was not updated.
368
+ * it becomes the latest summary. If the current summary is already ahead, we skip the update.
369
+ * If the current summary is behind, then we do not refresh.
380
370
  *
381
- * 2. The latest summary was updated and the summary corresponding to the params was being tracked.
382
- *
383
- * 3. The latest summary was updated but the summary corresponding to the params was not tracked. In this
384
- * case, the latest summary is updated based on the downloaded snapshot which is also returned.
371
+ * @returns true if the summary is tracked by this node, false otherwise.
385
372
  */
386
373
  public async refreshLatestSummary(
387
- proposalHandle: string | undefined,
374
+ proposalHandle: string,
388
375
  summaryRefSeq: number,
389
- fetchLatestSnapshot: () => Promise<IFetchSnapshotResult>,
390
- readAndParseBlob: ReadAndParseBlob,
391
- correlatedSummaryLogger: ITelemetryLoggerExt,
392
- ): Promise<RefreshSummaryResult> {
376
+ ): Promise<IRefreshSummaryResult> {
393
377
  const eventProps: {
394
378
  proposalHandle: string | undefined;
395
379
  summaryRefSeq: number;
396
380
  referenceSequenceNumber: number;
397
- latestSummaryUpdated?: boolean;
398
- wasSummaryTracked?: boolean;
381
+ isSummaryTracked?: boolean;
382
+ pendingSummaryFound?: boolean;
399
383
  } = {
400
384
  proposalHandle,
401
385
  summaryRefSeq,
@@ -416,75 +400,22 @@ export class SummarizerNode implements IRootSummarizerNode {
416
400
  });
417
401
  }
418
402
 
419
- if (proposalHandle !== undefined) {
420
- const maybeSummaryNode = this.pendingSummaries.get(proposalHandle);
403
+ let isSummaryTracked = false;
404
+ let isSummaryNewer = false;
421
405
 
422
- if (maybeSummaryNode !== undefined) {
423
- this.refreshLatestSummaryFromPending(
424
- proposalHandle,
425
- maybeSummaryNode.referenceSequenceNumber,
426
- );
427
- eventProps.wasSummaryTracked = true;
428
- eventProps.latestSummaryUpdated = true;
429
- event.end(eventProps);
430
- return {
431
- latestSummaryUpdated: true,
432
- wasSummaryTracked: true,
433
- summaryRefSeq,
434
- };
435
- }
436
-
437
- const props = {
438
- summaryRefSeq,
439
- pendingSize: this.pendingSummaries.size ?? undefined,
440
- };
441
- this.logger.sendTelemetryEvent({
442
- eventName: "PendingSummaryNotFound",
443
- proposalHandle,
444
- referenceSequenceNumber: this.referenceSequenceNumber,
445
- details: JSON.stringify(props),
446
- });
406
+ if (summaryRefSeq > this.referenceSequenceNumber) {
407
+ isSummaryNewer = true;
447
408
  }
448
-
449
- // If the summary for which refresh is called is older than the latest tracked summary, ignore it.
450
- if (this.referenceSequenceNumber >= summaryRefSeq) {
451
- eventProps.latestSummaryUpdated = false;
452
- event.end(eventProps);
453
- return { latestSummaryUpdated: false };
454
- }
455
-
456
- // Fetch the latest snapshot and refresh state from it. Note that we need to use the reference sequence number
457
- // of the fetched snapshot and not the "summaryRefSeq" that was passed in.
458
- const { snapshotTree, snapshotRefSeq: fetchedSnapshotRefSeq } =
459
- await fetchLatestSnapshot();
460
-
461
- // Possible re-entrancy. We may have updated latest summary state while fetching the snapshot. If the fetched
462
- // snapshot is older than the latest tracked summary, ignore it.
463
- if (this.referenceSequenceNumber >= fetchedSnapshotRefSeq) {
464
- eventProps.latestSummaryUpdated = false;
465
- event.end(eventProps);
466
- return { latestSummaryUpdated: false };
409
+ const maybeSummaryNode = this.pendingSummaries.get(proposalHandle);
410
+ if (maybeSummaryNode !== undefined) {
411
+ this.refreshLatestSummaryFromPending(
412
+ proposalHandle,
413
+ maybeSummaryNode.referenceSequenceNumber,
414
+ );
415
+ isSummaryTracked = true;
467
416
  }
468
-
469
- await this.refreshLatestSummaryFromSnapshot(
470
- fetchedSnapshotRefSeq,
471
- snapshotTree,
472
- undefined,
473
- EscapedPath.create(""),
474
- correlatedSummaryLogger,
475
- readAndParseBlob,
476
- );
477
-
478
- eventProps.latestSummaryUpdated = true;
479
- eventProps.wasSummaryTracked = false;
480
- eventProps.summaryRefSeq = fetchedSnapshotRefSeq;
481
- event.end(eventProps);
482
- return {
483
- latestSummaryUpdated: true,
484
- wasSummaryTracked: false,
485
- snapshotTree,
486
- summaryRefSeq: fetchedSnapshotRefSeq,
487
- };
417
+ event.end({ ...eventProps, isSummaryNewer, pendingSummaryFound: isSummaryTracked });
418
+ return { isSummaryTracked, isSummaryNewer };
488
419
  },
489
420
  { start: true, end: true, cancel: "error" },
490
421
  );
@@ -526,59 +457,6 @@ export class SummarizerNode implements IRootSummarizerNode {
526
457
  }
527
458
  }
528
459
 
529
- protected async refreshLatestSummaryFromSnapshot(
530
- referenceSequenceNumber: number,
531
- snapshotTree: ISnapshotTree,
532
- basePath: EscapedPath | undefined,
533
- localPath: EscapedPath,
534
- correlatedSummaryLogger: ITelemetryLoggerExt,
535
- readAndParseBlob: ReadAndParseBlob,
536
- ): Promise<void> {
537
- // Possible re-entrancy. If we have already seen a summary later than this one, ignore it.
538
- if (this.referenceSequenceNumber >= referenceSequenceNumber) {
539
- return;
540
- }
541
-
542
- this.refreshLatestSummaryCore(referenceSequenceNumber);
543
-
544
- this._latestSummary = new SummaryNode({
545
- referenceSequenceNumber,
546
- basePath,
547
- localPath,
548
- });
549
-
550
- const pathParts: string[] = [];
551
- const { childrenTree, childrenPathPart } = parseSummaryForSubtrees(snapshotTree);
552
- if (childrenPathPart !== undefined) {
553
- pathParts.push(childrenPathPart);
554
- }
555
-
556
- if (pathParts.length > 0) {
557
- this._latestSummary.additionalPath = EscapedPath.createAndConcat(pathParts);
558
- }
559
-
560
- // Propagate update to all child nodes
561
- const pathForChildren = this._latestSummary.fullPathForChildren;
562
- await Promise.all(
563
- Array.from(this.children)
564
- .filter(([id]) => {
565
- // Assuming subtrees missing from snapshot are newer than the snapshot,
566
- // but might be nice to assert this using earliest seq for node.
567
- return childrenTree.trees[id] !== undefined;
568
- })
569
- .map(async ([id, child]) => {
570
- return child.refreshLatestSummaryFromSnapshot(
571
- referenceSequenceNumber,
572
- childrenTree.trees[id],
573
- pathForChildren,
574
- EscapedPath.create(id),
575
- correlatedSummaryLogger,
576
- readAndParseBlob,
577
- );
578
- }),
579
- );
580
- }
581
-
582
460
  private refreshLatestSummaryCore(referenceSequenceNumber: number): void {
583
461
  for (const [key, value] of this.pendingSummaries) {
584
462
  if (value.referenceSequenceNumber < referenceSequenceNumber) {
@@ -6,40 +6,12 @@
6
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
- import { ReadAndParseBlob } from "@fluidframework/runtime-utils";
10
9
 
11
- /**
12
- * Return type of refreshSummaryAck function. There can be three different scenarios based on the passed params:
13
- *
14
- * 1. The latest summary was not updated.
15
- *
16
- * 2. The latest summary was updated and the summary corresponding to the params was tracked by this client.
17
- *
18
- * 3. The latest summary was updated but the summary corresponding to the params was not tracked. In this case, the
19
- * latest snapshot is fetched and the latest summary state is updated based on it.
20
- */
21
- export type RefreshSummaryResult =
22
- | {
23
- latestSummaryUpdated: false;
24
- }
25
- | {
26
- latestSummaryUpdated: true;
27
- wasSummaryTracked: true;
28
- summaryRefSeq: number;
29
- }
30
- | {
31
- latestSummaryUpdated: true;
32
- wasSummaryTracked: false;
33
- snapshotTree: ISnapshotTree;
34
- summaryRefSeq: number;
35
- };
36
-
37
- /**
38
- * Result of snapshot fetch during refreshing latest summary state.
39
- */
40
- export interface IFetchSnapshotResult {
41
- snapshotTree: ISnapshotTree;
42
- snapshotRefSeq: number;
10
+ export interface IRefreshSummaryResult {
11
+ /** Tells whether this summary is tracked by this client. */
12
+ isSummaryTracked: boolean;
13
+ /** Tells whether this summary is newer than the latest one tracked by this client. */
14
+ isSummaryNewer: boolean;
43
15
  }
44
16
 
45
17
  /**
@@ -70,12 +42,9 @@ export interface ISummarizerNodeRootContract {
70
42
  completeSummary(proposalHandle: string, validate: boolean): void;
71
43
  clearSummary(): void;
72
44
  refreshLatestSummary(
73
- proposalHandle: string | undefined,
45
+ proposalHandle: string,
74
46
  summaryRefSeq: number,
75
- fetchLatestSnapshot: () => Promise<IFetchSnapshotResult>,
76
- readAndParseBlob: ReadAndParseBlob,
77
- correlatedSummaryLogger: ITelemetryLoggerExt,
78
- ): Promise<RefreshSummaryResult>;
47
+ ): Promise<IRefreshSummaryResult>;
79
48
  }
80
49
 
81
50
  /** Path for nodes in a tree with escaped special characters */
@@ -9,12 +9,9 @@ import {
9
9
  TelemetryDataTag,
10
10
  tagCodeArtifacts,
11
11
  } from "@fluidframework/telemetry-utils";
12
- import { assert } from "@fluidframework/common-utils";
13
- import { LazyPromise } from "@fluidframework/core-utils";
14
- import { ISnapshotTree } from "@fluidframework/protocol-definitions";
12
+ import { assert, LazyPromise } from "@fluidframework/core-utils";
15
13
  import {
16
14
  CreateChildSummarizerNodeParam,
17
- gcTreeKey,
18
15
  IGarbageCollectionData,
19
16
  IGarbageCollectionDetailsBase,
20
17
  ISummarizeInternalResult,
@@ -25,21 +22,15 @@ import {
25
22
  ITelemetryContext,
26
23
  IExperimentalIncrementalSummaryContext,
27
24
  } from "@fluidframework/runtime-definitions";
28
- import { ReadAndParseBlob, unpackChildNodesUsedRoutes } from "@fluidframework/runtime-utils";
25
+ import { unpackChildNodesUsedRoutes } from "@fluidframework/runtime-utils";
29
26
  import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
30
- import {
31
- cloneGCData,
32
- getGCDataFromSnapshot,
33
- runGarbageCollection,
34
- unpackChildNodesGCDetails,
35
- } from "../../gc";
27
+ import { cloneGCData, unpackChildNodesGCDetails } from "../../gc";
36
28
  import { SummarizerNode } from "./summarizerNode";
37
29
  import {
38
30
  EscapedPath,
39
31
  ICreateChildDetails,
40
32
  IInitialSummary,
41
33
  ISummarizerNodeRootContract,
42
- parseSummaryForSubtrees,
43
34
  SummaryNode,
44
35
  ValidateSummaryResult,
45
36
  } from "./summarizerNodeUtils";
@@ -391,117 +382,6 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
391
382
  return super.refreshLatestSummaryFromPending(proposalHandle, referenceSequenceNumber);
392
383
  }
393
384
 
394
- /**
395
- * Called when we need to upload the reference state from the given summary.
396
- */
397
- protected async refreshLatestSummaryFromSnapshot(
398
- referenceSequenceNumber: number,
399
- snapshotTree: ISnapshotTree,
400
- basePath: EscapedPath | undefined,
401
- localPath: EscapedPath,
402
- correlatedSummaryLogger: ITelemetryLoggerExt,
403
- readAndParseBlob: ReadAndParseBlob,
404
- ): Promise<void> {
405
- await this.refreshGCStateFromSnapshot(
406
- referenceSequenceNumber,
407
- snapshotTree,
408
- readAndParseBlob,
409
- );
410
- return super.refreshLatestSummaryFromSnapshot(
411
- referenceSequenceNumber,
412
- snapshotTree,
413
- basePath,
414
- localPath,
415
- correlatedSummaryLogger,
416
- readAndParseBlob,
417
- );
418
- }
419
-
420
- /**
421
- * Updates GC state from the given snapshot if GC is enabled and the snapshot is newer than the one this node
422
- * is tracking.
423
- */
424
- private async refreshGCStateFromSnapshot(
425
- referenceSequenceNumber: number,
426
- snapshotTree: ISnapshotTree,
427
- readAndParseBlob: ReadAndParseBlob,
428
- ): Promise<void> {
429
- // If GC is disabled or we have seen a newer summary, skip updating GC state.
430
- if (this.gcDisabled || this.referenceSequenceNumber >= referenceSequenceNumber) {
431
- return;
432
- }
433
-
434
- // Load the base GC details before proceeding because if that happens later it can overwrite the GC details
435
- // written by the following code.
436
- await this.loadBaseGCDetails();
437
-
438
- // Possible re-entrancy. We may already have processed this while loading base GC details.
439
- if (this.referenceSequenceNumber >= referenceSequenceNumber) {
440
- return;
441
- }
442
-
443
- /**
444
- * GC data is written at root of the snapshot tree under "gc" sub-tree. This data needs to be propagated to
445
- * all the nodes in the container.
446
- * The root summarizer node reads the GC data from the "gc" sub-tree, runs GC on it to get used routes in
447
- * the container and updates its GC data and referenced used routes. It then gets the GC data and used
448
- * routes of all its children and adds it to their snapshot tree.
449
- * All the other nodes gets the GC data and used routes from their snapshot tree and updates their state.
450
- * They get the GC data and used routes of their children and add it to their snapshot tree and so on.
451
- *
452
- * Note that if the snapshot does not have GC tree, GC data will be set to undefined and used routes will be
453
- * set to self-route (meaning referenced) for all nodes. This is important because the GC data needs to be
454
- * regenerated in the next summary.
455
- */
456
- let gcDetails: IGarbageCollectionDetailsBase | undefined;
457
- const gcSnapshotTree = snapshotTree.trees[gcTreeKey];
458
- if (gcSnapshotTree !== undefined) {
459
- // If there is a GC tree in the snapshot, this is the root summarizer node. Read GC data from the tree
460
- // process it as explained above.
461
- const gcSnapshotData = await getGCDataFromSnapshot(gcSnapshotTree, readAndParseBlob);
462
-
463
- if (gcSnapshotData.gcState !== undefined) {
464
- const gcNodes: { [id: string]: string[] } = {};
465
- for (const [nodeId, nodeData] of Object.entries(gcSnapshotData.gcState.gcNodes)) {
466
- gcNodes[nodeId] = Array.from(nodeData.outboundRoutes);
467
- }
468
- // Run GC on the nodes in the snapshot to get the used routes for each node in the container.
469
- const usedRoutes = runGarbageCollection(gcNodes, ["/"]).referencedNodeIds;
470
- gcDetails = { gcData: { gcNodes }, usedRoutes };
471
- }
472
- } else {
473
- // If there is a GC blob in the snapshot, it's a non-root summarizer nodes - The root summarizer node
474
- // writes GC blob in the snapshot of child nodes. Get GC data and used routes from the blob.
475
- const gcDetailsBlob = snapshotTree.blobs[gcTreeKey];
476
- if (gcDetailsBlob !== undefined) {
477
- gcDetails = JSON.parse(gcDetailsBlob) as IGarbageCollectionDetailsBase;
478
- }
479
- }
480
-
481
- // Update this node to the same GC state it was when the ack corresponding to this summary was processed.
482
- this.gcData = gcDetails?.gcData !== undefined ? cloneGCData(gcDetails.gcData) : undefined;
483
- this.referenceUsedRoutes =
484
- gcDetails?.usedRoutes !== undefined ? Array.from(gcDetails.usedRoutes) : undefined;
485
- // If there are no used routes in the GC details, set it to have self route which will make the node
486
- // referenced. This scenario can only happen if the snapshot is from a client where GC was not run or
487
- // disabled. In both the cases, the node should be referenced.
488
- this.usedRoutes =
489
- gcDetails?.usedRoutes !== undefined ? Array.from(gcDetails.usedRoutes) : [""];
490
-
491
- if (gcDetails === undefined) {
492
- return;
493
- }
494
-
495
- // Generate the GC data and used routes of children GC nodes and add it to their snapshot tree.
496
- const gcDetailsMap = unpackChildNodesGCDetails(gcDetails);
497
- const { childrenTree } = parseSummaryForSubtrees(snapshotTree);
498
- gcDetailsMap.forEach((childGCDetails: IGarbageCollectionDetailsBase, childId: string) => {
499
- if (childrenTree.trees[childId] !== undefined) {
500
- childrenTree.trees[childId].blobs[gcTreeKey] = JSON.stringify(childGCDetails);
501
- }
502
- });
503
- }
504
-
505
385
  /**
506
386
  * Override the createChild method to return an instance of SummarizerNodeWithGC.
507
387
  */
@@ -3,8 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { IEvent, IEventProvider } from "@fluidframework/common-definitions";
7
- import { ITelemetryProperties } from "@fluidframework/core-interfaces";
6
+ import { IEvent, IEventProvider, ITelemetryProperties } from "@fluidframework/core-interfaces";
8
7
  import { ITelemetryLoggerExt, ITelemetryLoggerPropertyBag } from "@fluidframework/telemetry-utils";
9
8
  import { ContainerWarning, IDeltaManager } from "@fluidframework/container-definitions";
10
9
  import {
@@ -34,6 +33,20 @@ export interface ICancellationToken<T> {
34
33
  /* Similar to AbortSignal, but using promise instead of events */
35
34
  export type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;
36
35
 
36
+ /**
37
+ * Data required to update internal tracking state after receiving a Summary Ack.
38
+ */
39
+ export interface IRefreshSummaryAckOptions {
40
+ /** Handle from the ack's summary op. */
41
+ readonly proposalHandle: string | undefined;
42
+ /** Handle from the summary ack just received */
43
+ readonly ackHandle: string;
44
+ /** Reference sequence number from the ack's summary op */
45
+ readonly summaryRefSeq: number;
46
+ /** Telemetry logger to which telemetry events will be forwarded. */
47
+ readonly summaryLogger: ITelemetryLoggerExt;
48
+ }
49
+
37
50
  export interface ISummarizerInternalsProvider {
38
51
  /** Encapsulates the work to walk the internals of the running container to generate a summary */
39
52
  submitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;
@@ -88,29 +101,21 @@ export interface ISummarizerRuntime extends IConnectableRuntime {
88
101
  export interface ISummarizeOptions {
89
102
  /** True to generate the full tree with no handle reuse optimizations; defaults to false */
90
103
  readonly fullTree?: boolean;
91
- /** True to ask the server what the latest summary is first; defaults to false */
104
+ /**
105
+ * True to ask the server what the latest summary is first; defaults to false
106
+ *
107
+ * @deprecated - Summarize will not refresh latest snapshot state anymore.
108
+ */
92
109
  readonly refreshLatestAck?: boolean;
93
110
  }
94
111
 
95
- /**
96
- * Data required to update internal tracking state after receiving a Summary Ack.
97
- */
98
- export interface IRefreshSummaryAckOptions {
99
- /** Handle from the ack's summary op. */
100
- readonly proposalHandle: string | undefined;
101
- /** Handle from the summary ack just received */
102
- readonly ackHandle: string;
103
- /** Reference sequence number from the ack's summary op */
104
- readonly summaryRefSeq: number;
105
- /** Telemetry logger to which telemetry events will be forwarded. */
106
- readonly summaryLogger: ITelemetryLoggerExt;
107
- }
108
-
109
112
  export interface ISubmitSummaryOptions extends ISummarizeOptions {
110
113
  /** Logger to use for correlated summary events */
111
114
  readonly summaryLogger: ITelemetryLoggerExt;
112
115
  /** Tells when summary process should be cancelled */
113
116
  readonly cancellationToken: ISummaryCancellationToken;
117
+ /** Summarization may be attempted multiple times. This tells whether this is the final summarization attempt. */
118
+ readonly finalAttempt?: boolean;
114
119
  }
115
120
 
116
121
  export interface IOnDemandSummarizeOptions extends ISummarizeOptions {
@@ -216,8 +221,14 @@ export type SubmitSummaryResult =
216
221
 
217
222
  /** The stages of Summarize, used to describe how far progress succeeded in case of a failure at a later stage. */
218
223
  export type SummaryStage = SubmitSummaryResult["stage"] | "unknown";
224
+
225
+ /** Type for summarization failures that are retriable. */
226
+ export interface IRetriableFailureResult {
227
+ readonly retryAfterSeconds?: number;
228
+ }
229
+
219
230
  /** The data in summarizer result when submit summary stage fails. */
220
- export interface SubmitSummaryFailureData {
231
+ export interface SubmitSummaryFailureData extends IRetriableFailureResult {
221
232
  stage: SummaryStage;
222
233
  }
223
234
 
@@ -231,7 +242,7 @@ export interface IAckSummaryResult {
231
242
  readonly ackNackDuration: number;
232
243
  }
233
244
 
234
- export interface INackSummaryResult {
245
+ export interface INackSummaryResult extends IRetriableFailureResult {
235
246
  readonly summaryNackOp: ISummaryNackMessage;
236
247
  readonly ackNackDuration: number;
237
248
  }
@@ -246,7 +257,6 @@ export type SummarizeResultPart<TSuccess, TFailure = undefined> =
246
257
  data: TFailure | undefined;
247
258
  message: string;
248
259
  error: any;
249
- retryAfterSeconds?: number;
250
260
  };
251
261
 
252
262
  export interface ISummarizeResults {
@@ -315,11 +325,14 @@ export type SummarizerStopReason =
315
325
  */
316
326
  | "latestSummaryStateStale";
317
327
 
328
+ export interface ISummarizeEventProps {
329
+ result: "success" | "failure" | "canceled";
330
+ currentAttempt: number;
331
+ maxAttempts: number;
332
+ error?: any;
333
+ }
318
334
  export interface ISummarizerEvents extends IEvent {
319
- /**
320
- * An event indicating that the Summarizer is having problems summarizing
321
- */
322
- (event: "summarizingError", listener: (error: ISummarizingWarning) => void);
335
+ (event: "summarize", listener: (props: ISummarizeEventProps) => void);
323
336
  }
324
337
 
325
338
  export interface ISummarizer extends IEventProvider<ISummarizerEvents> {
@@ -437,7 +450,7 @@ export interface ISummarizeHeuristicRunner {
437
450
 
438
451
  type ISummarizeTelemetryRequiredProperties =
439
452
  /** Reason code for attempting to summarize */
440
- "reason";
453
+ "summarizeReason";
441
454
 
442
455
  type ISummarizeTelemetryOptionalProperties =
443
456
  /** Number of attempts within the last time window, used for calculating the throttle delay. */
@@ -446,6 +459,8 @@ type ISummarizeTelemetryOptionalProperties =
446
459
  | "summaryAttemptsPerPhase"
447
460
  /** One-based count of phases we've attempted (used to index into an array of ISummarizeOptions */
448
461
  | "summaryAttemptPhase"
462
+ /** Summarization may be attempted multiple times. This tells whether this is the final summarization attempt */
463
+ | "finalAttempt"
449
464
  | keyof ISummarizeOptions;
450
465
 
451
466
  export type ISummarizeTelemetryProperties = Pick<
@@ -3,10 +3,10 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { IEvent } from "@fluidframework/common-definitions";
7
- import { IDisposable } from "@fluidframework/core-interfaces";
6
+ import { IDisposable, IEvent } from "@fluidframework/core-interfaces";
8
7
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
9
- import { Deferred, assert, TypedEventEmitter } from "@fluidframework/common-utils";
8
+ import { Deferred, assert } from "@fluidframework/core-utils";
9
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
10
10
  import { IDeltaManager } from "@fluidframework/container-definitions";
11
11
  import {
12
12
  IDocumentMessage,
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { assert } from "@fluidframework/common-utils";
6
+ import { assert } from "@fluidframework/core-utils";
7
7
  import { IDocumentStorageService } from "@fluidframework/driver-definitions";
8
8
  import {
9
9
  readAndParse,