@fluidframework/container-runtime 2.0.0-rc.4.0.5 → 2.0.0-rc.5.0.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 (424) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/api-extractor/api-extractor-lint-bundle.json +5 -0
  3. package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
  4. package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
  5. package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
  6. package/api-extractor/api-extractor-lint-public.esm.json +5 -0
  7. package/api-extractor.json +1 -1
  8. package/api-report/{container-runtime.api.md → container-runtime.alpha.api.md} +33 -516
  9. package/api-report/container-runtime.beta.api.md +73 -0
  10. package/api-report/container-runtime.public.api.md +73 -0
  11. package/biome.jsonc +4 -0
  12. package/container-runtime.test-files.tar +0 -0
  13. package/dist/batchTracker.d.ts.map +1 -1
  14. package/dist/batchTracker.js.map +1 -1
  15. package/dist/blobManager.d.ts +3 -20
  16. package/dist/blobManager.d.ts.map +1 -1
  17. package/dist/blobManager.js +1 -35
  18. package/dist/blobManager.js.map +1 -1
  19. package/dist/channelCollection.d.ts +21 -12
  20. package/dist/channelCollection.d.ts.map +1 -1
  21. package/dist/channelCollection.js +113 -110
  22. package/dist/channelCollection.js.map +1 -1
  23. package/dist/connectionTelemetry.d.ts +1 -1
  24. package/dist/connectionTelemetry.d.ts.map +1 -1
  25. package/dist/connectionTelemetry.js +14 -14
  26. package/dist/connectionTelemetry.js.map +1 -1
  27. package/dist/containerHandleContext.d.ts +2 -1
  28. package/dist/containerHandleContext.d.ts.map +1 -1
  29. package/dist/containerHandleContext.js.map +1 -1
  30. package/dist/containerRuntime.d.ts +17 -34
  31. package/dist/containerRuntime.d.ts.map +1 -1
  32. package/dist/containerRuntime.js +109 -145
  33. package/dist/containerRuntime.js.map +1 -1
  34. package/dist/dataStore.d.ts.map +1 -1
  35. package/dist/dataStore.js.map +1 -1
  36. package/dist/dataStoreContext.d.ts +30 -44
  37. package/dist/dataStoreContext.d.ts.map +1 -1
  38. package/dist/dataStoreContext.js +26 -40
  39. package/dist/dataStoreContext.js.map +1 -1
  40. package/dist/dataStoreContexts.d.ts.map +1 -1
  41. package/dist/dataStoreContexts.js.map +1 -1
  42. package/dist/dataStoreRegistry.js.map +1 -1
  43. package/dist/deltaManagerProxies.d.ts +4 -3
  44. package/dist/deltaManagerProxies.d.ts.map +1 -1
  45. package/dist/deltaManagerProxies.js.map +1 -1
  46. package/dist/deltaScheduler.d.ts +1 -1
  47. package/dist/deltaScheduler.d.ts.map +1 -1
  48. package/dist/deltaScheduler.js +1 -3
  49. package/dist/deltaScheduler.js.map +1 -1
  50. package/dist/gc/garbageCollection.d.ts +5 -5
  51. package/dist/gc/garbageCollection.d.ts.map +1 -1
  52. package/dist/gc/garbageCollection.js +29 -30
  53. package/dist/gc/garbageCollection.js.map +1 -1
  54. package/dist/gc/gcConfigs.d.ts.map +1 -1
  55. package/dist/gc/gcConfigs.js +12 -31
  56. package/dist/gc/gcConfigs.js.map +1 -1
  57. package/dist/gc/gcDefinitions.d.ts +10 -38
  58. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  59. package/dist/gc/gcDefinitions.js +1 -5
  60. package/dist/gc/gcDefinitions.js.map +1 -1
  61. package/dist/gc/gcHelpers.d.ts +2 -3
  62. package/dist/gc/gcHelpers.d.ts.map +1 -1
  63. package/dist/gc/gcHelpers.js.map +1 -1
  64. package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -1
  65. package/dist/gc/gcSummaryDefinitions.d.ts +1 -1
  66. package/dist/gc/gcSummaryDefinitions.d.ts.map +1 -1
  67. package/dist/gc/gcSummaryDefinitions.js.map +1 -1
  68. package/dist/gc/gcSummaryStateTracker.d.ts +2 -35
  69. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  70. package/dist/gc/gcSummaryStateTracker.js +9 -62
  71. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  72. package/dist/gc/gcTelemetry.d.ts +2 -2
  73. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  74. package/dist/gc/gcTelemetry.js +3 -9
  75. package/dist/gc/gcTelemetry.js.map +1 -1
  76. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  77. package/dist/gc/index.d.ts +1 -1
  78. package/dist/gc/index.d.ts.map +1 -1
  79. package/dist/gc/index.js +1 -3
  80. package/dist/gc/index.js.map +1 -1
  81. package/dist/index.d.ts +2 -2
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js.map +1 -1
  84. package/dist/legacy.d.ts +1 -1
  85. package/dist/messageTypes.d.ts +6 -22
  86. package/dist/messageTypes.d.ts.map +1 -1
  87. package/dist/messageTypes.js.map +1 -1
  88. package/dist/opLifecycle/batchManager.js.map +1 -1
  89. package/dist/opLifecycle/definitions.d.ts +2 -2
  90. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  91. package/dist/opLifecycle/definitions.js.map +1 -1
  92. package/dist/opLifecycle/index.d.ts +1 -1
  93. package/dist/opLifecycle/index.d.ts.map +1 -1
  94. package/dist/opLifecycle/index.js.map +1 -1
  95. package/dist/opLifecycle/opCompressor.d.ts +11 -1
  96. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  97. package/dist/opLifecycle/opCompressor.js +13 -2
  98. package/dist/opLifecycle/opCompressor.js.map +1 -1
  99. package/dist/opLifecycle/opDecompressor.d.ts +1 -1
  100. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  101. package/dist/opLifecycle/opDecompressor.js +1 -2
  102. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  103. package/dist/opLifecycle/opGroupingManager.d.ts +10 -3
  104. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  105. package/dist/opLifecycle/opGroupingManager.js +7 -0
  106. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  107. package/dist/opLifecycle/opSplitter.d.ts +4 -2
  108. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  109. package/dist/opLifecycle/opSplitter.js +13 -8
  110. package/dist/opLifecycle/opSplitter.js.map +1 -1
  111. package/dist/opLifecycle/outbox.d.ts +10 -0
  112. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  113. package/dist/opLifecycle/outbox.js +13 -18
  114. package/dist/opLifecycle/outbox.js.map +1 -1
  115. package/dist/opLifecycle/remoteMessageProcessor.d.ts +1 -1
  116. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  117. package/dist/opLifecycle/remoteMessageProcessor.js +2 -2
  118. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  119. package/dist/opProperties.d.ts +1 -1
  120. package/dist/opProperties.d.ts.map +1 -1
  121. package/dist/opProperties.js.map +1 -1
  122. package/dist/packageVersion.d.ts +1 -1
  123. package/dist/packageVersion.js +1 -1
  124. package/dist/packageVersion.js.map +1 -1
  125. package/dist/pendingStateManager.d.ts.map +1 -1
  126. package/dist/pendingStateManager.js +15 -5
  127. package/dist/pendingStateManager.js.map +1 -1
  128. package/dist/scheduleManager.d.ts +1 -1
  129. package/dist/scheduleManager.d.ts.map +1 -1
  130. package/dist/scheduleManager.js.map +1 -1
  131. package/dist/storageServiceWithAttachBlobs.js.map +1 -1
  132. package/dist/summary/documentSchema.d.ts.map +1 -1
  133. package/dist/summary/documentSchema.js +2 -3
  134. package/dist/summary/documentSchema.js.map +1 -1
  135. package/dist/summary/index.d.ts +2 -2
  136. package/dist/summary/index.d.ts.map +1 -1
  137. package/dist/summary/index.js.map +1 -1
  138. package/dist/summary/orderedClientElection.d.ts +4 -2
  139. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  140. package/dist/summary/orderedClientElection.js +35 -13
  141. package/dist/summary/orderedClientElection.js.map +1 -1
  142. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  143. package/dist/summary/runningSummarizer.d.ts +1 -6
  144. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  145. package/dist/summary/runningSummarizer.js +23 -110
  146. package/dist/summary/runningSummarizer.js.map +1 -1
  147. package/dist/summary/summarizer.d.ts +1 -1
  148. package/dist/summary/summarizer.d.ts.map +1 -1
  149. package/dist/summary/summarizer.js +4 -1
  150. package/dist/summary/summarizer.js.map +1 -1
  151. package/dist/summary/summarizerClientElection.d.ts +1 -1
  152. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  153. package/dist/summary/summarizerClientElection.js +2 -2
  154. package/dist/summary/summarizerClientElection.js.map +1 -1
  155. package/dist/summary/summarizerHeuristics.js.map +1 -1
  156. package/dist/summary/summarizerNode/summarizerNode.d.ts +2 -3
  157. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  158. package/dist/summary/summarizerNode/summarizerNode.js +16 -16
  159. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  160. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -1
  161. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  162. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  163. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -3
  164. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  165. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +5 -2
  166. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  167. package/dist/summary/summarizerTypes.d.ts +17 -29
  168. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  169. package/dist/summary/summarizerTypes.js.map +1 -1
  170. package/dist/summary/summaryCollection.d.ts +1 -1
  171. package/dist/summary/summaryCollection.d.ts.map +1 -1
  172. package/dist/summary/summaryCollection.js +11 -11
  173. package/dist/summary/summaryCollection.js.map +1 -1
  174. package/dist/summary/summaryFormat.d.ts +2 -3
  175. package/dist/summary/summaryFormat.d.ts.map +1 -1
  176. package/dist/summary/summaryFormat.js +2 -2
  177. package/dist/summary/summaryFormat.js.map +1 -1
  178. package/dist/summary/summaryGenerator.d.ts +7 -8
  179. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  180. package/dist/summary/summaryGenerator.js +27 -24
  181. package/dist/summary/summaryGenerator.js.map +1 -1
  182. package/dist/summary/summaryManager.d.ts.map +1 -1
  183. package/dist/summary/summaryManager.js +1 -2
  184. package/dist/summary/summaryManager.js.map +1 -1
  185. package/dist/throttler.d.ts.map +1 -1
  186. package/dist/throttler.js +3 -1
  187. package/dist/throttler.js.map +1 -1
  188. package/lib/batchTracker.d.ts.map +1 -1
  189. package/lib/batchTracker.js +1 -1
  190. package/lib/batchTracker.js.map +1 -1
  191. package/lib/blobManager.d.ts +3 -20
  192. package/lib/blobManager.d.ts.map +1 -1
  193. package/lib/blobManager.js +2 -36
  194. package/lib/blobManager.js.map +1 -1
  195. package/lib/channelCollection.d.ts +21 -12
  196. package/lib/channelCollection.d.ts.map +1 -1
  197. package/lib/channelCollection.js +114 -112
  198. package/lib/channelCollection.js.map +1 -1
  199. package/lib/connectionTelemetry.d.ts +1 -1
  200. package/lib/connectionTelemetry.d.ts.map +1 -1
  201. package/lib/connectionTelemetry.js +2 -2
  202. package/lib/connectionTelemetry.js.map +1 -1
  203. package/lib/containerHandleContext.d.ts +2 -1
  204. package/lib/containerHandleContext.d.ts.map +1 -1
  205. package/lib/containerHandleContext.js.map +1 -1
  206. package/lib/containerRuntime.d.ts +17 -34
  207. package/lib/containerRuntime.d.ts.map +1 -1
  208. package/lib/containerRuntime.js +106 -142
  209. package/lib/containerRuntime.js.map +1 -1
  210. package/lib/dataStore.d.ts.map +1 -1
  211. package/lib/dataStore.js.map +1 -1
  212. package/lib/dataStoreContext.d.ts +30 -44
  213. package/lib/dataStoreContext.d.ts.map +1 -1
  214. package/lib/dataStoreContext.js +29 -43
  215. package/lib/dataStoreContext.js.map +1 -1
  216. package/lib/dataStoreContexts.d.ts.map +1 -1
  217. package/lib/dataStoreContexts.js +1 -1
  218. package/lib/dataStoreContexts.js.map +1 -1
  219. package/lib/dataStoreRegistry.js.map +1 -1
  220. package/lib/deltaManagerProxies.d.ts +4 -3
  221. package/lib/deltaManagerProxies.d.ts.map +1 -1
  222. package/lib/deltaManagerProxies.js.map +1 -1
  223. package/lib/deltaScheduler.d.ts +1 -1
  224. package/lib/deltaScheduler.d.ts.map +1 -1
  225. package/lib/deltaScheduler.js +1 -3
  226. package/lib/deltaScheduler.js.map +1 -1
  227. package/lib/gc/garbageCollection.d.ts +5 -5
  228. package/lib/gc/garbageCollection.d.ts.map +1 -1
  229. package/lib/gc/garbageCollection.js +30 -31
  230. package/lib/gc/garbageCollection.js.map +1 -1
  231. package/lib/gc/gcConfigs.d.ts.map +1 -1
  232. package/lib/gc/gcConfigs.js +13 -32
  233. package/lib/gc/gcConfigs.js.map +1 -1
  234. package/lib/gc/gcDefinitions.d.ts +10 -38
  235. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  236. package/lib/gc/gcDefinitions.js +0 -4
  237. package/lib/gc/gcDefinitions.js.map +1 -1
  238. package/lib/gc/gcHelpers.d.ts +2 -3
  239. package/lib/gc/gcHelpers.d.ts.map +1 -1
  240. package/lib/gc/gcHelpers.js.map +1 -1
  241. package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -1
  242. package/lib/gc/gcSummaryDefinitions.d.ts +1 -1
  243. package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -1
  244. package/lib/gc/gcSummaryDefinitions.js.map +1 -1
  245. package/lib/gc/gcSummaryStateTracker.d.ts +2 -35
  246. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  247. package/lib/gc/gcSummaryStateTracker.js +4 -57
  248. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  249. package/lib/gc/gcTelemetry.d.ts +2 -2
  250. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  251. package/lib/gc/gcTelemetry.js +3 -9
  252. package/lib/gc/gcTelemetry.js.map +1 -1
  253. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  254. package/lib/gc/index.d.ts +1 -1
  255. package/lib/gc/index.d.ts.map +1 -1
  256. package/lib/gc/index.js +1 -1
  257. package/lib/gc/index.js.map +1 -1
  258. package/lib/index.d.ts +2 -2
  259. package/lib/index.d.ts.map +1 -1
  260. package/lib/index.js.map +1 -1
  261. package/lib/legacy.d.ts +1 -1
  262. package/lib/messageTypes.d.ts +6 -22
  263. package/lib/messageTypes.d.ts.map +1 -1
  264. package/lib/messageTypes.js.map +1 -1
  265. package/lib/opLifecycle/batchManager.js.map +1 -1
  266. package/lib/opLifecycle/definitions.d.ts +2 -2
  267. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  268. package/lib/opLifecycle/definitions.js.map +1 -1
  269. package/lib/opLifecycle/index.d.ts +1 -1
  270. package/lib/opLifecycle/index.d.ts.map +1 -1
  271. package/lib/opLifecycle/index.js +1 -1
  272. package/lib/opLifecycle/index.js.map +1 -1
  273. package/lib/opLifecycle/opCompressor.d.ts +11 -1
  274. package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
  275. package/lib/opLifecycle/opCompressor.js +13 -2
  276. package/lib/opLifecycle/opCompressor.js.map +1 -1
  277. package/lib/opLifecycle/opDecompressor.d.ts +1 -1
  278. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  279. package/lib/opLifecycle/opDecompressor.js +1 -2
  280. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  281. package/lib/opLifecycle/opGroupingManager.d.ts +10 -3
  282. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  283. package/lib/opLifecycle/opGroupingManager.js +7 -0
  284. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  285. package/lib/opLifecycle/opSplitter.d.ts +4 -2
  286. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  287. package/lib/opLifecycle/opSplitter.js +13 -8
  288. package/lib/opLifecycle/opSplitter.js.map +1 -1
  289. package/lib/opLifecycle/outbox.d.ts +10 -0
  290. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  291. package/lib/opLifecycle/outbox.js +13 -18
  292. package/lib/opLifecycle/outbox.js.map +1 -1
  293. package/lib/opLifecycle/remoteMessageProcessor.d.ts +1 -1
  294. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  295. package/lib/opLifecycle/remoteMessageProcessor.js +1 -1
  296. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  297. package/lib/opProperties.d.ts +1 -1
  298. package/lib/opProperties.d.ts.map +1 -1
  299. package/lib/opProperties.js.map +1 -1
  300. package/lib/packageVersion.d.ts +1 -1
  301. package/lib/packageVersion.js +1 -1
  302. package/lib/packageVersion.js.map +1 -1
  303. package/lib/pendingStateManager.d.ts.map +1 -1
  304. package/lib/pendingStateManager.js +15 -5
  305. package/lib/pendingStateManager.js.map +1 -1
  306. package/lib/scheduleManager.d.ts +1 -1
  307. package/lib/scheduleManager.d.ts.map +1 -1
  308. package/lib/scheduleManager.js.map +1 -1
  309. package/lib/storageServiceWithAttachBlobs.js.map +1 -1
  310. package/lib/summary/documentSchema.d.ts.map +1 -1
  311. package/lib/summary/documentSchema.js +2 -3
  312. package/lib/summary/documentSchema.js.map +1 -1
  313. package/lib/summary/index.d.ts +2 -2
  314. package/lib/summary/index.d.ts.map +1 -1
  315. package/lib/summary/index.js +1 -1
  316. package/lib/summary/index.js.map +1 -1
  317. package/lib/summary/orderedClientElection.d.ts +4 -2
  318. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  319. package/lib/summary/orderedClientElection.js +35 -13
  320. package/lib/summary/orderedClientElection.js.map +1 -1
  321. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  322. package/lib/summary/runningSummarizer.d.ts +1 -6
  323. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  324. package/lib/summary/runningSummarizer.js +22 -109
  325. package/lib/summary/runningSummarizer.js.map +1 -1
  326. package/lib/summary/summarizer.d.ts +1 -1
  327. package/lib/summary/summarizer.d.ts.map +1 -1
  328. package/lib/summary/summarizer.js +4 -1
  329. package/lib/summary/summarizer.js.map +1 -1
  330. package/lib/summary/summarizerClientElection.d.ts +1 -1
  331. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  332. package/lib/summary/summarizerClientElection.js +1 -1
  333. package/lib/summary/summarizerClientElection.js.map +1 -1
  334. package/lib/summary/summarizerHeuristics.js.map +1 -1
  335. package/lib/summary/summarizerNode/summarizerNode.d.ts +2 -3
  336. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  337. package/lib/summary/summarizerNode/summarizerNode.js +14 -14
  338. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  339. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -1
  340. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  341. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  342. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -3
  343. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  344. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +5 -2
  345. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  346. package/lib/summary/summarizerTypes.d.ts +17 -29
  347. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  348. package/lib/summary/summarizerTypes.js.map +1 -1
  349. package/lib/summary/summaryCollection.d.ts +1 -1
  350. package/lib/summary/summaryCollection.d.ts.map +1 -1
  351. package/lib/summary/summaryCollection.js +3 -3
  352. package/lib/summary/summaryCollection.js.map +1 -1
  353. package/lib/summary/summaryFormat.d.ts +2 -3
  354. package/lib/summary/summaryFormat.d.ts.map +1 -1
  355. package/lib/summary/summaryFormat.js +2 -2
  356. package/lib/summary/summaryFormat.js.map +1 -1
  357. package/lib/summary/summaryGenerator.d.ts +7 -8
  358. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  359. package/lib/summary/summaryGenerator.js +26 -23
  360. package/lib/summary/summaryGenerator.js.map +1 -1
  361. package/lib/summary/summaryManager.d.ts.map +1 -1
  362. package/lib/summary/summaryManager.js +1 -2
  363. package/lib/summary/summaryManager.js.map +1 -1
  364. package/lib/throttler.d.ts.map +1 -1
  365. package/lib/throttler.js +3 -1
  366. package/lib/throttler.js.map +1 -1
  367. package/lib/tsdoc-metadata.json +1 -1
  368. package/package.json +92 -28
  369. package/src/batchTracker.ts +5 -2
  370. package/src/blobManager.ts +21 -61
  371. package/src/channelCollection.ts +179 -186
  372. package/src/connectionTelemetry.ts +18 -12
  373. package/src/containerHandleContext.ts +2 -1
  374. package/src/containerRuntime.ts +166 -214
  375. package/src/dataStore.ts +2 -1
  376. package/src/dataStoreContext.ts +79 -98
  377. package/src/dataStoreContexts.ts +7 -2
  378. package/src/deltaManagerProxies.ts +15 -6
  379. package/src/deltaScheduler.ts +5 -4
  380. package/src/gc/garbageCollection.md +0 -8
  381. package/src/gc/garbageCollection.ts +66 -57
  382. package/src/gc/gcConfigs.ts +15 -37
  383. package/src/gc/gcDefinitions.ts +20 -39
  384. package/src/gc/gcHelpers.ts +8 -4
  385. package/src/gc/gcSummaryDefinitions.ts +1 -1
  386. package/src/gc/gcSummaryStateTracker.ts +11 -74
  387. package/src/gc/gcTelemetry.ts +4 -11
  388. package/src/gc/index.ts +0 -2
  389. package/src/index.ts +1 -2
  390. package/src/messageTypes.ts +8 -24
  391. package/src/opLifecycle/README.md +120 -160
  392. package/src/opLifecycle/definitions.ts +2 -2
  393. package/src/opLifecycle/index.ts +5 -1
  394. package/src/opLifecycle/opCompressor.ts +13 -2
  395. package/src/opLifecycle/opDecompressor.ts +3 -7
  396. package/src/opLifecycle/opGroupingManager.ts +12 -8
  397. package/src/opLifecycle/opSplitter.ts +22 -11
  398. package/src/opLifecycle/outbox.ts +14 -32
  399. package/src/opLifecycle/remoteMessageProcessor.ts +4 -1
  400. package/src/opProperties.ts +2 -2
  401. package/src/packageVersion.ts +1 -1
  402. package/src/pendingStateManager.ts +20 -7
  403. package/src/scheduleManager.ts +4 -1
  404. package/src/summary/documentSchema.ts +4 -7
  405. package/src/summary/images/appTree.png +0 -0
  406. package/src/summary/images/protocolAndAppTree.png +0 -0
  407. package/src/summary/images/summaryTree.png +0 -0
  408. package/src/summary/index.ts +5 -2
  409. package/src/summary/orderedClientElection.ts +100 -22
  410. package/src/summary/runningSummarizer.ts +54 -124
  411. package/src/summary/summarizer.ts +5 -2
  412. package/src/summary/summarizerClientElection.ts +4 -2
  413. package/src/summary/summarizerNode/summarizerNode.ts +23 -30
  414. package/src/summary/summarizerNode/summarizerNodeUtils.ts +9 -3
  415. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +11 -11
  416. package/src/summary/summarizerTypes.ts +32 -33
  417. package/src/summary/summaryCollection.ts +6 -3
  418. package/src/summary/summaryFormat.ts +18 -10
  419. package/src/summary/summaryFormats.md +160 -0
  420. package/src/summary/summaryGenerator.ts +47 -30
  421. package/src/summary/summaryManager.ts +6 -9
  422. package/src/throttler.ts +3 -1
  423. package/tsconfig.json +2 -0
  424. package/tsdoc.json +4 -0
@@ -14,20 +14,20 @@ import {
14
14
  import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
15
15
  import { assert, Lazy, LazyPromise } from "@fluidframework/core-utils/internal";
16
16
  import { FluidObjectHandle } from "@fluidframework/datastore/internal";
17
+ import type { ISnapshot } from "@fluidframework/driver-definitions/internal";
18
+ import {
19
+ ISnapshotTree,
20
+ ISequencedDocumentMessage,
21
+ } from "@fluidframework/driver-definitions/internal";
17
22
  import {
18
23
  buildSnapshotTree,
19
24
  getSnapshotTree,
20
25
  isInstanceOfISnapshot,
21
26
  } from "@fluidframework/driver-utils/internal";
22
- import type { ISnapshot } from "@fluidframework/driver-definitions/internal";
23
- import { ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
24
27
  import {
25
- IGarbageCollectionData,
26
- IInboundSignalMessage,
27
28
  ISummaryTreeWithStats,
28
29
  ITelemetryContext,
29
- } from "@fluidframework/runtime-definitions";
30
- import {
30
+ IGarbageCollectionData,
31
31
  AliasResult,
32
32
  CreateSummarizerNodeSource,
33
33
  IAttachMessage,
@@ -42,11 +42,14 @@ import {
42
42
  InboundAttachMessage,
43
43
  NamedFluidDataStoreRegistryEntries,
44
44
  channelsTreeName,
45
+ IInboundSignalMessage,
46
+ gcDataBlobKey,
45
47
  } from "@fluidframework/runtime-definitions/internal";
46
48
  import {
47
49
  GCDataBuilder,
48
50
  RequestParser,
49
51
  SummaryTreeBuilder,
52
+ addBlobToSummary,
50
53
  convertSnapshotTreeToSummaryTree,
51
54
  convertSummaryTreeToITree,
52
55
  create404Response,
@@ -89,12 +92,7 @@ import {
89
92
  } from "./dataStoreContext.js";
90
93
  import { DataStoreContexts } from "./dataStoreContexts.js";
91
94
  import { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
92
- import {
93
- GCNodeType,
94
- detectOutboundRoutesViaDDSKey,
95
- IGCNodeUpdatedProps,
96
- urlToGCNodePath,
97
- } from "./gc/index.js";
95
+ import { GCNodeType, IGCNodeUpdatedProps, urlToGCNodePath } from "./gc/index.js";
98
96
  import { ContainerMessageType, LocalContainerRuntimeMessage } from "./messageTypes.js";
99
97
  import { StorageServiceWithAttachBlobs } from "./storageServiceWithAttachBlobs.js";
100
98
  import {
@@ -149,7 +147,7 @@ export function wrapContext(context: IFluidParentContext): IFluidParentContext {
149
147
  },
150
148
  deltaManager: context.deltaManager,
151
149
  storage: context.storage,
152
- logger: context.logger,
150
+ baseLogger: context.baseLogger,
153
151
  get clientDetails() {
154
152
  return context.clientDetails;
155
153
  },
@@ -189,8 +187,8 @@ export function wrapContext(context: IFluidParentContext): IFluidParentContext {
189
187
  uploadBlob: async (...args) => {
190
188
  return context.uploadBlob(...args);
191
189
  },
192
- addedGCOutboundReference: (...args) => {
193
- return context.addedGCOutboundReference?.(...args);
190
+ addedGCOutboundRoute: (...args) => {
191
+ return context.addedGCOutboundRoute(...args);
194
192
  },
195
193
  getCreateChildSummarizerNodeFn: (...args) => {
196
194
  return context.getCreateChildSummarizerNodeFn?.(...args);
@@ -245,6 +243,13 @@ export function wrapContextForInnerChannel(
245
243
  return context;
246
244
  }
247
245
 
246
+ /**
247
+ * Returns the type of the given local data store from its package path.
248
+ */
249
+ export function getLocalDataStoreType(localDataStore: LocalFluidDataStoreContext) {
250
+ return localDataStore.packagePath[localDataStore.packagePath.length - 1];
251
+ }
252
+
248
253
  /**
249
254
  * This class encapsulates data store handling. Currently it is only used by the container runtime,
250
255
  * but eventually could be hosted on any channel once we formalize the channel api boundary.
@@ -269,12 +274,6 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
269
274
  readonly referencedDataStoreCount: number;
270
275
  };
271
276
 
272
- // Stores the ids of new data stores between two GC runs. This is used to notify the garbage collector of new
273
- // root data stores that are added.
274
- private dataStoresSinceLastGC: string[] = [];
275
- // The handle to the container runtime. This is used mainly for GC purposes to represent outbound reference from
276
- // the container runtime to other nodes.
277
- private readonly containerRuntimeHandle: IFluidHandleInternal;
278
277
  private readonly pendingAliasMap: Map<string, Promise<AliasResult>> = new Map<
279
278
  string,
280
279
  Promise<AliasResult>
@@ -294,11 +293,6 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
294
293
  ) {
295
294
  this.mc = createChildMonitoringContext({ logger: baseLogger });
296
295
  this.contexts = new DataStoreContexts(baseLogger);
297
- this.containerRuntimeHandle = new FluidObjectHandle(
298
- this.parentContext,
299
- "/",
300
- this.parentContext.IFluidHandleContext,
301
- );
302
296
  this.entryPoint = new FluidObjectHandle<FluidObject>(
303
297
  new LazyPromise(async () => provideEntryPoint(this)),
304
298
  "",
@@ -402,17 +396,15 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
402
396
  private processAttachMessage(message: ISequencedDocumentMessage, local: boolean) {
403
397
  const attachMessage = message.contents as InboundAttachMessage;
404
398
 
405
- this.dataStoresSinceLastGC.push(attachMessage.id);
406
-
407
399
  // We need to process the GC Data for both local and remote attach messages
408
- const foundGCData = processAttachMessageGCData(attachMessage.snapshot, (nodeId, toPath) => {
409
- // nodeId is the relative path under the node being attached. Always starts with "/", but no trailing "/" after an id
410
- const fromPath = `/${attachMessage.id}${nodeId === "/" ? "" : nodeId}`;
411
- this.parentContext.addedGCOutboundReference?.(
412
- { absolutePath: fromPath },
413
- { absolutePath: toPath },
414
- );
415
- });
400
+ const foundGCData = processAttachMessageGCData(
401
+ attachMessage.snapshot,
402
+ (nodeId, toPath) => {
403
+ // nodeId is the relative path under the node being attached. Always starts with "/", but no trailing "/" after an id
404
+ const fromPath = `/${attachMessage.id}${nodeId === "/" ? "" : nodeId}`;
405
+ this.parentContext.addedGCOutboundRoute(fromPath, toPath, message.timestamp);
406
+ },
407
+ );
416
408
 
417
409
  // Only log once per container to avoid noise/cost.
418
410
  // Allows longitudinal tracking of various state (e.g. foundGCData), and some sampled details
@@ -506,13 +498,18 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
506
498
  const aliasResult = this.processAliasMessageCore(
507
499
  aliasMessage.internalId,
508
500
  aliasMessage.alias,
501
+ message.timestamp,
509
502
  );
510
503
  if (local) {
511
504
  resolve(aliasResult);
512
505
  }
513
506
  }
514
507
 
515
- public processAliasMessageCore(internalId: string, alias: string): boolean {
508
+ public processAliasMessageCore(
509
+ internalId: string,
510
+ alias: string,
511
+ messageTimestampMs?: number,
512
+ ): boolean {
516
513
  if (this.alreadyProcessed(alias)) {
517
514
  return false;
518
515
  }
@@ -532,12 +529,11 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
532
529
  return false;
533
530
  }
534
531
 
535
- const handle = new FluidObjectHandle(
536
- context,
537
- internalId,
538
- this.parentContext.IFluidHandleContext,
539
- );
540
- this.parentContext.addedGCOutboundReference?.(this.containerRuntimeHandle, handle);
532
+ // If message timestamp doesn't exist, this is called in a detached container. Don't notify GC in that case
533
+ // because it doesn't run in detached container and doesn't need to know about this route.
534
+ if (messageTimestampMs) {
535
+ this.parentContext.addedGCOutboundRoute("/", `/${internalId}`, messageTimestampMs);
536
+ }
541
537
 
542
538
  this.aliasMap.set(alias, context.id);
543
539
  this.aliasedDataStores.add(context.id);
@@ -550,9 +546,13 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
550
546
  }
551
547
 
552
548
  /** Package up the context's attach summary etc into an IAttachMessage */
553
- private generateAttachMessage(localContext: IFluidDataStoreContextInternal): IAttachMessage {
554
- const { attachSummary } = localContext.getAttachData(/* includeGCData: */ true);
555
- const type = localContext.packagePath[localContext.packagePath.length - 1];
549
+ private generateAttachMessage(localContext: LocalFluidDataStoreContext): IAttachMessage {
550
+ // Get the attach summary.
551
+ const attachSummary = localContext.getAttachSummary();
552
+
553
+ // Get the GC data and add it to the attach summary.
554
+ const attachGCData = localContext.getAttachGCData();
555
+ addBlobToSummary(attachSummary, gcDataBlobKey, JSON.stringify(attachGCData));
556
556
 
557
557
  // Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.
558
558
  const snapshot = convertSummaryTreeToITree(attachSummary.summary);
@@ -560,7 +560,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
560
560
  return {
561
561
  id: localContext.id,
562
562
  snapshot,
563
- type,
563
+ type: getLocalDataStoreType(localContext),
564
564
  } satisfies IAttachMessage;
565
565
  }
566
566
 
@@ -679,7 +679,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
679
679
  channel,
680
680
  id,
681
681
  this,
682
- createChildLogger({ logger: this.parentContext.logger }),
682
+ createChildLogger({ logger: this.parentContext.baseLogger }),
683
683
  ),
684
684
  });
685
685
 
@@ -817,7 +817,6 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
817
817
  message: ISequencedDocumentMessage,
818
818
  local: boolean,
819
819
  localMessageMetadata: unknown,
820
- addedOutboundReference?: (fromNodePath: string, toNodePath: string) => void,
821
820
  ) {
822
821
  switch (message.type) {
823
822
  case ContainerMessageType.Attach:
@@ -837,19 +836,13 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
837
836
 
838
837
  this.processChannelOp(envelope.address, transformed, local, localMessageMetadata);
839
838
 
840
- // By default, we use the new behavior of detecting outbound routes here.
841
- // If this setting is true, then DataStoreContext would be notifying GC instead.
842
- if (
843
- this.mc.config.getBoolean(detectOutboundRoutesViaDDSKey) !== true &&
844
- addedOutboundReference !== undefined
845
- ) {
846
- // Notify GC of any outbound references that were added by this op.
847
- detectOutboundReferences(
848
- envelope.address,
849
- transformed.contents,
850
- addedOutboundReference,
851
- );
852
- }
839
+ // Notify GC of any outbound references that were added by this op.
840
+ detectOutboundReferences(
841
+ envelope.address,
842
+ transformed.contents,
843
+ (fromPath: string, toPath: string) =>
844
+ this.parentContext.addedGCOutboundRoute(fromPath, toPath, message.timestamp),
845
+ );
853
846
  break;
854
847
  }
855
848
  default:
@@ -985,14 +978,12 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
985
978
  }
986
979
 
987
980
  const idToLog =
988
- originalRequest !== undefined
989
- ? urlToGCNodePath(originalRequest.url)
990
- : dataStoreNodePath;
981
+ originalRequest !== undefined ? urlToGCNodePath(originalRequest.url) : dataStoreNodePath;
991
982
 
992
983
  // Log the package details asynchronously since getInitialSnapshotDetails is async
993
- const recentelyDeletedContext = this.contexts.getRecentlyDeletedContext(id);
994
- if (recentelyDeletedContext !== undefined) {
995
- recentelyDeletedContext
984
+ const recentlyDeletedContext = this.contexts.getRecentlyDeletedContext(id);
985
+ if (recentlyDeletedContext !== undefined) {
986
+ recentlyDeletedContext
996
987
  .getInitialSnapshotDetails()
997
988
  .then((details) => {
998
989
  return details.pkg.join("/");
@@ -1094,112 +1085,126 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
1094
1085
  return this.contexts.size;
1095
1086
  }
1096
1087
 
1097
- public async summarize(
1098
- fullTree: boolean,
1099
- trackState: boolean,
1100
- telemetryContext?: ITelemetryContext,
1101
- ): Promise<ISummaryTreeWithStats> {
1102
- const summaryBuilder = new SummaryTreeBuilder();
1103
-
1104
- // Iterate over each store and ask it to snapshot
1105
- await Promise.all(
1106
- Array.from(this.contexts)
1107
- .filter(([_, context]) => {
1108
- // Summarizer works only with clients with no local changes. A data store in attaching
1109
- // state indicates an op was sent to attach a local data store, and the the attach op
1110
- // had not yet round tripped back to the client.
1111
- if (context.attachState === AttachState.Attaching) {
1112
- // Formerly assert 0x588
1113
- const error = DataProcessingError.create(
1114
- "Local data store detected in attaching state during summarize",
1115
- "summarize",
1116
- );
1117
- throw error;
1118
- }
1119
- return context.attachState === AttachState.Attached;
1120
- })
1121
- .map(async ([contextId, context]) => {
1122
- const contextSummary = await context.summarize(
1123
- fullTree,
1124
- trackState,
1125
- telemetryContext,
1088
+ /**
1089
+ * Create a summary. Used when attaching or serializing a detached container.
1090
+ */
1091
+ public getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {
1092
+ const builder = new SummaryTreeBuilder();
1093
+ this.visitLocalBoundContextsDuringAttach(
1094
+ (contextId: string, context: FluidDataStoreContext) => {
1095
+ let dataStoreSummary: ISummarizeResult;
1096
+ if (context.isLoaded) {
1097
+ dataStoreSummary = context.getAttachSummary(telemetryContext);
1098
+ } else {
1099
+ // If this data store is not yet loaded, then there should be no changes in the snapshot from
1100
+ // which it was created as it is detached container. So just use the previous snapshot.
1101
+ assert(
1102
+ !!this.baseSnapshot,
1103
+ 0x166 /* "BaseSnapshot should be there as detached container loaded from snapshot" */,
1126
1104
  );
1127
- summaryBuilder.addWithStats(contextId, contextSummary);
1128
- }),
1105
+ dataStoreSummary = convertSnapshotTreeToSummaryTree(
1106
+ getSnapshotTree(this.baseSnapshot).trees[contextId],
1107
+ );
1108
+ }
1109
+ builder.addWithStats(contextId, dataStoreSummary);
1110
+ },
1129
1111
  );
1112
+ return builder.getSummaryTree();
1113
+ }
1130
1114
 
1131
- return summaryBuilder.getSummaryTree();
1115
+ /**
1116
+ * Gets the GC data. Used when attaching or serializing a detached container.
1117
+ */
1118
+ public getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {
1119
+ const builder = new GCDataBuilder();
1120
+ this.visitLocalBoundContextsDuringAttach(
1121
+ (contextId: string, context: FluidDataStoreContext) => {
1122
+ const contextGCData = context.getAttachGCData(telemetryContext);
1123
+ // Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.
1124
+ // This also gradually builds the id of each node to be a path from the root.
1125
+ builder.prefixAndAddNodes(contextId, contextGCData.gcNodes);
1126
+ },
1127
+ );
1128
+ // Get the outbound routes (aliased data stores) and add a GC node for this channel.
1129
+ builder.addNode("/", Array.from(this.aliasedDataStores));
1130
+ return builder.getGCData();
1132
1131
  }
1133
1132
 
1134
1133
  /**
1135
- * Create a summary. Used when attaching or serializing a detached container.
1134
+ * Helper method for preparing to attach this channel.
1135
+ * Runs the callback for each bound context to incorporate its data however the caller specifies
1136
1136
  */
1137
- public getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {
1138
- const builder = new SummaryTreeBuilder();
1139
- // Attaching graph of some stores can cause other stores to get bound too.
1140
- // So keep taking summary until no new stores get bound.
1141
- let notBoundContextsLength: number;
1142
- do {
1143
- const builderTree = builder.summary.tree;
1137
+ private visitLocalBoundContextsDuringAttach(
1138
+ visitor: (contextId: string, context: FluidDataStoreContext) => void,
1139
+ ): void {
1140
+ const visitedContexts = new Set<string>();
1141
+ let visitedLength = -1;
1142
+ let notBoundContextsLength = -1;
1143
+ while (
1144
+ visitedLength !== visitedContexts.size &&
1145
+ notBoundContextsLength !== this.contexts.notBoundLength()
1146
+ ) {
1147
+ // detect changes in the visitedContexts set, as on visiting a context
1148
+ // it could could make contexts available by removing other contexts
1149
+ // from the not bound context list, so we need to ensure those get processed as well.
1150
+ // only once the loop can run with no new contexts added to the visitedContexts set do we
1151
+ // know for sure all possible contexts have been visited.
1152
+ visitedLength = visitedContexts.size;
1144
1153
  notBoundContextsLength = this.contexts.notBoundLength();
1145
- // Iterate over each data store and ask it to snapshot
1146
- Array.from(this.contexts)
1147
- .filter(
1148
- ([key, _]) =>
1149
- // Take summary of bounded data stores only, make sure we haven't summarized them already
1150
- // and no attach op has been fired for that data store because for loader versions <= 0.24
1151
- // we set attach state as "attaching" before taking createNew summary.
1152
- !(
1153
- this.contexts.isNotBound(key) ||
1154
- builderTree[key] ||
1155
- this.attachOpFiredForDataStore.has(key)
1156
- ),
1157
- )
1158
- .map(([key, value]) => {
1159
- let dataStoreSummary: ISummarizeResult;
1160
- if (value.isLoaded) {
1161
- dataStoreSummary = value.getAttachData(
1162
- /* includeGCCData: */ false,
1163
- telemetryContext,
1164
- ).attachSummary;
1165
- } else {
1166
- // If this data store is not yet loaded, then there should be no changes in the snapshot from
1167
- // which it was created as it is detached container. So just use the previous snapshot.
1168
- assert(
1169
- !!this.baseSnapshot,
1170
- 0x166 /* "BaseSnapshot should be there as detached container loaded from snapshot" */,
1171
- );
1172
- dataStoreSummary = convertSnapshotTreeToSummaryTree(
1173
- getSnapshotTree(this.baseSnapshot).trees[key],
1174
- );
1175
- }
1176
- builder.addWithStats(key, dataStoreSummary);
1177
- });
1178
- } while (notBoundContextsLength !== this.contexts.notBoundLength());
1179
-
1180
- return builder.getSummaryTree();
1154
+ for (const [contextId, context] of this.contexts) {
1155
+ if (
1156
+ !(
1157
+ visitedContexts.has(contextId) ||
1158
+ this.contexts.isNotBound(contextId) ||
1159
+ this.attachOpFiredForDataStore.has(contextId)
1160
+ )
1161
+ ) {
1162
+ visitor(contextId, context);
1163
+ visitedContexts.add(contextId);
1164
+ }
1165
+ }
1166
+ }
1181
1167
  }
1182
1168
 
1183
1169
  /**
1184
- * Before GC runs, called by the garbage collector to update any pending GC state.
1185
- * The garbage collector needs to know all outbound references that are added. Since root data stores are not
1186
- * explicitly marked as referenced, notify GC of new root data stores that were added since the last GC run.
1170
+ * Helper method for preparing to summarize this channel.
1171
+ * Runs the callback for each bound context to incorporate its data however the caller specifies
1187
1172
  */
1188
- public async updateStateBeforeGC(): Promise<void> {
1189
- for (const id of this.dataStoresSinceLastGC) {
1190
- const context = this.contexts.get(id);
1191
- assert(context !== undefined, 0x2b6 /* Missing data store context */);
1192
- if (await context.isRoot()) {
1193
- // A root data store is basically a reference from the container runtime to the data store.
1194
- const handle = new FluidObjectHandle(
1195
- context,
1196
- id,
1197
- this.parentContext.IFluidHandleContext,
1173
+ private async visitContextsDuringSummary(
1174
+ visitor: (contextId: string, context: FluidDataStoreContext) => Promise<void>,
1175
+ ): Promise<void> {
1176
+ for (const [contextId, context] of this.contexts) {
1177
+ // Summarizer client and hence GC works only with clients with no local changes. A data store in
1178
+ // attaching state indicates an op was sent to attach a local data store, and the the attach op
1179
+ // had not yet round tripped back to the client.
1180
+ // Formerly assert 0x589
1181
+ if (context.attachState === AttachState.Attaching) {
1182
+ const error = DataProcessingError.create(
1183
+ "Local data store detected in attaching state",
1184
+ "summarize/getGCData",
1198
1185
  );
1199
- this.parentContext.addedGCOutboundReference?.(this.containerRuntimeHandle, handle);
1186
+ throw error;
1187
+ }
1188
+
1189
+ if (context.attachState === AttachState.Attached) {
1190
+ await visitor(contextId, context);
1200
1191
  }
1201
1192
  }
1202
- this.dataStoresSinceLastGC = [];
1193
+ }
1194
+
1195
+ public async summarize(
1196
+ fullTree: boolean,
1197
+ trackState: boolean,
1198
+ telemetryContext?: ITelemetryContext,
1199
+ ): Promise<ISummaryTreeWithStats> {
1200
+ const summaryBuilder = new SummaryTreeBuilder();
1201
+ await this.visitContextsDuringSummary(
1202
+ async (contextId: string, context: FluidDataStoreContext) => {
1203
+ const contextSummary = await context.summarize(fullTree, trackState, telemetryContext);
1204
+ summaryBuilder.addWithStats(contextId, contextSummary);
1205
+ },
1206
+ );
1207
+ return summaryBuilder.getSummaryTree();
1203
1208
  }
1204
1209
 
1205
1210
  /**
@@ -1217,30 +1222,13 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
1217
1222
  */
1218
1223
  public async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {
1219
1224
  const builder = new GCDataBuilder();
1220
- // Iterate over each store and get their GC data.
1221
- await Promise.all(
1222
- Array.from(this.contexts)
1223
- .filter(([_, context]) => {
1224
- // Summarizer client and hence GC works only with clients with no local changes. A data store in
1225
- // attaching state indicates an op was sent to attach a local data store, and the the attach op
1226
- // had not yet round tripped back to the client.
1227
- // Formerly assert 0x589
1228
- if (context.attachState === AttachState.Attaching) {
1229
- const error = DataProcessingError.create(
1230
- "Local data store detected in attaching state while running GC",
1231
- "getGCData",
1232
- );
1233
- throw error;
1234
- }
1235
-
1236
- return context.attachState === AttachState.Attached;
1237
- })
1238
- .map(async ([contextId, context]) => {
1239
- const contextGCData = await context.getGCData(fullGC);
1240
- // Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.
1241
- // This also gradually builds the id of each node to be a path from the root.
1242
- builder.prefixAndAddNodes(contextId, contextGCData.gcNodes);
1243
- }),
1225
+ await this.visitContextsDuringSummary(
1226
+ async (contextId: string, context: FluidDataStoreContext) => {
1227
+ const contextGCData = await context.getGCData(fullGC);
1228
+ // Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.
1229
+ // This also gradually builds the id of each node to be a path from the root.
1230
+ builder.prefixAndAddNodes(contextId, contextGCData.gcNodes);
1231
+ },
1244
1232
  );
1245
1233
 
1246
1234
  // Get the outbound routes and add a GC node for this channel.
@@ -1297,7 +1285,9 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
1297
1285
  * be deleted.
1298
1286
  * @returns The routes of data stores and its objects that were deleted.
1299
1287
  */
1300
- public deleteSweepReadyNodes(sweepReadyDataStoreRoutes: readonly string[]): readonly string[] {
1288
+ public deleteSweepReadyNodes(
1289
+ sweepReadyDataStoreRoutes: readonly string[],
1290
+ ): readonly string[] {
1301
1291
  for (const route of sweepReadyDataStoreRoutes) {
1302
1292
  const pathParts = route.split("/");
1303
1293
  const dataStoreId = pathParts[1];
@@ -1375,7 +1365,9 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
1375
1365
  /**
1376
1366
  * Called by GC to retrieve the package path of a data store node with the given path.
1377
1367
  */
1378
- public async getDataStorePackagePath(nodePath: string): Promise<readonly string[] | undefined> {
1368
+ public async getDataStorePackagePath(
1369
+ nodePath: string,
1370
+ ): Promise<readonly string[] | undefined> {
1379
1371
  // If the node belongs to a data store, return its package path. For DDSes, we return the package path of the
1380
1372
  // data store that contains it.
1381
1373
  const context = this.contexts.get(nodePath.split("/")[1]);
@@ -1446,6 +1438,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
1446
1438
  packagePath: details.pkg,
1447
1439
  request,
1448
1440
  headerData,
1441
+ timestampMs: undefined, // This will be added by the parent context if needed.
1449
1442
  });
1450
1443
 
1451
1444
  const dataStore = await dataStoreContext.realize();
@@ -1561,7 +1554,7 @@ export class ChannelCollectionFactory<T extends ChannelCollection = ChannelColle
1561
1554
  const runtime = this.ctor(
1562
1555
  context.baseSnapshot,
1563
1556
  context, // parentContext
1564
- context.logger,
1557
+ context.baseLogger,
1565
1558
  () => {}, // gcNodeUpdated
1566
1559
  (_nodePath: string) => false, // isDataStoreDeleted
1567
1560
  new Map(), // aliasMap
@@ -8,12 +8,12 @@ import { IDeltaManager } from "@fluidframework/container-definitions/internal";
8
8
  import { IContainerRuntimeEvents } from "@fluidframework/container-runtime-definitions/internal";
9
9
  import { IEventProvider } from "@fluidframework/core-interfaces";
10
10
  import { assert } from "@fluidframework/core-utils/internal";
11
- import { isRuntimeMessage } from "@fluidframework/driver-utils/internal";
12
11
  import {
13
12
  IDocumentMessage,
14
- ISequencedDocumentMessage,
15
13
  MessageType,
16
- } from "@fluidframework/protocol-definitions";
14
+ ISequencedDocumentMessage,
15
+ } from "@fluidframework/driver-definitions/internal";
16
+ import { isRuntimeMessage } from "@fluidframework/driver-utils/internal";
17
17
  import {
18
18
  IEventSampler,
19
19
  ITelemetryLoggerExt,
@@ -95,6 +95,13 @@ class OpPerfTelemetry {
95
95
  private readonly deltaLatencyLogger: ISampledTelemetryLogger;
96
96
 
97
97
  private static readonly PROCESSED_OPS_SAMPLE_RATE = 500;
98
+
99
+ /**
100
+ * A sampled logger to log Ops that have been processed by the current client, the NoOp sent and the
101
+ * size of the ops processed within one sampling window of this log event.
102
+ * The data from this logger will be used to monitor the efficiency of NoOp-heuristics or to get approximate collab window size.
103
+ * Note: no log events are sent when sampling is disabled, because logging at every op will be too noisy.
104
+ */
98
105
  private readonly opsLogger: ISampledTelemetryLogger;
99
106
 
100
107
  /**
@@ -134,8 +141,7 @@ class OpPerfTelemetry {
134
141
  return {
135
142
  sample: () => {
136
143
  eventCount++;
137
- const shouldSample =
138
- eventCount % OpPerfTelemetry.DELTA_LATENCY_SAMPLE_RATE === 0;
144
+ const shouldSample = eventCount % OpPerfTelemetry.DELTA_LATENCY_SAMPLE_RATE === 0;
139
145
  if (shouldSample) {
140
146
  eventCount = 0;
141
147
  }
@@ -156,8 +162,7 @@ class OpPerfTelemetry {
156
162
  return {
157
163
  sample: () => {
158
164
  eventCount++;
159
- const shouldSample =
160
- eventCount % OpPerfTelemetry.PROCESSED_OPS_SAMPLE_RATE === 0;
165
+ const shouldSample = eventCount % OpPerfTelemetry.PROCESSED_OPS_SAMPLE_RATE === 0;
161
166
  if (shouldSample) {
162
167
  eventCount = 0;
163
168
  this.noOpCountForTelemetry = 0;
@@ -167,7 +172,11 @@ class OpPerfTelemetry {
167
172
  },
168
173
  };
169
174
  })();
170
- this.opsLogger = createSampledLogger(logger, opsEventSampler);
175
+ this.opsLogger = createSampledLogger(
176
+ logger,
177
+ opsEventSampler,
178
+ true /* skipLoggingWhenSamplingIsDisabled */,
179
+ );
171
180
 
172
181
  this.deltaManager.on("pong", (latency) => this.recordPingTime(latency));
173
182
  this.deltaManager.on("submitOp", (message) => this.beforeOpSubmit(message));
@@ -201,10 +210,7 @@ class OpPerfTelemetry {
201
210
  ) {
202
211
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
203
212
  const latencyStats = this.latencyStatistics.get(msg.clientSequenceNumber)!;
204
- assert(
205
- latencyStats !== undefined,
206
- 0x7c2 /* Latency stats for op should exist */,
207
- );
213
+ assert(latencyStats !== undefined, 0x7c2 /* Latency stats for op should exist */);
208
214
  assert(
209
215
  latencyStats.opProcessingTimes.outboundPushEventTime === undefined,
210
216
  0x2c8 /* "outboundPushEventTime should be undefined" */,
@@ -4,7 +4,8 @@
4
4
  */
5
5
 
6
6
  import { AttachState } from "@fluidframework/container-definitions";
7
- import { IFluidHandleContext, IRequest, IResponse } from "@fluidframework/core-interfaces";
7
+ import { IRequest, IResponse } from "@fluidframework/core-interfaces";
8
+ import { IFluidHandleContext } from "@fluidframework/core-interfaces/internal";
8
9
  import { generateHandleContextPath } from "@fluidframework/runtime-utils/internal";
9
10
 
10
11
  import { ContainerRuntime } from "./containerRuntime.js";