@fluidframework/container-runtime 2.0.0-dev.3.1.0.125672 → 2.0.0-dev.4.2.0.153917

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 (486) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +69 -0
  3. package/dist/blobManager.d.ts +29 -24
  4. package/dist/blobManager.d.ts.map +1 -1
  5. package/dist/blobManager.js +162 -92
  6. package/dist/blobManager.js.map +1 -1
  7. package/dist/containerRuntime.d.ts +74 -76
  8. package/dist/containerRuntime.d.ts.map +1 -1
  9. package/dist/containerRuntime.js +328 -264
  10. package/dist/containerRuntime.js.map +1 -1
  11. package/dist/dataStoreContext.d.ts +39 -13
  12. package/dist/dataStoreContext.d.ts.map +1 -1
  13. package/dist/dataStoreContext.js +112 -49
  14. package/dist/dataStoreContext.js.map +1 -1
  15. package/dist/dataStores.d.ts +28 -4
  16. package/dist/dataStores.d.ts.map +1 -1
  17. package/dist/dataStores.js +107 -41
  18. package/dist/dataStores.js.map +1 -1
  19. package/dist/deltaManagerSummarizerProxy.d.ts +19 -0
  20. package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -0
  21. package/dist/deltaManagerSummarizerProxy.js +40 -0
  22. package/dist/deltaManagerSummarizerProxy.js.map +1 -0
  23. package/dist/gc/garbageCollection.d.ts +204 -0
  24. package/dist/gc/garbageCollection.d.ts.map +1 -0
  25. package/dist/{garbageCollection.js → gc/garbageCollection.js} +190 -554
  26. package/dist/gc/garbageCollection.js.map +1 -0
  27. package/dist/gc/gcConfigs.d.ts +22 -0
  28. package/dist/gc/gcConfigs.d.ts.map +1 -0
  29. package/dist/gc/gcConfigs.js +143 -0
  30. package/dist/gc/gcConfigs.js.map +1 -0
  31. package/dist/gc/gcDefinitions.d.ts +320 -0
  32. package/dist/gc/gcDefinitions.d.ts.map +1 -0
  33. package/dist/gc/gcDefinitions.js +81 -0
  34. package/dist/gc/gcDefinitions.js.map +1 -0
  35. package/dist/gc/gcHelpers.d.ts +86 -0
  36. package/dist/gc/gcHelpers.d.ts.map +1 -0
  37. package/dist/gc/gcHelpers.js +268 -0
  38. package/dist/gc/gcHelpers.js.map +1 -0
  39. package/dist/gc/gcReferenceGraphAlgorithm.d.ts +16 -0
  40. package/dist/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -0
  41. package/dist/gc/gcReferenceGraphAlgorithm.js +49 -0
  42. package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -0
  43. package/dist/gc/gcSummaryDefinitions.d.ts +52 -0
  44. package/dist/gc/gcSummaryDefinitions.d.ts.map +1 -0
  45. package/dist/gc/gcSummaryDefinitions.js +7 -0
  46. package/dist/gc/gcSummaryDefinitions.js.map +1 -0
  47. package/dist/gc/gcSummaryStateTracker.d.ts +93 -0
  48. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -0
  49. package/dist/gc/gcSummaryStateTracker.js +239 -0
  50. package/dist/gc/gcSummaryStateTracker.js.map +1 -0
  51. package/dist/gc/gcSweepReadyUsageDetection.d.ts.map +1 -0
  52. package/dist/{gcSweepReadyUsageDetection.js → gc/gcSweepReadyUsageDetection.js} +2 -2
  53. package/dist/gc/gcSweepReadyUsageDetection.js.map +1 -0
  54. package/dist/gc/gcUnreferencedStateTracker.d.ts +34 -0
  55. package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -0
  56. package/dist/gc/gcUnreferencedStateTracker.js +94 -0
  57. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -0
  58. package/dist/gc/index.d.ts +13 -0
  59. package/dist/gc/index.d.ts.map +1 -0
  60. package/dist/gc/index.js +50 -0
  61. package/dist/gc/index.js.map +1 -0
  62. package/dist/index.d.ts +3 -7
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +5 -9
  65. package/dist/index.js.map +1 -1
  66. package/dist/opLifecycle/batchManager.d.ts +11 -13
  67. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  68. package/dist/opLifecycle/batchManager.js +26 -38
  69. package/dist/opLifecycle/batchManager.js.map +1 -1
  70. package/dist/opLifecycle/definitions.d.ts +4 -0
  71. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  72. package/dist/opLifecycle/definitions.js.map +1 -1
  73. package/dist/opLifecycle/index.d.ts +2 -1
  74. package/dist/opLifecycle/index.d.ts.map +1 -1
  75. package/dist/opLifecycle/index.js +4 -1
  76. package/dist/opLifecycle/index.js.map +1 -1
  77. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  78. package/dist/opLifecycle/opCompressor.js +25 -10
  79. package/dist/opLifecycle/opCompressor.js.map +1 -1
  80. package/dist/opLifecycle/opDecompressor.d.ts +4 -0
  81. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  82. package/dist/opLifecycle/opDecompressor.js +43 -4
  83. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  84. package/dist/opLifecycle/opGroupingManager.d.ts +14 -0
  85. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -0
  86. package/dist/opLifecycle/opGroupingManager.js +56 -0
  87. package/dist/opLifecycle/opGroupingManager.js.map +1 -0
  88. package/dist/opLifecycle/opSplitter.d.ts +16 -4
  89. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  90. package/dist/opLifecycle/opSplitter.js +39 -15
  91. package/dist/opLifecycle/opSplitter.js.map +1 -1
  92. package/dist/opLifecycle/outbox.d.ts +21 -3
  93. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  94. package/dist/opLifecycle/outbox.js +90 -51
  95. package/dist/opLifecycle/outbox.js.map +1 -1
  96. package/dist/opLifecycle/remoteMessageProcessor.d.ts +4 -2
  97. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  98. package/dist/opLifecycle/remoteMessageProcessor.js +30 -20
  99. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  100. package/dist/packageVersion.d.ts +1 -1
  101. package/dist/packageVersion.js +1 -1
  102. package/dist/packageVersion.js.map +1 -1
  103. package/dist/pendingStateManager.d.ts +3 -3
  104. package/dist/pendingStateManager.d.ts.map +1 -1
  105. package/dist/pendingStateManager.js +20 -21
  106. package/dist/pendingStateManager.js.map +1 -1
  107. package/dist/storageServiceWithAttachBlobs.d.ts +17 -0
  108. package/dist/storageServiceWithAttachBlobs.d.ts.map +1 -0
  109. package/dist/storageServiceWithAttachBlobs.js +32 -0
  110. package/dist/storageServiceWithAttachBlobs.js.map +1 -0
  111. package/dist/summary/index.d.ts +17 -0
  112. package/dist/summary/index.d.ts.map +1 -0
  113. package/dist/summary/index.js +48 -0
  114. package/dist/summary/index.js.map +1 -0
  115. package/dist/summary/orderedClientElection.d.ts.map +1 -0
  116. package/dist/summary/orderedClientElection.js.map +1 -0
  117. package/dist/{runWhileConnectedCoordinator.d.ts → summary/runWhileConnectedCoordinator.d.ts} +3 -2
  118. package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -0
  119. package/dist/{runWhileConnectedCoordinator.js → summary/runWhileConnectedCoordinator.js} +5 -4
  120. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -0
  121. package/{lib → dist/summary}/runningSummarizer.d.ts +23 -20
  122. package/dist/summary/runningSummarizer.d.ts.map +1 -0
  123. package/dist/{runningSummarizer.js → summary/runningSummarizer.js} +191 -74
  124. package/dist/summary/runningSummarizer.js.map +1 -0
  125. package/dist/{summarizer.d.ts → summary/summarizer.d.ts} +4 -9
  126. package/dist/summary/summarizer.d.ts.map +1 -0
  127. package/dist/{summarizer.js → summary/summarizer.js} +10 -79
  128. package/dist/summary/summarizer.js.map +1 -0
  129. package/dist/summary/summarizerClientElection.d.ts.map +1 -0
  130. package/dist/summary/summarizerClientElection.js.map +1 -0
  131. package/dist/{summarizerHeuristics.d.ts → summary/summarizerHeuristics.d.ts} +2 -1
  132. package/dist/summary/summarizerHeuristics.d.ts.map +1 -0
  133. package/dist/{summarizerHeuristics.js → summary/summarizerHeuristics.js} +6 -3
  134. package/dist/summary/summarizerHeuristics.js.map +1 -0
  135. package/dist/summary/summarizerNode/index.d.ts +8 -0
  136. package/dist/summary/summarizerNode/index.d.ts.map +1 -0
  137. package/dist/summary/summarizerNode/index.js +12 -0
  138. package/dist/summary/summarizerNode/index.js.map +1 -0
  139. package/dist/summary/summarizerNode/summarizerNode.d.ts +149 -0
  140. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -0
  141. package/dist/summary/summarizerNode/summarizerNode.js +531 -0
  142. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -0
  143. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +125 -0
  144. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -0
  145. package/dist/summary/summarizerNode/summarizerNodeUtils.js +132 -0
  146. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -0
  147. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +148 -0
  148. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -0
  149. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +424 -0
  150. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -0
  151. package/{lib → dist/summary}/summarizerTypes.d.ts +21 -19
  152. package/dist/summary/summarizerTypes.d.ts.map +1 -0
  153. package/dist/{summarizerTypes.js → summary/summarizerTypes.js} +0 -5
  154. package/dist/summary/summarizerTypes.js.map +1 -0
  155. package/dist/summary/summaryCollection.d.ts.map +1 -0
  156. package/dist/summary/summaryCollection.js.map +1 -0
  157. package/{lib → dist/summary}/summaryFormat.d.ts +3 -21
  158. package/dist/summary/summaryFormat.d.ts.map +1 -0
  159. package/dist/{summaryFormat.js → summary/summaryFormat.js} +1 -10
  160. package/dist/summary/summaryFormat.js.map +1 -0
  161. package/{lib → dist/summary}/summaryGenerator.d.ts +28 -2
  162. package/dist/summary/summaryGenerator.d.ts.map +1 -0
  163. package/dist/{summaryGenerator.js → summary/summaryGenerator.js} +23 -20
  164. package/dist/summary/summaryGenerator.js.map +1 -0
  165. package/dist/{summaryManager.d.ts → summary/summaryManager.d.ts} +1 -1
  166. package/dist/summary/summaryManager.d.ts.map +1 -0
  167. package/dist/summary/summaryManager.js.map +1 -0
  168. package/lib/blobManager.d.ts +29 -24
  169. package/lib/blobManager.d.ts.map +1 -1
  170. package/lib/blobManager.js +159 -89
  171. package/lib/blobManager.js.map +1 -1
  172. package/lib/containerRuntime.d.ts +74 -76
  173. package/lib/containerRuntime.d.ts.map +1 -1
  174. package/lib/containerRuntime.js +301 -237
  175. package/lib/containerRuntime.js.map +1 -1
  176. package/lib/dataStoreContext.d.ts +39 -13
  177. package/lib/dataStoreContext.d.ts.map +1 -1
  178. package/lib/dataStoreContext.js +101 -38
  179. package/lib/dataStoreContext.js.map +1 -1
  180. package/lib/dataStores.d.ts +28 -4
  181. package/lib/dataStores.d.ts.map +1 -1
  182. package/lib/dataStores.js +100 -34
  183. package/lib/dataStores.js.map +1 -1
  184. package/lib/deltaManagerSummarizerProxy.d.ts +19 -0
  185. package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -0
  186. package/lib/deltaManagerSummarizerProxy.js +36 -0
  187. package/lib/deltaManagerSummarizerProxy.js.map +1 -0
  188. package/lib/gc/garbageCollection.d.ts +204 -0
  189. package/lib/gc/garbageCollection.d.ts.map +1 -0
  190. package/lib/{garbageCollection.js → gc/garbageCollection.js} +172 -535
  191. package/lib/gc/garbageCollection.js.map +1 -0
  192. package/lib/gc/gcConfigs.d.ts +22 -0
  193. package/lib/gc/gcConfigs.d.ts.map +1 -0
  194. package/lib/gc/gcConfigs.js +139 -0
  195. package/lib/gc/gcConfigs.js.map +1 -0
  196. package/lib/gc/gcDefinitions.d.ts +320 -0
  197. package/lib/gc/gcDefinitions.d.ts.map +1 -0
  198. package/lib/gc/gcDefinitions.js +78 -0
  199. package/lib/gc/gcDefinitions.js.map +1 -0
  200. package/lib/gc/gcHelpers.d.ts +86 -0
  201. package/lib/gc/gcHelpers.d.ts.map +1 -0
  202. package/lib/gc/gcHelpers.js +254 -0
  203. package/lib/gc/gcHelpers.js.map +1 -0
  204. package/lib/gc/gcReferenceGraphAlgorithm.d.ts +16 -0
  205. package/lib/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -0
  206. package/lib/gc/gcReferenceGraphAlgorithm.js +45 -0
  207. package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -0
  208. package/lib/gc/gcSummaryDefinitions.d.ts +52 -0
  209. package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -0
  210. package/lib/gc/gcSummaryDefinitions.js +6 -0
  211. package/lib/gc/gcSummaryDefinitions.js.map +1 -0
  212. package/lib/gc/gcSummaryStateTracker.d.ts +93 -0
  213. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -0
  214. package/lib/gc/gcSummaryStateTracker.js +235 -0
  215. package/lib/gc/gcSummaryStateTracker.js.map +1 -0
  216. package/lib/gc/gcSweepReadyUsageDetection.d.ts.map +1 -0
  217. package/lib/{gcSweepReadyUsageDetection.js → gc/gcSweepReadyUsageDetection.js} +1 -1
  218. package/lib/gc/gcSweepReadyUsageDetection.js.map +1 -0
  219. package/lib/gc/gcUnreferencedStateTracker.d.ts +34 -0
  220. package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -0
  221. package/lib/gc/gcUnreferencedStateTracker.js +90 -0
  222. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -0
  223. package/lib/gc/index.d.ts +13 -0
  224. package/lib/gc/index.d.ts.map +1 -0
  225. package/lib/gc/index.js +12 -0
  226. package/lib/gc/index.js.map +1 -0
  227. package/lib/index.d.ts +3 -7
  228. package/lib/index.d.ts.map +1 -1
  229. package/lib/index.js +1 -4
  230. package/lib/index.js.map +1 -1
  231. package/lib/opLifecycle/batchManager.d.ts +11 -13
  232. package/lib/opLifecycle/batchManager.d.ts.map +1 -1
  233. package/lib/opLifecycle/batchManager.js +24 -37
  234. package/lib/opLifecycle/batchManager.js.map +1 -1
  235. package/lib/opLifecycle/definitions.d.ts +4 -0
  236. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  237. package/lib/opLifecycle/definitions.js.map +1 -1
  238. package/lib/opLifecycle/index.d.ts +2 -1
  239. package/lib/opLifecycle/index.d.ts.map +1 -1
  240. package/lib/opLifecycle/index.js +2 -1
  241. package/lib/opLifecycle/index.js.map +1 -1
  242. package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
  243. package/lib/opLifecycle/opCompressor.js +26 -11
  244. package/lib/opLifecycle/opCompressor.js.map +1 -1
  245. package/lib/opLifecycle/opDecompressor.d.ts +4 -0
  246. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  247. package/lib/opLifecycle/opDecompressor.js +43 -4
  248. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  249. package/lib/opLifecycle/opGroupingManager.d.ts +14 -0
  250. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -0
  251. package/lib/opLifecycle/opGroupingManager.js +52 -0
  252. package/lib/opLifecycle/opGroupingManager.js.map +1 -0
  253. package/lib/opLifecycle/opSplitter.d.ts +16 -4
  254. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  255. package/lib/opLifecycle/opSplitter.js +39 -15
  256. package/lib/opLifecycle/opSplitter.js.map +1 -1
  257. package/lib/opLifecycle/outbox.d.ts +21 -3
  258. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  259. package/lib/opLifecycle/outbox.js +92 -53
  260. package/lib/opLifecycle/outbox.js.map +1 -1
  261. package/lib/opLifecycle/remoteMessageProcessor.d.ts +4 -2
  262. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  263. package/lib/opLifecycle/remoteMessageProcessor.js +30 -20
  264. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  265. package/lib/packageVersion.d.ts +1 -1
  266. package/lib/packageVersion.js +1 -1
  267. package/lib/packageVersion.js.map +1 -1
  268. package/lib/pendingStateManager.d.ts +3 -3
  269. package/lib/pendingStateManager.d.ts.map +1 -1
  270. package/lib/pendingStateManager.js +20 -21
  271. package/lib/pendingStateManager.js.map +1 -1
  272. package/lib/storageServiceWithAttachBlobs.d.ts +17 -0
  273. package/lib/storageServiceWithAttachBlobs.d.ts.map +1 -0
  274. package/lib/storageServiceWithAttachBlobs.js +28 -0
  275. package/lib/storageServiceWithAttachBlobs.js.map +1 -0
  276. package/lib/summary/index.d.ts +17 -0
  277. package/lib/summary/index.d.ts.map +1 -0
  278. package/lib/summary/index.js +16 -0
  279. package/lib/summary/index.js.map +1 -0
  280. package/lib/summary/orderedClientElection.d.ts.map +1 -0
  281. package/lib/summary/orderedClientElection.js.map +1 -0
  282. package/lib/{runWhileConnectedCoordinator.d.ts → summary/runWhileConnectedCoordinator.d.ts} +3 -2
  283. package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -0
  284. package/lib/{runWhileConnectedCoordinator.js → summary/runWhileConnectedCoordinator.js} +5 -4
  285. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -0
  286. package/{dist → lib/summary}/runningSummarizer.d.ts +23 -20
  287. package/lib/summary/runningSummarizer.d.ts.map +1 -0
  288. package/lib/{runningSummarizer.js → summary/runningSummarizer.js} +192 -75
  289. package/lib/summary/runningSummarizer.js.map +1 -0
  290. package/lib/{summarizer.d.ts → summary/summarizer.d.ts} +4 -9
  291. package/lib/summary/summarizer.d.ts.map +1 -0
  292. package/lib/{summarizer.js → summary/summarizer.js} +12 -81
  293. package/lib/summary/summarizer.js.map +1 -0
  294. package/lib/summary/summarizerClientElection.d.ts.map +1 -0
  295. package/lib/summary/summarizerClientElection.js.map +1 -0
  296. package/lib/{summarizerHeuristics.d.ts → summary/summarizerHeuristics.d.ts} +2 -1
  297. package/lib/summary/summarizerHeuristics.d.ts.map +1 -0
  298. package/lib/{summarizerHeuristics.js → summary/summarizerHeuristics.js} +6 -3
  299. package/lib/summary/summarizerHeuristics.js.map +1 -0
  300. package/lib/summary/summarizerNode/index.d.ts +8 -0
  301. package/lib/summary/summarizerNode/index.d.ts.map +1 -0
  302. package/lib/summary/summarizerNode/index.js +7 -0
  303. package/lib/summary/summarizerNode/index.js.map +1 -0
  304. package/lib/summary/summarizerNode/summarizerNode.d.ts +149 -0
  305. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -0
  306. package/lib/summary/summarizerNode/summarizerNode.js +526 -0
  307. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -0
  308. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +125 -0
  309. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -0
  310. package/lib/summary/summarizerNode/summarizerNodeUtils.js +125 -0
  311. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -0
  312. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +148 -0
  313. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -0
  314. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +419 -0
  315. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -0
  316. package/{dist → lib/summary}/summarizerTypes.d.ts +21 -19
  317. package/lib/summary/summarizerTypes.d.ts.map +1 -0
  318. package/lib/summary/summarizerTypes.js +6 -0
  319. package/lib/summary/summarizerTypes.js.map +1 -0
  320. package/lib/summary/summaryCollection.d.ts.map +1 -0
  321. package/lib/summary/summaryCollection.js.map +1 -0
  322. package/{dist → lib/summary}/summaryFormat.d.ts +3 -21
  323. package/lib/summary/summaryFormat.d.ts.map +1 -0
  324. package/lib/{summaryFormat.js → summary/summaryFormat.js} +0 -8
  325. package/lib/summary/summaryFormat.js.map +1 -0
  326. package/{dist → lib/summary}/summaryGenerator.d.ts +28 -2
  327. package/lib/summary/summaryGenerator.d.ts.map +1 -0
  328. package/lib/{summaryGenerator.js → summary/summaryGenerator.js} +21 -19
  329. package/lib/summary/summaryGenerator.js.map +1 -0
  330. package/lib/{summaryManager.d.ts → summary/summaryManager.d.ts} +1 -1
  331. package/lib/summary/summaryManager.d.ts.map +1 -0
  332. package/lib/summary/summaryManager.js.map +1 -0
  333. package/package.json +66 -60
  334. package/src/blobManager.ts +196 -110
  335. package/src/containerRuntime.ts +491 -391
  336. package/src/dataStoreContext.ts +140 -49
  337. package/src/dataStores.ts +139 -41
  338. package/src/deltaManagerSummarizerProxy.ts +46 -0
  339. package/{garbageCollection.md → src/gc/garbageCollection.md} +2 -2
  340. package/src/{garbageCollection.ts → gc/garbageCollection.ts} +245 -890
  341. package/src/gc/gcConfigs.ts +193 -0
  342. package/src/gc/gcDefinitions.ts +387 -0
  343. package/src/gc/gcHelpers.ts +335 -0
  344. package/src/gc/gcReferenceGraphAlgorithm.ts +52 -0
  345. package/src/gc/gcSummaryDefinitions.ts +54 -0
  346. package/src/gc/gcSummaryStateTracker.ts +329 -0
  347. package/src/{gcSweepReadyUsageDetection.ts → gc/gcSweepReadyUsageDetection.ts} +1 -1
  348. package/src/gc/gcUnreferencedStateTracker.ts +114 -0
  349. package/src/gc/index.ts +65 -0
  350. package/src/index.ts +10 -22
  351. package/src/opLifecycle/README.md +263 -0
  352. package/src/opLifecycle/batchManager.ts +26 -55
  353. package/src/opLifecycle/definitions.ts +4 -0
  354. package/src/opLifecycle/index.ts +2 -1
  355. package/src/opLifecycle/opCompressor.ts +32 -12
  356. package/src/opLifecycle/opDecompressor.ts +50 -5
  357. package/src/opLifecycle/opGroupingManager.ts +78 -0
  358. package/src/opLifecycle/opSplitter.ts +56 -17
  359. package/src/opLifecycle/outbox.ts +126 -62
  360. package/src/opLifecycle/remoteMessageProcessor.ts +38 -22
  361. package/src/packageVersion.ts +1 -1
  362. package/src/pendingStateManager.ts +34 -27
  363. package/src/storageServiceWithAttachBlobs.ts +38 -0
  364. package/src/summary/index.ts +105 -0
  365. package/src/{runWhileConnectedCoordinator.ts → summary/runWhileConnectedCoordinator.ts} +7 -7
  366. package/src/{runningSummarizer.ts → summary/runningSummarizer.ts} +318 -156
  367. package/src/{summarizer.ts → summary/summarizer.ts} +12 -105
  368. package/src/{summarizerHeuristics.ts → summary/summarizerHeuristics.ts} +13 -4
  369. package/src/summary/summarizerNode/index.ts +12 -0
  370. package/src/summary/summarizerNode/summarizerNode.ts +766 -0
  371. package/src/summary/summarizerNode/summarizerNodeUtils.ts +214 -0
  372. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +644 -0
  373. package/src/{summarizerTypes.ts → summary/summarizerTypes.ts} +28 -25
  374. package/src/{summaryFormat.ts → summary/summaryFormat.ts} +3 -29
  375. package/src/{summaryGenerator.ts → summary/summaryGenerator.ts} +34 -27
  376. package/src/{summaryManager.ts → summary/summaryManager.ts} +1 -1
  377. package/dist/garbageCollection.d.ts +0 -411
  378. package/dist/garbageCollection.d.ts.map +0 -1
  379. package/dist/garbageCollection.js.map +0 -1
  380. package/dist/garbageCollectionConstants.d.ts +0 -23
  381. package/dist/garbageCollectionConstants.d.ts.map +0 -1
  382. package/dist/garbageCollectionConstants.js +0 -36
  383. package/dist/garbageCollectionConstants.js.map +0 -1
  384. package/dist/garbageCollectionHelpers.d.ts +0 -15
  385. package/dist/garbageCollectionHelpers.d.ts.map +0 -1
  386. package/dist/garbageCollectionHelpers.js +0 -27
  387. package/dist/garbageCollectionHelpers.js.map +0 -1
  388. package/dist/gcSweepReadyUsageDetection.d.ts.map +0 -1
  389. package/dist/gcSweepReadyUsageDetection.js.map +0 -1
  390. package/dist/orderedClientElection.d.ts.map +0 -1
  391. package/dist/orderedClientElection.js.map +0 -1
  392. package/dist/runWhileConnectedCoordinator.d.ts.map +0 -1
  393. package/dist/runWhileConnectedCoordinator.js.map +0 -1
  394. package/dist/runningSummarizer.d.ts.map +0 -1
  395. package/dist/runningSummarizer.js.map +0 -1
  396. package/dist/serializedSnapshotStorage.d.ts +0 -58
  397. package/dist/serializedSnapshotStorage.d.ts.map +0 -1
  398. package/dist/serializedSnapshotStorage.js +0 -110
  399. package/dist/serializedSnapshotStorage.js.map +0 -1
  400. package/dist/summarizer.d.ts.map +0 -1
  401. package/dist/summarizer.js.map +0 -1
  402. package/dist/summarizerClientElection.d.ts.map +0 -1
  403. package/dist/summarizerClientElection.js.map +0 -1
  404. package/dist/summarizerHandle.d.ts +0 -12
  405. package/dist/summarizerHandle.d.ts.map +0 -1
  406. package/dist/summarizerHandle.js +0 -22
  407. package/dist/summarizerHandle.js.map +0 -1
  408. package/dist/summarizerHeuristics.d.ts.map +0 -1
  409. package/dist/summarizerHeuristics.js.map +0 -1
  410. package/dist/summarizerTypes.d.ts.map +0 -1
  411. package/dist/summarizerTypes.js.map +0 -1
  412. package/dist/summaryCollection.d.ts.map +0 -1
  413. package/dist/summaryCollection.js.map +0 -1
  414. package/dist/summaryFormat.d.ts.map +0 -1
  415. package/dist/summaryFormat.js.map +0 -1
  416. package/dist/summaryGenerator.d.ts.map +0 -1
  417. package/dist/summaryGenerator.js.map +0 -1
  418. package/dist/summaryManager.d.ts.map +0 -1
  419. package/dist/summaryManager.js.map +0 -1
  420. package/lib/garbageCollection.d.ts +0 -411
  421. package/lib/garbageCollection.d.ts.map +0 -1
  422. package/lib/garbageCollection.js.map +0 -1
  423. package/lib/garbageCollectionConstants.d.ts +0 -23
  424. package/lib/garbageCollectionConstants.d.ts.map +0 -1
  425. package/lib/garbageCollectionConstants.js +0 -33
  426. package/lib/garbageCollectionConstants.js.map +0 -1
  427. package/lib/garbageCollectionHelpers.d.ts +0 -15
  428. package/lib/garbageCollectionHelpers.d.ts.map +0 -1
  429. package/lib/garbageCollectionHelpers.js +0 -23
  430. package/lib/garbageCollectionHelpers.js.map +0 -1
  431. package/lib/gcSweepReadyUsageDetection.d.ts.map +0 -1
  432. package/lib/gcSweepReadyUsageDetection.js.map +0 -1
  433. package/lib/orderedClientElection.d.ts.map +0 -1
  434. package/lib/orderedClientElection.js.map +0 -1
  435. package/lib/runWhileConnectedCoordinator.d.ts.map +0 -1
  436. package/lib/runWhileConnectedCoordinator.js.map +0 -1
  437. package/lib/runningSummarizer.d.ts.map +0 -1
  438. package/lib/runningSummarizer.js.map +0 -1
  439. package/lib/serializedSnapshotStorage.d.ts +0 -58
  440. package/lib/serializedSnapshotStorage.d.ts.map +0 -1
  441. package/lib/serializedSnapshotStorage.js +0 -106
  442. package/lib/serializedSnapshotStorage.js.map +0 -1
  443. package/lib/summarizer.d.ts.map +0 -1
  444. package/lib/summarizer.js.map +0 -1
  445. package/lib/summarizerClientElection.d.ts.map +0 -1
  446. package/lib/summarizerClientElection.js.map +0 -1
  447. package/lib/summarizerHandle.d.ts +0 -12
  448. package/lib/summarizerHandle.d.ts.map +0 -1
  449. package/lib/summarizerHandle.js +0 -18
  450. package/lib/summarizerHandle.js.map +0 -1
  451. package/lib/summarizerHeuristics.d.ts.map +0 -1
  452. package/lib/summarizerHeuristics.js.map +0 -1
  453. package/lib/summarizerTypes.d.ts.map +0 -1
  454. package/lib/summarizerTypes.js +0 -9
  455. package/lib/summarizerTypes.js.map +0 -1
  456. package/lib/summaryCollection.d.ts.map +0 -1
  457. package/lib/summaryCollection.js.map +0 -1
  458. package/lib/summaryFormat.d.ts.map +0 -1
  459. package/lib/summaryFormat.js.map +0 -1
  460. package/lib/summaryGenerator.d.ts.map +0 -1
  461. package/lib/summaryGenerator.js.map +0 -1
  462. package/lib/summaryManager.d.ts.map +0 -1
  463. package/lib/summaryManager.js.map +0 -1
  464. package/src/garbageCollectionConstants.ts +0 -38
  465. package/src/garbageCollectionHelpers.ts +0 -37
  466. package/src/serializedSnapshotStorage.ts +0 -151
  467. package/src/summarizerHandle.ts +0 -23
  468. /package/dist/{gcSweepReadyUsageDetection.d.ts → gc/gcSweepReadyUsageDetection.d.ts} +0 -0
  469. /package/dist/{orderedClientElection.d.ts → summary/orderedClientElection.d.ts} +0 -0
  470. /package/dist/{orderedClientElection.js → summary/orderedClientElection.js} +0 -0
  471. /package/dist/{summarizerClientElection.d.ts → summary/summarizerClientElection.d.ts} +0 -0
  472. /package/dist/{summarizerClientElection.js → summary/summarizerClientElection.js} +0 -0
  473. /package/dist/{summaryCollection.d.ts → summary/summaryCollection.d.ts} +0 -0
  474. /package/dist/{summaryCollection.js → summary/summaryCollection.js} +0 -0
  475. /package/dist/{summaryManager.js → summary/summaryManager.js} +0 -0
  476. /package/lib/{gcSweepReadyUsageDetection.d.ts → gc/gcSweepReadyUsageDetection.d.ts} +0 -0
  477. /package/lib/{orderedClientElection.d.ts → summary/orderedClientElection.d.ts} +0 -0
  478. /package/lib/{orderedClientElection.js → summary/orderedClientElection.js} +0 -0
  479. /package/lib/{summarizerClientElection.d.ts → summary/summarizerClientElection.d.ts} +0 -0
  480. /package/lib/{summarizerClientElection.js → summary/summarizerClientElection.js} +0 -0
  481. /package/lib/{summaryCollection.d.ts → summary/summaryCollection.d.ts} +0 -0
  482. /package/lib/{summaryCollection.js → summary/summaryCollection.js} +0 -0
  483. /package/lib/{summaryManager.js → summary/summaryManager.js} +0 -0
  484. /package/src/{orderedClientElection.ts → summary/orderedClientElection.ts} +0 -0
  485. /package/src/{summarizerClientElection.ts → summary/summarizerClientElection.ts} +0 -0
  486. /package/src/{summaryCollection.ts → summary/summaryCollection.ts} +0 -0
package/src/dataStores.ts CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  DataCorruptionError,
9
9
  extractSafePropertiesFromMessage,
10
10
  } from "@fluidframework/container-utils";
11
- import { IFluidHandle } from "@fluidframework/core-interfaces";
11
+ import { IFluidHandle, IRequest } from "@fluidframework/core-interfaces";
12
12
  import { FluidObjectHandle } from "@fluidframework/datastore";
13
13
  import { ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
14
14
  import {
@@ -21,7 +21,6 @@ import {
21
21
  IEnvelope,
22
22
  IFluidDataStoreContextDetached,
23
23
  IGarbageCollectionData,
24
- IGarbageCollectionDetailsBase,
25
24
  IInboundSignalMessage,
26
25
  InboundAttachMessage,
27
26
  ISummarizeResult,
@@ -33,8 +32,10 @@ import {
33
32
  convertToSummaryTree,
34
33
  create404Response,
35
34
  createResponseError,
35
+ GCDataBuilder,
36
36
  responseToException,
37
37
  SummaryTreeBuilder,
38
+ unpackChildNodesUsedRoutes,
38
39
  } from "@fluidframework/runtime-utils";
39
40
  import {
40
41
  ChildLogger,
@@ -44,14 +45,9 @@ import {
44
45
  TelemetryDataTag,
45
46
  } from "@fluidframework/telemetry-utils";
46
47
  import { AttachState } from "@fluidframework/container-definitions";
47
- import { BlobCacheStorageService, buildSnapshotTree } from "@fluidframework/driver-utils";
48
- import { assert, Lazy, LazyPromise } from "@fluidframework/common-utils";
48
+ import { buildSnapshotTree } from "@fluidframework/driver-utils";
49
+ import { assert, Lazy } from "@fluidframework/common-utils";
49
50
  import { v4 as uuid } from "uuid";
50
- import {
51
- GCDataBuilder,
52
- unpackChildNodesGCDetails,
53
- unpackChildNodesUsedRoutes,
54
- } from "@fluidframework/garbage-collector";
55
51
  import { DataStoreContexts } from "./dataStoreContexts";
56
52
  import {
57
53
  ContainerRuntime,
@@ -66,16 +62,20 @@ import {
66
62
  createAttributesBlob,
67
63
  LocalDetachedFluidDataStoreContext,
68
64
  } from "./dataStoreContext";
65
+ import { StorageServiceWithAttachBlobs } from "./storageServiceWithAttachBlobs";
66
+ import { IDataStoreAliasMessage, isDataStoreAliasMessage } from "./dataStore";
67
+ import {
68
+ GCNodeType,
69
+ sweepDatastoresKey,
70
+ throwOnTombstoneLoadKey,
71
+ sendGCUnexpectedUsageEvent,
72
+ } from "./gc";
69
73
  import {
74
+ summarizerClientType,
70
75
  IContainerRuntimeMetadata,
71
76
  nonDataStorePaths,
72
77
  rootHasIsolatedChannels,
73
- } from "./summaryFormat";
74
- import { IDataStoreAliasMessage, isDataStoreAliasMessage } from "./dataStore";
75
- import { GCNodeType } from "./garbageCollection";
76
- import { throwOnTombstoneLoadKey } from "./garbageCollectionConstants";
77
- import { summarizerClientType } from "./summarizerClientElection";
78
- import { sendGCUnexpectedUsageEvent } from "./garbageCollectionHelpers";
78
+ } from "./summary";
79
79
 
80
80
  type PendingAliasResolve = (success: boolean) => void;
81
81
 
@@ -123,12 +123,12 @@ export class DataStores implements IDisposable {
123
123
  ) => CreateChildSummarizerNodeFn,
124
124
  private readonly deleteChildSummarizerNodeFn: (id: string) => void,
125
125
  baseLogger: ITelemetryBaseLogger,
126
- getBaseGCDetails: () => Promise<IGarbageCollectionDetailsBase>,
127
126
  private readonly gcNodeUpdated: (
128
127
  nodePath: string,
129
128
  timestampMs: number,
130
129
  packagePath?: readonly string[],
131
130
  ) => void,
131
+ private readonly isDataStoreDeleted: (nodePath: string) => boolean,
132
132
  private readonly aliasMap: Map<string, string>,
133
133
  private readonly contexts: DataStoreContexts = new DataStoreContexts(baseLogger),
134
134
  ) {
@@ -139,18 +139,10 @@ export class DataStores implements IDisposable {
139
139
  this.runtime.IFluidHandleContext,
140
140
  );
141
141
 
142
- const baseGCDetailsP = new LazyPromise(async () => {
143
- const baseGCDetails = await getBaseGCDetails();
144
- return unpackChildNodesGCDetails(baseGCDetails);
145
- });
146
- // Returns the base GC details for the data store with the given id.
147
- const dataStoreBaseGCDetails = async (dataStoreId: string) => {
148
- const baseGCDetails = await baseGCDetailsP;
149
- return baseGCDetails.get(dataStoreId);
150
- };
151
142
  // Tombstone should only throw when the feature flag is enabled and the client isn't a summarizer
152
143
  this.throwOnTombstoneLoad =
153
144
  this.mc.config.getBoolean(throwOnTombstoneLoadKey) === true &&
145
+ this.runtime.gcTombstoneEnforcementAllowed &&
154
146
  this.runtime.clientDetails.type !== summarizerClientType;
155
147
 
156
148
  // Extract stores stored inside the snapshot
@@ -175,7 +167,6 @@ export class DataStores implements IDisposable {
175
167
  dataStoreContext = new RemoteFluidDataStoreContext({
176
168
  id: key,
177
169
  snapshotTree: value,
178
- getBaseGCDetails: async () => dataStoreBaseGCDetails(key),
179
170
  runtime: this.runtime,
180
171
  storage: this.runtime.storage,
181
172
  scope: this.runtime.scope,
@@ -256,10 +247,10 @@ export class DataStores implements IDisposable {
256
247
  throw error;
257
248
  }
258
249
 
259
- const flatBlobs = new Map<string, ArrayBufferLike>();
250
+ const flatAttachBlobs = new Map<string, ArrayBufferLike>();
260
251
  let snapshotTree: ISnapshotTree | undefined;
261
252
  if (attachMessage.snapshot) {
262
- snapshotTree = buildSnapshotTree(attachMessage.snapshot.entries, flatBlobs);
253
+ snapshotTree = buildSnapshotTree(attachMessage.snapshot.entries, flatAttachBlobs);
263
254
  }
264
255
 
265
256
  // Include the type of attach message which is the pkg of the store to be
@@ -268,12 +259,8 @@ export class DataStores implements IDisposable {
268
259
  const remoteFluidDataStoreContext = new RemoteFluidDataStoreContext({
269
260
  id: attachMessage.id,
270
261
  snapshotTree,
271
- // New data stores begin with empty GC details since GC hasn't run on them yet.
272
- getBaseGCDetails: async () => {
273
- return {};
274
- },
275
262
  runtime: this.runtime,
276
- storage: new BlobCacheStorageService(this.runtime.storage, flatBlobs),
263
+ storage: new StorageServiceWithAttachBlobs(this.runtime.storage, flatAttachBlobs),
277
264
  scope: this.runtime.scope,
278
265
  createSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(attachMessage.id, {
279
266
  type: CreateSummarizerNodeSource.FromAttach,
@@ -446,6 +433,8 @@ export class DataStores implements IDisposable {
446
433
  ) {
447
434
  const envelope = message.contents as IEnvelope;
448
435
  const transformed = { ...message, contents: envelope.contents };
436
+ const request = { url: envelope.address };
437
+ this.validateNotDeleted(envelope.address, request);
449
438
  const context = this.contexts.get(envelope.address);
450
439
  assert(!!context, 0x162 /* "There should be a store context for the op" */);
451
440
  context.process(transformed, local, localMessageMetadata);
@@ -464,14 +453,72 @@ export class DataStores implements IDisposable {
464
453
  requestHeaderData: RuntimeHeaderData,
465
454
  ): Promise<FluidDataStoreContext> {
466
455
  const headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };
456
+ const request = { url: id };
457
+
458
+ this.validateNotDeleted(id, request, headerData);
467
459
 
468
460
  const context = await this.contexts.getBoundOrRemoted(id, headerData.wait);
469
- const request = { url: id };
470
461
  if (context === undefined) {
471
462
  // The requested data store does not exits. Throw a 404 response exception.
472
463
  throw responseToException(create404Response(request), request);
473
464
  }
474
465
 
466
+ this.validateNotTombstoned(context, request, requestHeaderData);
467
+
468
+ return context;
469
+ }
470
+
471
+ /**
472
+ * Validate that the data store had not been deleted by GC.
473
+ *
474
+ * @param id - data store id
475
+ * @param request - the request information to log if the validation detects the data store has been deleted
476
+ * @param requestHeaderData - the request header information to log if the validation detects the data store has been deleted
477
+ */
478
+ private validateNotDeleted(
479
+ id: string,
480
+ request: IRequest,
481
+ requestHeaderData?: RuntimeHeaderData,
482
+ ) {
483
+ const dataStoreNodePath = `/${id}`;
484
+ if (this.isDataStoreDeleted(dataStoreNodePath)) {
485
+ assert(
486
+ !this.contexts.has(id),
487
+ 0x570 /* Inconsistent state! GC says the data store is deleted, but the data store is not deleted from the runtime. */,
488
+ );
489
+ // The requested data store is removed by gc. Create a 404 gc response exception.
490
+ const error = responseToException(
491
+ createResponseError(404, "DataStore was deleted", request),
492
+ request,
493
+ );
494
+ sendGCUnexpectedUsageEvent(
495
+ this.mc,
496
+ {
497
+ eventName: "GC_Deleted_DataStore_Requested",
498
+ category: "error",
499
+ isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
500
+ headers: JSON.stringify(requestHeaderData),
501
+ gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
502
+ },
503
+ undefined /** packagePath */,
504
+ error,
505
+ );
506
+ throw error;
507
+ }
508
+ }
509
+
510
+ /**
511
+ * Validates that the data store context requested has not been marked as tombstone by GC.
512
+ *
513
+ * @param context - the data store context in question
514
+ * @param request - the request information to log if the validation detects the data store has been tombstoned
515
+ * @param headerData - the request header information to log if the validation detects the data store has been tombstoned
516
+ */
517
+ private validateNotTombstoned(
518
+ context: FluidDataStoreContext,
519
+ request: IRequest,
520
+ headerData: RuntimeHeaderData,
521
+ ) {
475
522
  if (context.tombstoned) {
476
523
  const shouldFail = this.throwOnTombstoneLoad && !headerData.allowTombstone;
477
524
 
@@ -488,7 +535,8 @@ export class DataStores implements IDisposable {
488
535
  eventName: "GC_Tombstone_DataStore_Requested",
489
536
  category: shouldFail ? "error" : "generic",
490
537
  isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
491
- headers: JSON.stringify(requestHeaderData),
538
+ headers: JSON.stringify(headerData),
539
+ gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
492
540
  },
493
541
  context.isLoaded ? context.packagePath : undefined,
494
542
  error,
@@ -498,11 +546,11 @@ export class DataStores implements IDisposable {
498
546
  throw error;
499
547
  }
500
548
  }
501
-
502
- return context;
503
549
  }
504
550
 
505
551
  public processSignal(address: string, message: IInboundSignalMessage, local: boolean) {
552
+ const request = { url: address };
553
+ this.validateNotDeleted(address, request);
506
554
  const context = this.contexts.get(address);
507
555
  if (!context) {
508
556
  // Attach message may not have been processed yet
@@ -530,6 +578,10 @@ export class DataStores implements IDisposable {
530
578
  eventName: "SetConnectionStateError",
531
579
  clientId,
532
580
  fluidDataStore,
581
+ details: JSON.stringify({
582
+ runtimeConnected: this.runtime.connected,
583
+ connected,
584
+ }),
533
585
  },
534
586
  error,
535
587
  );
@@ -562,10 +614,11 @@ export class DataStores implements IDisposable {
562
614
  await Promise.all(
563
615
  Array.from(this.contexts)
564
616
  .filter(([_, context]) => {
565
- // Summarizer works only with clients with no local changes!
617
+ // Summarizer works only with clients with no local changes. A data store in attaching
618
+ // state indicates an op was sent to attach a local data store.
566
619
  assert(
567
620
  context.attachState !== AttachState.Attaching,
568
- 0x165 /* "Summarizer cannot work if client has local changes" */,
621
+ 0x588 /* Local data store detected in attaching state during summarize */,
569
622
  );
570
623
  return context.attachState === AttachState.Attached;
571
624
  })
@@ -663,8 +716,12 @@ export class DataStores implements IDisposable {
663
716
  await Promise.all(
664
717
  Array.from(this.contexts)
665
718
  .filter(([_, context]) => {
666
- // Get GC data only for attached contexts. Detached contexts are not connected in the GC reference
667
- // graph so any references they might have won't be connected as well.
719
+ // Summarizer client and hence GC works only with clients with no local changes. A data store in
720
+ // attaching state indicates an op was sent to attach a local data store.
721
+ assert(
722
+ context.attachState !== AttachState.Attaching,
723
+ 0x589 /* Local data store detected in attaching state while running GC */,
724
+ );
668
725
  return context.attachState === AttachState.Attached;
669
726
  })
670
727
  .map(async ([contextId, context]) => {
@@ -723,6 +780,47 @@ export class DataStores implements IDisposable {
723
780
  }
724
781
  }
725
782
 
783
+ /**
784
+ * Delete data stores and its objects that are sweep ready.
785
+ * @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should
786
+ * be deleted.
787
+ * @returns - The routes of data stores and its objects that were deleted.
788
+ */
789
+ public deleteSweepReadyNodes(sweepReadyDataStoreRoutes: string[]): string[] {
790
+ // If sweep for data stores is not enabled, return empty list indicating nothing is deleted.
791
+ if (this.mc.config.getBoolean(sweepDatastoresKey) !== true) {
792
+ return [];
793
+ }
794
+ for (const route of sweepReadyDataStoreRoutes) {
795
+ const pathParts = route.split("/");
796
+ const dataStoreId = pathParts[1];
797
+
798
+ // TODO: GC:Validation - Skip any routes already deleted
799
+ // Ignore sub-data store routes because a data store and its sub-routes are deleted together, so, we only
800
+ // need to delete the data store.
801
+ if (pathParts.length > 2) {
802
+ continue;
803
+ }
804
+
805
+ if (!this.contexts.has(dataStoreId)) {
806
+ this.mc.logger.sendErrorEvent({
807
+ eventName: "DeletedDataStoreNotFound",
808
+ dataStoreId,
809
+ });
810
+ }
811
+
812
+ const dataStore = this.contexts.get(dataStoreId);
813
+ assert(dataStore !== undefined, 0x571 /* Attempting to delete unknown dataStore */);
814
+ dataStore.delete();
815
+
816
+ // Delete the contexts of sweep ready data stores.
817
+ this.contexts.delete(dataStoreId);
818
+ // Delete the summarizer node of the sweep ready data stores.
819
+ this.deleteChildSummarizerNodeFn(dataStoreId);
820
+ }
821
+ return Array.from(sweepReadyDataStoreRoutes);
822
+ }
823
+
726
824
  /**
727
825
  * This is called to update objects whose routes are tombstones. Tombstoned datastore contexts enable testing
728
826
  * scenarios with accessing deleted content without actually deleting content from summaries.
@@ -0,0 +1,46 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { IDeltaManager, ReadOnlyInfo } from "@fluidframework/container-definitions";
7
+ import { DeltaManagerProxyBase } from "@fluidframework/container-utils";
8
+ import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
9
+ import { summarizerClientType } from "./summary";
10
+
11
+ /**
12
+ * Proxy to the real IDeltaManager for restricting certain access to layers below container runtime in summarizer clients:
13
+ * - Summarizer client should be read-only to layers below the container runtime to restrict local changes.
14
+ * - Summarizer client should not be active to layers below the container runtime to restrict local changes.
15
+ */
16
+ export class DeltaManagerSummarizerProxy
17
+ extends DeltaManagerProxyBase
18
+ implements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>
19
+ {
20
+ public get active(): boolean {
21
+ // Summarize clients should not be active. There shouldn't be any local changes (writes) in the summarizer
22
+ // except for the SummarizeOp which is generated by the runtime.
23
+ return !this.isSummarizerClient && this.deltaManager.active;
24
+ }
25
+
26
+ public get readOnlyInfo(): ReadOnlyInfo {
27
+ // Summarizer clients should be read-only as far as the runtime and layers below are concerned. There shouldn't
28
+ // be any local changes (writes) in the summarizer except for the summarize op which is generated by the runtime.
29
+ if (this.isSummarizerClient) {
30
+ return {
31
+ readonly: true,
32
+ forced: false,
33
+ permissions: undefined,
34
+ storageOnly: false,
35
+ };
36
+ }
37
+ return this.deltaManager.readOnlyInfo;
38
+ }
39
+
40
+ private readonly isSummarizerClient: boolean;
41
+
42
+ constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>) {
43
+ super(deltaManager);
44
+ this.isSummarizerClient = this.deltaManager.clientDetails.type === summarizerClientType;
45
+ }
46
+ }
@@ -18,7 +18,7 @@ Currently, the only Fluid objects that are eligible for GC are data stores and a
18
18
 
19
19
  There are 2 ways to reference a data store:
20
20
 
21
- - Store the data stores's handle (see [IFluidHandle](../../../common/lib/core-interfaces/src/handles.ts)) in a referenced DDS that supports handle in its data. For example, a data store's handle can be stored in a referenced `SharedMap` DDS.
21
+ - Store the data stores's handle (see [IFluidHandle](../../../../../packages/common/core-interfaces/src/handles.ts) in a referenced DDS that supports handle in its data. For example, a data store's handle can be stored in a referenced `SharedMap` DDS.
22
22
 
23
23
  Note that storing a handle of any of a data store's DDS will also mark the data store as referenced.
24
24
 
@@ -50,7 +50,7 @@ Mark phase is enabled by default for a container. It is enabled during creation
50
50
 
51
51
  If you wish to disable this, set the `gcAllowed` option to `false` in `IGCRuntimeOptions`. These options are under `IContainerRuntimeOptions` and are passed to the container runtime during its creation. Note that this will disable GC permanently (including the sweep phase) for the container during its lifetime.
52
52
 
53
- See `IGCRuntimeOptions` in [containerRuntime.ts](./src/containerRuntime.ts) for more options to control GC behavior.
53
+ See `IGCRuntimeOptions` in [containerRuntime.ts](../containerRuntime.ts) for more options to control GC behavior.
54
54
 
55
55
  ### Sweep phase
56
56