@fluidframework/container-runtime 2.0.0-dev.5.2.0.169897 → 2.0.0-dev.6.4.0.191258

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 (561) hide show
  1. package/CHANGELOG.md +147 -0
  2. package/README.md +4 -3
  3. package/dist/batchTracker.d.ts +3 -2
  4. package/dist/batchTracker.d.ts.map +1 -1
  5. package/dist/batchTracker.js +6 -5
  6. package/dist/batchTracker.js.map +1 -1
  7. package/dist/blobManager.d.ts +15 -18
  8. package/dist/blobManager.d.ts.map +1 -1
  9. package/dist/blobManager.js +212 -171
  10. package/dist/blobManager.js.map +1 -1
  11. package/dist/connectionTelemetry.d.ts.map +1 -1
  12. package/dist/connectionTelemetry.js +33 -17
  13. package/dist/connectionTelemetry.js.map +1 -1
  14. package/dist/containerRuntime.d.ts +172 -35
  15. package/dist/containerRuntime.d.ts.map +1 -1
  16. package/dist/containerRuntime.js +722 -425
  17. package/dist/containerRuntime.js.map +1 -1
  18. package/dist/dataStore.d.ts.map +1 -1
  19. package/dist/dataStore.js +15 -7
  20. package/dist/dataStore.js.map +1 -1
  21. package/dist/dataStoreContext.d.ts +4 -4
  22. package/dist/dataStoreContext.d.ts.map +1 -1
  23. package/dist/dataStoreContext.js +87 -90
  24. package/dist/dataStoreContext.js.map +1 -1
  25. package/dist/dataStoreContexts.d.ts +1 -1
  26. package/dist/dataStoreContexts.d.ts.map +1 -1
  27. package/dist/dataStoreContexts.js +10 -10
  28. package/dist/dataStoreContexts.js.map +1 -1
  29. package/dist/dataStoreRegistry.js +2 -2
  30. package/dist/dataStoreRegistry.js.map +1 -1
  31. package/dist/dataStores.d.ts +23 -7
  32. package/dist/dataStores.d.ts.map +1 -1
  33. package/dist/dataStores.js +125 -82
  34. package/dist/dataStores.js.map +1 -1
  35. package/dist/deltaManagerProxyBase.d.ts +35 -0
  36. package/dist/deltaManagerProxyBase.d.ts.map +1 -0
  37. package/dist/deltaManagerProxyBase.js +77 -0
  38. package/dist/deltaManagerProxyBase.js.map +1 -0
  39. package/dist/deltaManagerSummarizerProxy.d.ts +1 -1
  40. package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -1
  41. package/dist/deltaManagerSummarizerProxy.js +4 -2
  42. package/dist/deltaManagerSummarizerProxy.js.map +1 -1
  43. package/dist/deltaScheduler.d.ts.map +1 -1
  44. package/dist/deltaScheduler.js +10 -10
  45. package/dist/deltaScheduler.js.map +1 -1
  46. package/dist/error.d.ts +14 -0
  47. package/dist/error.d.ts.map +1 -0
  48. package/dist/error.js +21 -0
  49. package/dist/error.js.map +1 -0
  50. package/dist/gc/garbageCollection.d.ts +10 -9
  51. package/dist/gc/garbageCollection.d.ts.map +1 -1
  52. package/dist/gc/garbageCollection.js +65 -56
  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 +18 -14
  56. package/dist/gc/gcConfigs.js.map +1 -1
  57. package/dist/gc/gcDefinitions.d.ts +17 -5
  58. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  59. package/dist/gc/gcDefinitions.js +14 -15
  60. package/dist/gc/gcDefinitions.js.map +1 -1
  61. package/dist/gc/gcHelpers.d.ts +0 -8
  62. package/dist/gc/gcHelpers.d.ts.map +1 -1
  63. package/dist/gc/gcHelpers.js +11 -24
  64. package/dist/gc/gcHelpers.js.map +1 -1
  65. package/dist/gc/gcSummaryStateTracker.d.ts +4 -7
  66. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  67. package/dist/gc/gcSummaryStateTracker.js +19 -58
  68. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  69. package/dist/gc/gcTelemetry.d.ts +1 -1
  70. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  71. package/dist/gc/gcTelemetry.js +45 -35
  72. package/dist/gc/gcTelemetry.js.map +1 -1
  73. package/dist/gc/gcUnreferencedStateTracker.js +4 -4
  74. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  75. package/dist/gc/index.d.ts +2 -2
  76. package/dist/gc/index.d.ts.map +1 -1
  77. package/dist/gc/index.js +3 -5
  78. package/dist/gc/index.js.map +1 -1
  79. package/dist/id-compressor/appendOnlySortedMap.d.ts +8 -30
  80. package/dist/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
  81. package/dist/id-compressor/appendOnlySortedMap.js +26 -68
  82. package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
  83. package/dist/id-compressor/finalSpace.d.ts +29 -0
  84. package/dist/id-compressor/finalSpace.d.ts.map +1 -0
  85. package/dist/id-compressor/finalSpace.js +62 -0
  86. package/dist/id-compressor/finalSpace.js.map +1 -0
  87. package/dist/id-compressor/idCompressor.d.ts +25 -250
  88. package/dist/id-compressor/idCompressor.d.ts.map +1 -1
  89. package/dist/id-compressor/idCompressor.js +390 -1153
  90. package/dist/id-compressor/idCompressor.js.map +1 -1
  91. package/dist/id-compressor/identifiers.d.ts +32 -0
  92. package/dist/id-compressor/identifiers.d.ts.map +1 -0
  93. package/dist/id-compressor/identifiers.js +15 -0
  94. package/dist/id-compressor/identifiers.js.map +1 -0
  95. package/dist/id-compressor/index.d.ts +5 -6
  96. package/dist/id-compressor/index.d.ts.map +1 -1
  97. package/dist/id-compressor/index.js +20 -26
  98. package/dist/id-compressor/index.js.map +1 -1
  99. package/dist/id-compressor/persistanceUtilities.d.ts +22 -0
  100. package/dist/id-compressor/persistanceUtilities.d.ts.map +1 -0
  101. package/dist/id-compressor/persistanceUtilities.js +43 -0
  102. package/dist/id-compressor/persistanceUtilities.js.map +1 -0
  103. package/dist/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
  104. package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
  105. package/dist/id-compressor/sessionSpaceNormalizer.js +80 -0
  106. package/dist/id-compressor/sessionSpaceNormalizer.js.map +1 -0
  107. package/dist/id-compressor/sessions.d.ts +115 -0
  108. package/dist/id-compressor/sessions.d.ts.map +1 -0
  109. package/dist/id-compressor/sessions.js +305 -0
  110. package/dist/id-compressor/sessions.js.map +1 -0
  111. package/dist/id-compressor/utilities.d.ts +49 -0
  112. package/dist/id-compressor/utilities.d.ts.map +1 -0
  113. package/dist/id-compressor/utilities.js +166 -0
  114. package/dist/id-compressor/utilities.js.map +1 -0
  115. package/dist/index.d.ts +3 -3
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/index.js +6 -4
  118. package/dist/index.js.map +1 -1
  119. package/dist/metadata.d.ts +18 -0
  120. package/dist/metadata.d.ts.map +1 -0
  121. package/dist/metadata.js +7 -0
  122. package/dist/metadata.js.map +1 -0
  123. package/dist/opLifecycle/batchManager.d.ts +2 -1
  124. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  125. package/dist/opLifecycle/batchManager.js +15 -7
  126. package/dist/opLifecycle/batchManager.js.map +1 -1
  127. package/dist/opLifecycle/definitions.d.ts +11 -0
  128. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  129. package/dist/opLifecycle/definitions.js.map +1 -1
  130. package/dist/opLifecycle/index.d.ts +1 -1
  131. package/dist/opLifecycle/index.d.ts.map +1 -1
  132. package/dist/opLifecycle/index.js +2 -1
  133. package/dist/opLifecycle/index.js.map +1 -1
  134. package/dist/opLifecycle/opCompressor.d.ts +2 -2
  135. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  136. package/dist/opLifecycle/opCompressor.js +12 -7
  137. package/dist/opLifecycle/opCompressor.js.map +1 -1
  138. package/dist/opLifecycle/opDecompressor.d.ts +2 -2
  139. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  140. package/dist/opLifecycle/opDecompressor.js +30 -21
  141. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  142. package/dist/opLifecycle/opGroupingManager.d.ts +1 -1
  143. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  144. package/dist/opLifecycle/opGroupingManager.js +19 -13
  145. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  146. package/dist/opLifecycle/opSplitter.d.ts +2 -2
  147. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  148. package/dist/opLifecycle/opSplitter.js +24 -19
  149. package/dist/opLifecycle/opSplitter.js.map +1 -1
  150. package/dist/opLifecycle/outbox.d.ts +39 -6
  151. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  152. package/dist/opLifecycle/outbox.js +138 -61
  153. package/dist/opLifecycle/outbox.js.map +1 -1
  154. package/dist/opLifecycle/remoteMessageProcessor.d.ts +6 -1
  155. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  156. package/dist/opLifecycle/remoteMessageProcessor.js +22 -8
  157. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  158. package/dist/opProperties.js +1 -2
  159. package/dist/opProperties.js.map +1 -1
  160. package/dist/packageVersion.d.ts +1 -1
  161. package/dist/packageVersion.js +1 -1
  162. package/dist/packageVersion.js.map +1 -1
  163. package/dist/pendingStateManager.d.ts +25 -10
  164. package/dist/pendingStateManager.d.ts.map +1 -1
  165. package/dist/pendingStateManager.js +101 -64
  166. package/dist/pendingStateManager.js.map +1 -1
  167. package/dist/scheduleManager.d.ts.map +1 -1
  168. package/dist/scheduleManager.js +43 -33
  169. package/dist/scheduleManager.js.map +1 -1
  170. package/dist/summary/index.d.ts +4 -4
  171. package/dist/summary/index.d.ts.map +1 -1
  172. package/dist/summary/index.js +3 -1
  173. package/dist/summary/index.js.map +1 -1
  174. package/dist/summary/orderedClientElection.d.ts +3 -3
  175. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  176. package/dist/summary/orderedClientElection.js +26 -27
  177. package/dist/summary/orderedClientElection.js.map +1 -1
  178. package/dist/summary/runWhileConnectedCoordinator.js +3 -3
  179. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  180. package/dist/summary/runningSummarizer.d.ts +31 -10
  181. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  182. package/dist/summary/runningSummarizer.js +271 -139
  183. package/dist/summary/runningSummarizer.js.map +1 -1
  184. package/dist/summary/summarizer.d.ts +8 -7
  185. package/dist/summary/summarizer.d.ts.map +1 -1
  186. package/dist/summary/summarizer.js +79 -78
  187. package/dist/summary/summarizer.js.map +1 -1
  188. package/dist/summary/summarizerClientElection.d.ts +2 -2
  189. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  190. package/dist/summary/summarizerClientElection.js +7 -11
  191. package/dist/summary/summarizerClientElection.js.map +1 -1
  192. package/dist/summary/summarizerHeuristics.js +10 -14
  193. package/dist/summary/summarizerHeuristics.js.map +1 -1
  194. package/dist/summary/summarizerNode/index.d.ts +1 -1
  195. package/dist/summary/summarizerNode/index.d.ts.map +1 -1
  196. package/dist/summary/summarizerNode/index.js.map +1 -1
  197. package/dist/summary/summarizerNode/summarizerNode.d.ts +40 -23
  198. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  199. package/dist/summary/summarizerNode/summarizerNode.js +144 -149
  200. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  201. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +25 -29
  202. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  203. package/dist/summary/summarizerNode/summarizerNodeUtils.js +2 -4
  204. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  205. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +21 -16
  206. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  207. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +74 -123
  208. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  209. package/dist/summary/summarizerTypes.d.ts +44 -24
  210. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  211. package/dist/summary/summarizerTypes.js.map +1 -1
  212. package/dist/summary/summaryCollection.d.ts +2 -2
  213. package/dist/summary/summaryCollection.d.ts.map +1 -1
  214. package/dist/summary/summaryCollection.js +16 -13
  215. package/dist/summary/summaryCollection.js.map +1 -1
  216. package/dist/summary/summaryFormat.d.ts +4 -0
  217. package/dist/summary/summaryFormat.d.ts.map +1 -1
  218. package/dist/summary/summaryFormat.js +8 -5
  219. package/dist/summary/summaryFormat.js.map +1 -1
  220. package/dist/summary/summaryGenerator.d.ts +21 -6
  221. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  222. package/dist/summary/summaryGenerator.js +117 -54
  223. package/dist/summary/summaryGenerator.js.map +1 -1
  224. package/dist/summary/summaryManager.d.ts +8 -7
  225. package/dist/summary/summaryManager.d.ts.map +1 -1
  226. package/dist/summary/summaryManager.js +38 -28
  227. package/dist/summary/summaryManager.js.map +1 -1
  228. package/lib/batchTracker.d.ts +3 -2
  229. package/lib/batchTracker.d.ts.map +1 -1
  230. package/lib/batchTracker.js +5 -4
  231. package/lib/batchTracker.js.map +1 -1
  232. package/lib/blobManager.d.ts +15 -18
  233. package/lib/blobManager.d.ts.map +1 -1
  234. package/lib/blobManager.js +187 -146
  235. package/lib/blobManager.js.map +1 -1
  236. package/lib/connectionTelemetry.d.ts.map +1 -1
  237. package/lib/connectionTelemetry.js +23 -7
  238. package/lib/connectionTelemetry.js.map +1 -1
  239. package/lib/containerRuntime.d.ts +172 -35
  240. package/lib/containerRuntime.d.ts.map +1 -1
  241. package/lib/containerRuntime.js +678 -380
  242. package/lib/containerRuntime.js.map +1 -1
  243. package/lib/dataStore.d.ts.map +1 -1
  244. package/lib/dataStore.js +13 -5
  245. package/lib/dataStore.js.map +1 -1
  246. package/lib/dataStoreContext.d.ts +4 -4
  247. package/lib/dataStoreContext.d.ts.map +1 -1
  248. package/lib/dataStoreContext.js +49 -52
  249. package/lib/dataStoreContext.js.map +1 -1
  250. package/lib/dataStoreContexts.d.ts +1 -1
  251. package/lib/dataStoreContexts.d.ts.map +1 -1
  252. package/lib/dataStoreContexts.js +3 -3
  253. package/lib/dataStoreContexts.js.map +1 -1
  254. package/lib/dataStoreRegistry.js +1 -1
  255. package/lib/dataStoreRegistry.js.map +1 -1
  256. package/lib/dataStores.d.ts +23 -7
  257. package/lib/dataStores.d.ts.map +1 -1
  258. package/lib/dataStores.js +107 -64
  259. package/lib/dataStores.js.map +1 -1
  260. package/lib/deltaManagerProxyBase.d.ts +35 -0
  261. package/lib/deltaManagerProxyBase.d.ts.map +1 -0
  262. package/lib/deltaManagerProxyBase.js +73 -0
  263. package/lib/deltaManagerProxyBase.js.map +1 -0
  264. package/lib/deltaManagerSummarizerProxy.d.ts +1 -1
  265. package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -1
  266. package/lib/deltaManagerSummarizerProxy.js +3 -1
  267. package/lib/deltaManagerSummarizerProxy.js.map +1 -1
  268. package/lib/deltaScheduler.d.ts.map +1 -1
  269. package/lib/deltaScheduler.js +7 -7
  270. package/lib/deltaScheduler.js.map +1 -1
  271. package/lib/error.d.ts +14 -0
  272. package/lib/error.d.ts.map +1 -0
  273. package/lib/error.js +17 -0
  274. package/lib/error.js.map +1 -0
  275. package/lib/gc/garbageCollection.d.ts +10 -9
  276. package/lib/gc/garbageCollection.d.ts.map +1 -1
  277. package/lib/gc/garbageCollection.js +61 -52
  278. package/lib/gc/garbageCollection.js.map +1 -1
  279. package/lib/gc/gcConfigs.d.ts.map +1 -1
  280. package/lib/gc/gcConfigs.js +16 -12
  281. package/lib/gc/gcConfigs.js.map +1 -1
  282. package/lib/gc/gcDefinitions.d.ts +17 -5
  283. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  284. package/lib/gc/gcDefinitions.js +13 -14
  285. package/lib/gc/gcDefinitions.js.map +1 -1
  286. package/lib/gc/gcHelpers.d.ts +0 -8
  287. package/lib/gc/gcHelpers.d.ts.map +1 -1
  288. package/lib/gc/gcHelpers.js +5 -17
  289. package/lib/gc/gcHelpers.js.map +1 -1
  290. package/lib/gc/gcSummaryStateTracker.d.ts +4 -7
  291. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  292. package/lib/gc/gcSummaryStateTracker.js +20 -59
  293. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  294. package/lib/gc/gcTelemetry.d.ts +1 -1
  295. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  296. package/lib/gc/gcTelemetry.js +46 -36
  297. package/lib/gc/gcTelemetry.js.map +1 -1
  298. package/lib/gc/gcUnreferencedStateTracker.js +1 -1
  299. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  300. package/lib/gc/index.d.ts +2 -2
  301. package/lib/gc/index.d.ts.map +1 -1
  302. package/lib/gc/index.js +2 -2
  303. package/lib/gc/index.js.map +1 -1
  304. package/lib/id-compressor/appendOnlySortedMap.d.ts +8 -30
  305. package/lib/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
  306. package/lib/id-compressor/appendOnlySortedMap.js +25 -66
  307. package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
  308. package/lib/id-compressor/finalSpace.d.ts +29 -0
  309. package/lib/id-compressor/finalSpace.d.ts.map +1 -0
  310. package/lib/id-compressor/finalSpace.js +58 -0
  311. package/lib/id-compressor/finalSpace.js.map +1 -0
  312. package/lib/id-compressor/idCompressor.d.ts +25 -250
  313. package/lib/id-compressor/idCompressor.d.ts.map +1 -1
  314. package/lib/id-compressor/idCompressor.js +385 -1142
  315. package/lib/id-compressor/idCompressor.js.map +1 -1
  316. package/lib/id-compressor/identifiers.d.ts +32 -0
  317. package/lib/id-compressor/identifiers.d.ts.map +1 -0
  318. package/lib/id-compressor/identifiers.js +11 -0
  319. package/lib/id-compressor/identifiers.js.map +1 -0
  320. package/lib/id-compressor/index.d.ts +5 -6
  321. package/lib/id-compressor/index.d.ts.map +1 -1
  322. package/lib/id-compressor/index.js +5 -6
  323. package/lib/id-compressor/index.js.map +1 -1
  324. package/lib/id-compressor/persistanceUtilities.d.ts +22 -0
  325. package/lib/id-compressor/persistanceUtilities.d.ts.map +1 -0
  326. package/lib/id-compressor/persistanceUtilities.js +34 -0
  327. package/lib/id-compressor/persistanceUtilities.js.map +1 -0
  328. package/lib/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
  329. package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
  330. package/lib/id-compressor/sessionSpaceNormalizer.js +76 -0
  331. package/lib/id-compressor/sessionSpaceNormalizer.js.map +1 -0
  332. package/lib/id-compressor/sessions.d.ts +115 -0
  333. package/lib/id-compressor/sessions.d.ts.map +1 -0
  334. package/lib/id-compressor/sessions.js +290 -0
  335. package/lib/id-compressor/sessions.js.map +1 -0
  336. package/lib/id-compressor/utilities.d.ts +49 -0
  337. package/lib/id-compressor/utilities.d.ts.map +1 -0
  338. package/lib/id-compressor/utilities.js +148 -0
  339. package/lib/id-compressor/utilities.js.map +1 -0
  340. package/lib/index.d.ts +3 -3
  341. package/lib/index.d.ts.map +1 -1
  342. package/lib/index.js +2 -2
  343. package/lib/index.js.map +1 -1
  344. package/lib/metadata.d.ts +18 -0
  345. package/lib/metadata.d.ts.map +1 -0
  346. package/lib/metadata.js +6 -0
  347. package/lib/metadata.js.map +1 -0
  348. package/lib/opLifecycle/batchManager.d.ts +2 -1
  349. package/lib/opLifecycle/batchManager.d.ts.map +1 -1
  350. package/lib/opLifecycle/batchManager.js +15 -7
  351. package/lib/opLifecycle/batchManager.js.map +1 -1
  352. package/lib/opLifecycle/definitions.d.ts +11 -0
  353. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  354. package/lib/opLifecycle/definitions.js.map +1 -1
  355. package/lib/opLifecycle/index.d.ts +1 -1
  356. package/lib/opLifecycle/index.d.ts.map +1 -1
  357. package/lib/opLifecycle/index.js +1 -1
  358. package/lib/opLifecycle/index.js.map +1 -1
  359. package/lib/opLifecycle/opCompressor.d.ts +2 -2
  360. package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
  361. package/lib/opLifecycle/opCompressor.js +10 -5
  362. package/lib/opLifecycle/opCompressor.js.map +1 -1
  363. package/lib/opLifecycle/opDecompressor.d.ts +2 -2
  364. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  365. package/lib/opLifecycle/opDecompressor.js +22 -13
  366. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  367. package/lib/opLifecycle/opGroupingManager.d.ts +1 -1
  368. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  369. package/lib/opLifecycle/opGroupingManager.js +17 -11
  370. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  371. package/lib/opLifecycle/opSplitter.d.ts +2 -2
  372. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  373. package/lib/opLifecycle/opSplitter.js +15 -10
  374. package/lib/opLifecycle/opSplitter.js.map +1 -1
  375. package/lib/opLifecycle/outbox.d.ts +39 -6
  376. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  377. package/lib/opLifecycle/outbox.js +132 -56
  378. package/lib/opLifecycle/outbox.js.map +1 -1
  379. package/lib/opLifecycle/remoteMessageProcessor.d.ts +6 -1
  380. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  381. package/lib/opLifecycle/remoteMessageProcessor.js +23 -9
  382. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  383. package/lib/opProperties.js +1 -2
  384. package/lib/opProperties.js.map +1 -1
  385. package/lib/packageVersion.d.ts +1 -1
  386. package/lib/packageVersion.js +1 -1
  387. package/lib/packageVersion.js.map +1 -1
  388. package/lib/pendingStateManager.d.ts +25 -10
  389. package/lib/pendingStateManager.d.ts.map +1 -1
  390. package/lib/pendingStateManager.js +90 -53
  391. package/lib/pendingStateManager.js.map +1 -1
  392. package/lib/scheduleManager.d.ts.map +1 -1
  393. package/lib/scheduleManager.js +25 -15
  394. package/lib/scheduleManager.js.map +1 -1
  395. package/lib/summary/index.d.ts +4 -4
  396. package/lib/summary/index.d.ts.map +1 -1
  397. package/lib/summary/index.js +2 -2
  398. package/lib/summary/index.js.map +1 -1
  399. package/lib/summary/orderedClientElection.d.ts +3 -3
  400. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  401. package/lib/summary/orderedClientElection.js +21 -22
  402. package/lib/summary/orderedClientElection.js.map +1 -1
  403. package/lib/summary/runWhileConnectedCoordinator.js +1 -1
  404. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  405. package/lib/summary/runningSummarizer.d.ts +31 -10
  406. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  407. package/lib/summary/runningSummarizer.js +265 -133
  408. package/lib/summary/runningSummarizer.js.map +1 -1
  409. package/lib/summary/summarizer.d.ts +8 -7
  410. package/lib/summary/summarizer.d.ts.map +1 -1
  411. package/lib/summary/summarizer.js +75 -74
  412. package/lib/summary/summarizer.js.map +1 -1
  413. package/lib/summary/summarizerClientElection.d.ts +2 -2
  414. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  415. package/lib/summary/summarizerClientElection.js +6 -10
  416. package/lib/summary/summarizerClientElection.js.map +1 -1
  417. package/lib/summary/summarizerHeuristics.js +9 -13
  418. package/lib/summary/summarizerHeuristics.js.map +1 -1
  419. package/lib/summary/summarizerNode/index.d.ts +1 -1
  420. package/lib/summary/summarizerNode/index.d.ts.map +1 -1
  421. package/lib/summary/summarizerNode/index.js.map +1 -1
  422. package/lib/summary/summarizerNode/summarizerNode.d.ts +40 -23
  423. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  424. package/lib/summary/summarizerNode/summarizerNode.js +132 -137
  425. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  426. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +25 -29
  427. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  428. package/lib/summary/summarizerNode/summarizerNodeUtils.js +2 -4
  429. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  430. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +21 -16
  431. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  432. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +70 -119
  433. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  434. package/lib/summary/summarizerTypes.d.ts +44 -24
  435. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  436. package/lib/summary/summarizerTypes.js.map +1 -1
  437. package/lib/summary/summaryCollection.d.ts +2 -2
  438. package/lib/summary/summaryCollection.d.ts.map +1 -1
  439. package/lib/summary/summaryCollection.js +9 -6
  440. package/lib/summary/summaryCollection.js.map +1 -1
  441. package/lib/summary/summaryFormat.d.ts +4 -0
  442. package/lib/summary/summaryFormat.d.ts.map +1 -1
  443. package/lib/summary/summaryFormat.js +7 -4
  444. package/lib/summary/summaryFormat.js.map +1 -1
  445. package/lib/summary/summaryGenerator.d.ts +21 -6
  446. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  447. package/lib/summary/summaryGenerator.js +109 -47
  448. package/lib/summary/summaryGenerator.js.map +1 -1
  449. package/lib/summary/summaryManager.d.ts +8 -7
  450. package/lib/summary/summaryManager.d.ts.map +1 -1
  451. package/lib/summary/summaryManager.js +35 -25
  452. package/lib/summary/summaryManager.js.map +1 -1
  453. package/package.json +30 -32
  454. package/src/batchTracker.ts +7 -5
  455. package/src/blobManager.ts +235 -172
  456. package/src/connectionTelemetry.ts +19 -5
  457. package/src/containerRuntime.ts +853 -431
  458. package/src/dataStore.ts +12 -4
  459. package/src/dataStoreContext.ts +49 -46
  460. package/src/dataStoreContexts.ts +4 -4
  461. package/src/dataStoreRegistry.ts +1 -1
  462. package/src/dataStores.ts +119 -80
  463. package/src/deltaManagerProxyBase.ts +111 -0
  464. package/src/deltaManagerSummarizerProxy.ts +4 -1
  465. package/src/deltaScheduler.ts +7 -11
  466. package/src/error.ts +18 -0
  467. package/src/gc/garbageCollection.md +53 -5
  468. package/src/gc/garbageCollection.ts +58 -51
  469. package/src/gc/gcConfigs.ts +4 -2
  470. package/src/gc/gcDefinitions.ts +17 -21
  471. package/src/gc/gcEarlyAdoption.md +145 -0
  472. package/src/gc/gcHelpers.ts +1 -12
  473. package/src/gc/gcSummaryStateTracker.ts +19 -65
  474. package/src/gc/gcTelemetry.ts +15 -13
  475. package/src/gc/gcUnreferencedStateTracker.ts +1 -1
  476. package/src/gc/index.ts +2 -4
  477. package/src/id-compressor/appendOnlySortedMap.ts +26 -87
  478. package/src/id-compressor/finalSpace.ts +67 -0
  479. package/src/id-compressor/idCompressor.ts +458 -1682
  480. package/src/id-compressor/identifiers.ts +42 -0
  481. package/src/id-compressor/index.ts +11 -20
  482. package/src/id-compressor/persistanceUtilities.ts +58 -0
  483. package/src/id-compressor/sessionSpaceNormalizer.ts +83 -0
  484. package/src/id-compressor/sessions.ts +405 -0
  485. package/src/id-compressor/utilities.ts +187 -0
  486. package/src/index.ts +9 -2
  487. package/src/metadata.ts +19 -0
  488. package/src/opLifecycle/README.md +20 -0
  489. package/src/opLifecycle/batchManager.ts +9 -1
  490. package/src/opLifecycle/definitions.ts +11 -0
  491. package/src/opLifecycle/index.ts +1 -1
  492. package/src/opLifecycle/opCompressor.ts +6 -5
  493. package/src/opLifecycle/opDecompressor.ts +47 -17
  494. package/src/opLifecycle/opGroupingManager.ts +18 -8
  495. package/src/opLifecycle/opSplitter.ts +10 -7
  496. package/src/opLifecycle/outbox.ts +177 -72
  497. package/src/opLifecycle/remoteMessageProcessor.ts +32 -9
  498. package/src/packageVersion.ts +1 -1
  499. package/src/pendingStateManager.ts +123 -78
  500. package/src/scheduleManager.ts +22 -11
  501. package/src/summary/index.ts +7 -4
  502. package/src/summary/orderedClientElection.ts +10 -6
  503. package/src/summary/runWhileConnectedCoordinator.ts +1 -1
  504. package/src/summary/runningSummarizer.ts +291 -163
  505. package/src/summary/summarizer.ts +27 -16
  506. package/src/summary/summarizerClientElection.ts +2 -2
  507. package/src/summary/summarizerHeuristics.ts +1 -1
  508. package/src/summary/summarizerNode/index.ts +2 -2
  509. package/src/summary/summarizerNode/summarizerNode.ts +142 -184
  510. package/src/summary/summarizerNode/summarizerNodeUtils.ts +27 -35
  511. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +72 -148
  512. package/src/summary/summarizerTypes.ts +49 -24
  513. package/src/summary/summaryCollection.ts +9 -4
  514. package/src/summary/summaryFormat.ts +9 -2
  515. package/src/summary/summaryGenerator.ts +72 -49
  516. package/src/summary/summaryManager.ts +44 -16
  517. package/dist/id-compressor/idRange.d.ts +0 -11
  518. package/dist/id-compressor/idRange.d.ts.map +0 -1
  519. package/dist/id-compressor/idRange.js +0 -29
  520. package/dist/id-compressor/idRange.js.map +0 -1
  521. package/dist/id-compressor/numericUuid.d.ts +0 -59
  522. package/dist/id-compressor/numericUuid.d.ts.map +0 -1
  523. package/dist/id-compressor/numericUuid.js +0 -325
  524. package/dist/id-compressor/numericUuid.js.map +0 -1
  525. package/dist/id-compressor/sessionIdNormalizer.d.ts +0 -138
  526. package/dist/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
  527. package/dist/id-compressor/sessionIdNormalizer.js +0 -488
  528. package/dist/id-compressor/sessionIdNormalizer.js.map +0 -1
  529. package/dist/id-compressor/utils.d.ts +0 -57
  530. package/dist/id-compressor/utils.d.ts.map +0 -1
  531. package/dist/id-compressor/utils.js +0 -90
  532. package/dist/id-compressor/utils.js.map +0 -1
  533. package/dist/id-compressor/uuidUtilities.d.ts +0 -30
  534. package/dist/id-compressor/uuidUtilities.d.ts.map +0 -1
  535. package/dist/id-compressor/uuidUtilities.js +0 -106
  536. package/dist/id-compressor/uuidUtilities.js.map +0 -1
  537. package/lib/id-compressor/idRange.d.ts +0 -11
  538. package/lib/id-compressor/idRange.d.ts.map +0 -1
  539. package/lib/id-compressor/idRange.js +0 -25
  540. package/lib/id-compressor/idRange.js.map +0 -1
  541. package/lib/id-compressor/numericUuid.d.ts +0 -59
  542. package/lib/id-compressor/numericUuid.d.ts.map +0 -1
  543. package/lib/id-compressor/numericUuid.js +0 -315
  544. package/lib/id-compressor/numericUuid.js.map +0 -1
  545. package/lib/id-compressor/sessionIdNormalizer.d.ts +0 -138
  546. package/lib/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
  547. package/lib/id-compressor/sessionIdNormalizer.js +0 -484
  548. package/lib/id-compressor/sessionIdNormalizer.js.map +0 -1
  549. package/lib/id-compressor/utils.d.ts +0 -57
  550. package/lib/id-compressor/utils.d.ts.map +0 -1
  551. package/lib/id-compressor/utils.js +0 -79
  552. package/lib/id-compressor/utils.js.map +0 -1
  553. package/lib/id-compressor/uuidUtilities.d.ts +0 -30
  554. package/lib/id-compressor/uuidUtilities.d.ts.map +0 -1
  555. package/lib/id-compressor/uuidUtilities.js +0 -98
  556. package/lib/id-compressor/uuidUtilities.js.map +0 -1
  557. package/src/id-compressor/idRange.ts +0 -35
  558. package/src/id-compressor/numericUuid.ts +0 -383
  559. package/src/id-compressor/sessionIdNormalizer.ts +0 -609
  560. package/src/id-compressor/utils.ts +0 -114
  561. package/src/id-compressor/uuidUtilities.ts +0 -123
@@ -4,8 +4,9 @@
4
4
  */
5
5
 
6
6
  import { IDeltaManager, ReadOnlyInfo } from "@fluidframework/container-definitions";
7
- import { DeltaManagerProxyBase } from "@fluidframework/container-utils";
8
7
  import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
8
+
9
+ import { DeltaManagerProxyBase } from "./deltaManagerProxyBase";
9
10
  import { summarizerClientType } from "./summary";
10
11
 
11
12
  /**
@@ -41,6 +42,8 @@ export class DeltaManagerSummarizerProxy
41
42
 
42
43
  constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>) {
43
44
  super(deltaManager);
45
+ // We are expecting this class to have many listeners, so we suppress noisy "MaxListenersExceededWarning" logging.
46
+ super.setMaxListeners(0);
44
47
  this.isSummarizerClient = this.deltaManager.clientDetails.type === summarizerClientType;
45
48
  }
46
49
  }
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITelemetryLoggerExt, TelemetryLogger } from "@fluidframework/telemetry-utils";
7
- import { performance } from "@fluidframework/common-utils";
6
+ import { ITelemetryLoggerExt, formatTick } from "@fluidframework/telemetry-utils";
7
+ import { performance } from "@fluid-internal/client-utils";
8
8
  import { IDeltaManager } from "@fluidframework/container-definitions";
9
9
  import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
10
10
 
@@ -111,20 +111,16 @@ export class DeltaScheduler {
111
111
  if (this.schedulingLog) {
112
112
  this.logger.sendTelemetryEvent({
113
113
  eventName: "InboundOpsPartialProcessingTime",
114
- duration: TelemetryLogger.formatTick(elapsedTime),
114
+ duration: formatTick(elapsedTime),
115
115
  opsProcessed:
116
116
  this.schedulingLog.lastSequenceNumber -
117
117
  this.schedulingLog.firstSequenceNumber +
118
118
  1,
119
119
  opsRemainingToProcess: this.deltaManager.inbound.length,
120
- processingTime: TelemetryLogger.formatTick(
121
- this.schedulingLog.totalProcessingTime,
122
- ),
120
+ processingTime: formatTick(this.schedulingLog.totalProcessingTime),
123
121
  numberOfTurns: this.schedulingLog.numberOfTurns,
124
122
  batchesProcessed: this.schedulingLog.numberOfBatchesProcessed,
125
- timeToResume: TelemetryLogger.formatTick(
126
- performance.now() - currentTime,
127
- ),
123
+ timeToResume: formatTick(performance.now() - currentTime),
128
124
  });
129
125
  }
130
126
  this.deltaManager.inbound.resume();
@@ -147,13 +143,13 @@ export class DeltaScheduler {
147
143
  eventName: "InboundOpsProcessingTime",
148
144
  opsRemainingToProcess: this.schedulingLog.opsRemainingToProcess,
149
145
  numberOfTurns: this.schedulingLog.numberOfTurns,
150
- processingTime: TelemetryLogger.formatTick(this.schedulingLog.totalProcessingTime),
146
+ processingTime: formatTick(this.schedulingLog.totalProcessingTime),
151
147
  opsProcessed:
152
148
  this.schedulingLog.lastSequenceNumber -
153
149
  this.schedulingLog.firstSequenceNumber +
154
150
  1,
155
151
  batchesProcessed: this.schedulingLog.numberOfBatchesProcessed,
156
- duration: TelemetryLogger.formatTick(currentTime - this.schedulingLog.startTime),
152
+ duration: formatTick(currentTime - this.schedulingLog.startTime),
157
153
  schedulingCount: this.schedulingCount,
158
154
  });
159
155
 
package/src/error.ts ADDED
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { ContainerErrorTypes } from "@fluidframework/container-definitions";
7
+ import { IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils";
8
+
9
+ /**
10
+ * Error indicating that a client's session has reached its time limit and is closed.
11
+ */
12
+ export class ClientSessionExpiredError extends LoggingError implements IFluidErrorBase {
13
+ readonly errorType = ContainerErrorTypes.clientSessionExpiredError;
14
+
15
+ constructor(message: string, readonly expiryMs: number) {
16
+ super(message, { timeoutMs: expiryMs });
17
+ }
18
+ }
@@ -48,12 +48,60 @@ In this phase, the GC algorithm identifies all Fluid objects that are unreferenc
48
48
 
49
49
  Mark phase is enabled by default for a container. It is enabled during creation of the container runtime and remains enabled throughout its lifetime. Basically, this setting is persisted in the summary and cannot be changed.
50
50
 
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.
51
+ ### Sweep phase
52
52
 
53
- See `IGCRuntimeOptions` in [containerRuntime.ts](../containerRuntime.ts) for more options to control GC behavior.
53
+ In this phase, the GC algorithm identifies all Fluid objects that have been unreferenced for a specific amount of time (typically 30-40 days) and deletes them.
54
+ Objects are only swept once the GC system is sure that they could never be referenced again by any active clients, i.e., clients that have the object in memory and could reference it.
55
+ The Fluid Runtime enforces a maximum session length (configurable) in order to guarantee an object is safe to delete after sufficient time has elapsed.
54
56
 
55
- ### Sweep phase
57
+ GC sweep phase has not been enabled by default yet. A "soft" version of Sweep called "Tombstone Mode" is enabled by default
58
+ as part of the Mark Phase when Sweep is disabled. In this mode, any object that GC determines is ready to be deleted is
59
+ marked as a "Tombstone", which triggers certain logging events and/or behavior changes if/when that Tombstoned object is
60
+ accessed by the application.
61
+
62
+ Tombstone is intended for use by early adopters of GC and is documented in more detail [here](./gcEarlyAdoption.md).
63
+
64
+ ## GC Configuration
65
+
66
+ The default configuration for GC today is:
67
+
68
+ - GC Mark Phase is **enabled**, including Tombstone Mode
69
+ - Session Expiry is **enabled**
70
+ - GC Sweep Phase is **disabled**
71
+ - Note: Once enabled, Sweep will only run for documents created from that point forward
72
+
73
+ ### Techniques used for configuration
74
+
75
+ There are two ways to configure the Fluid Framework's GC behavior, referred to by name throughout these documents:
76
+
77
+ 1. **"GC Options"**: `ContainerRuntime.loadRuntime` takes an options value of type `IContainerRuntimeOptions`.
78
+ This type includes a sub-object `gcOptions`, for GC-specific options.
79
+ 2. **"Config Settings"**: The `Loader`'s constructor takes in `ILoaderProps`, which includes `configProvider?: IConfigProviderBase`
80
+ This configProvider can be used to inject config settings.
81
+
82
+ Typically GC Options are used for more "official" and stable configuration, whereas Config Settings provide a mechanism
83
+ for apps to override settings easily, e.g. by backing their `IConfigProviderBase` with a configuration/flighting service.
84
+ In cases where a behavior is controlled by both a Config Setting and GC Option, you may experiment at first using Config Settings
85
+ and then later update the passed-in GC Options to finalize the configuration in your code.
86
+
87
+ ### Disabling Mark Phase
88
+
89
+ If you wish to disable Mark Phase for newly-created documents, set the `gcAllowed` GC Option to `false`.
90
+ Note that this will disable GC permanently (including the sweep phase) for the container during its lifetime.
91
+
92
+ Mark Phase can also be disabled just for the session, among other behaviors,
93
+ covered in the [Advanced Configuration](./gcEarlyAdoption.md#more-advanced-configurations) docs.
94
+
95
+ ### Enabling Sweep Phase
96
+
97
+ To enable Sweep Phase for new documents, you must set the `gcSweepGeneration` GC Option to a number, e.g. 0 to start.
98
+ The full semantics of this GC Option are discussed [here](./gcEarlyAdoption.md#more-about-gcsweepgeneration-and-gctombstonegeneration).
99
+ Note that this will disabled Tombstone Mode.
100
+
101
+ A full treatment of Tombstone and Sweep configuration can be found in
102
+ [this companion document geared towards early adopters of GC](./gcEarlyAdoption.md).
56
103
 
57
- In this phase, the GC algorithm identifies all Fluid objects that have been unreferenced for a specific amount of time (typically 30-40 days) and deletes them. Objects are only swept once the GC system is sure that they could never be referenced again by any active clients, i.e., clients that have the object in memory and could reference it.
104
+ ### More Advanced Configuration
58
105
 
59
- GC sweep phase has not been enabled yet. More details will be added here when sweep is enabled.
106
+ For additional behaviors that can be configured (e.g. for testing), please see these
107
+ [Advanced Configuration](./gcEarlyAdoption.md#more-advanced-configurations) docs.
@@ -3,9 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { LazyPromise, Timer } from "@fluidframework/common-utils";
7
- import { ClientSessionExpiredError, DataProcessingError } from "@fluidframework/container-utils";
8
- import { IRequestHeader } from "@fluidframework/core-interfaces";
6
+ import { LazyPromise, Timer } from "@fluidframework/core-utils";
7
+ import { IRequest, IRequestHeader } from "@fluidframework/core-interfaces";
9
8
  import {
10
9
  gcTreeKey,
11
10
  IGarbageCollectionData,
@@ -13,17 +12,23 @@ import {
13
12
  ISummarizeResult,
14
13
  ITelemetryContext,
15
14
  } from "@fluidframework/runtime-definitions";
16
- import { ReadAndParseBlob } from "@fluidframework/runtime-utils";
15
+ import { createResponseError, responseToException } from "@fluidframework/runtime-utils";
17
16
  import {
18
- ChildLogger,
17
+ createChildLogger,
18
+ createChildMonitoringContext,
19
+ DataProcessingError,
19
20
  ITelemetryLoggerExt,
20
- loggerToMonitoringContext,
21
21
  MonitoringContext,
22
22
  PerformanceEvent,
23
23
  } from "@fluidframework/telemetry-utils";
24
24
 
25
- import { RuntimeHeaders } from "../containerRuntime";
26
- import { RefreshSummaryResult } from "../summary";
25
+ import {
26
+ AllowInactiveRequestHeaderKey,
27
+ InactiveResponseHeaderKey,
28
+ RuntimeHeaders,
29
+ } from "../containerRuntime";
30
+ import { ClientSessionExpiredError } from "../error";
31
+ import { IRefreshSummaryResult } from "../summary";
27
32
  import { generateGCConfigs } from "./gcConfigs";
28
33
  import {
29
34
  GCNodeType,
@@ -136,11 +141,13 @@ export class GarbageCollector implements IGarbageCollector {
136
141
  const baseSnapshot = createParams.baseSnapshot;
137
142
  const readAndParseBlob = createParams.readAndParseBlob;
138
143
 
139
- this.mc = loggerToMonitoringContext(
140
- ChildLogger.create(createParams.baseLogger, "GarbageCollector", {
144
+ this.mc = createChildMonitoringContext({
145
+ logger: createParams.baseLogger,
146
+ namespace: "GarbageCollector",
147
+ properties: {
141
148
  all: { completedGCRuns: () => this.completedRuns },
142
- }),
143
- );
149
+ },
150
+ });
144
151
 
145
152
  this.configs = generateGCConfigs(this.mc, createParams);
146
153
 
@@ -465,8 +472,11 @@ export class GarbageCollector implements IGarbageCollector {
465
472
  });
466
473
 
467
474
  const logger = options.logger
468
- ? ChildLogger.create(options.logger, undefined, {
469
- all: { completedGCRuns: () => this.completedRuns },
475
+ ? createChildLogger({
476
+ logger: options.logger,
477
+ properties: {
478
+ all: { completedGCRuns: () => this.completedRuns },
479
+ },
470
480
  })
471
481
  : this.mc.logger;
472
482
 
@@ -569,14 +579,17 @@ export class GarbageCollector implements IGarbageCollector {
569
579
 
570
580
  /**
571
581
  * Runs the GC Mark phase. It does the following:
582
+ *
572
583
  * 1. Marks all referenced nodes in this run by clearing tracking for them.
584
+ *
573
585
  * 2. Marks unreferenced nodes in this run by starting tracking for them.
586
+ *
574
587
  * 3. Calls the runtime to update nodes that were marked referenced.
575
588
  *
576
589
  * @param gcResult - The result of the GC run on the gcData.
577
590
  * @param allReferencedNodeIds - Nodes referenced in this GC run + referenced between previous and current GC run.
578
591
  * @param currentReferenceTimestampMs - The timestamp to be used for unreferenced nodes' timestamp.
579
- * @returns - A list of sweep ready nodes, i.e., nodes that ready to be deleted.
592
+ * @returns A list of sweep ready nodes, i.e., nodes that ready to be deleted.
580
593
  */
581
594
  private runMarkPhase(
582
595
  gcResult: IGCResult,
@@ -635,7 +648,7 @@ export class GarbageCollector implements IGarbageCollector {
635
648
  * @param sweepReadyNodes - List of nodes that are sweep ready.
636
649
  * @param currentReferenceTimestampMs - The timestamp to be used for unreferenced nodes' timestamp.
637
650
  * @param logger - The logger to be used to log any telemetry.
638
- * @returns - A list of nodes that have been deleted.
651
+ * @returns A list of nodes that have been deleted.
639
652
  */
640
653
  private runSweepPhase(
641
654
  gcResult: IGCResult,
@@ -714,7 +727,7 @@ export class GarbageCollector implements IGarbageCollector {
714
727
  * This function identifies nodes that were referenced since the last run.
715
728
  * If these nodes are currently unreferenced, they will be assigned new unreferenced state by the current run.
716
729
  *
717
- * @returns - a list of all nodes referenced from the last local summary until now.
730
+ * @returns A list of all nodes referenced from the last local summary until now.
718
731
  */
719
732
  private findAllNodesReferencedBetweenGCs(
720
733
  currentGCData: IGarbageCollectionData,
@@ -832,45 +845,15 @@ export class GarbageCollector implements IGarbageCollector {
832
845
  }
833
846
 
834
847
  /**
835
- * Called to refresh the latest summary state. This happens when either a pending summary is acked or a snapshot
836
- * is downloaded and should be used to update the state.
848
+ * Called to refresh the latest summary state. This happens when either a pending summary is acked.
837
849
  */
838
- public async refreshLatestSummary(
839
- proposalHandle: string | undefined,
840
- result: RefreshSummaryResult,
841
- readAndParseBlob: ReadAndParseBlob,
842
- ): Promise<void> {
843
- const latestSnapshotData = await this.summaryStateTracker.refreshLatestSummary(
844
- proposalHandle,
845
- result,
846
- readAndParseBlob,
847
- );
848
-
849
- // If the latest summary was updated but it was not tracked by this client, our state needs to be updated from
850
- // this snapshot data.
851
- if (this.shouldRunGC && result.latestSummaryUpdated && !result.wasSummaryTracked) {
852
- // The current reference timestamp should be available if we are refreshing state from a snapshot. There has
853
- // to be at least one op (summary op / ack, if nothing else) if a snapshot was taken.
854
- const currentReferenceTimestampMs = this.runtime.getCurrentReferenceTimestampMs();
855
- if (currentReferenceTimestampMs === undefined) {
856
- throw DataProcessingError.create(
857
- "No reference timestamp when updating GC state from snapshot",
858
- "refreshLatestSummary",
859
- undefined,
860
- {
861
- proposalHandle,
862
- summaryRefSeq: result.summaryRefSeq,
863
- gcConfigs: JSON.stringify(this.configs),
864
- },
865
- );
866
- }
867
- this.updateStateFromSnapshotData(latestSnapshotData, currentReferenceTimestampMs);
868
- }
850
+ public async refreshLatestSummary(result: IRefreshSummaryResult): Promise<void> {
851
+ return this.summaryStateTracker.refreshLatestSummary(result);
869
852
  }
870
853
 
871
854
  /**
872
855
  * Called when a node with the given id is updated. If the node is inactive, log an error.
873
- * @param nodePath - The id of the node that changed.
856
+ * @param nodePath - The path of the node that changed.
874
857
  * @param reason - Whether the node was loaded or changed.
875
858
  * @param timestampMs - The timestamp when the node changed.
876
859
  * @param packagePath - The package path of the node. This may not be available if the node hasn't been loaded yet.
@@ -887,6 +870,7 @@ export class GarbageCollector implements IGarbageCollector {
887
870
  return;
888
871
  }
889
872
 
873
+ // This will log if appropriate
890
874
  this.telemetryTracker.nodeUsed({
891
875
  id: nodePath,
892
876
  usageType: reason,
@@ -898,6 +882,29 @@ export class GarbageCollector implements IGarbageCollector {
898
882
  lastSummaryTime: this.getLastSummaryTimestampMs(),
899
883
  viaHandle: requestHeaders?.[RuntimeHeaders.viaHandle],
900
884
  });
885
+
886
+ // Unless this is a Loaded event, we're done after telemetry tracking
887
+ if (reason !== "Loaded") {
888
+ return;
889
+ }
890
+
891
+ // We may throw when loading an Inactive object, depending on these preconditions
892
+ const shouldThrowOnInactiveLoad =
893
+ !this.isSummarizerClient &&
894
+ this.configs.throwOnInactiveLoad === true &&
895
+ requestHeaders?.[AllowInactiveRequestHeaderKey] !== true;
896
+ const state = this.unreferencedNodesState.get(nodePath)?.state;
897
+
898
+ if (shouldThrowOnInactiveLoad && state === "Inactive") {
899
+ const request: IRequest = { url: nodePath };
900
+ const error = responseToException(
901
+ createResponseError(404, "Object is inactive", request, {
902
+ [InactiveResponseHeaderKey]: true,
903
+ }),
904
+ request,
905
+ );
906
+ throw error;
907
+ }
901
908
  }
902
909
 
903
910
  /**
@@ -3,8 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { UsageError } from "@fluidframework/container-utils";
7
- import { MonitoringContext } from "@fluidframework/telemetry-utils";
6
+ import { MonitoringContext, UsageError } from "@fluidframework/telemetry-utils";
8
7
  import { IContainerRuntimeMetadata } from "../summary";
9
8
  import {
10
9
  currentGCVersion,
@@ -153,6 +152,8 @@ export function generateGCConfigs(
153
152
  throw new UsageError("inactive timeout should not be greater than the sweep timeout");
154
153
  }
155
154
 
155
+ const throwOnInactiveLoad: boolean | undefined = createParams.gcOptions.throwOnInactiveLoad;
156
+
156
157
  // Whether we are running in test mode. In this mode, unreferenced nodes are immediately deleted.
157
158
  const testMode =
158
159
  mc.config.getBoolean(gcTestModeKey) ?? createParams.gcOptions.runGCInTestMode === true;
@@ -172,6 +173,7 @@ export function generateGCConfigs(
172
173
  sessionExpiryTimeoutMs,
173
174
  sweepTimeoutMs,
174
175
  inactiveTimeoutMs,
176
+ throwOnInactiveLoad,
175
177
  persistedGcFeatureMatrix,
176
178
  gcVersionInBaseSnapshot,
177
179
  gcVersionInEffect,
@@ -17,7 +17,7 @@ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
17
17
  import {
18
18
  IContainerRuntimeMetadata,
19
19
  ICreateContainerMetadata,
20
- RefreshSummaryResult,
20
+ IRefreshSummaryResult,
21
21
  } from "../summary";
22
22
 
23
23
  export type GCVersion = number;
@@ -43,29 +43,28 @@ export const gcTombstoneGenerationOptionName = "gcTombstoneGeneration";
43
43
  */
44
44
  export const gcSweepGenerationOptionName = "gcSweepGeneration";
45
45
 
46
- // Feature gate key to turn GC on / off.
46
+ /** Config key to turn GC on / off. */
47
47
  export const runGCKey = "Fluid.GarbageCollection.RunGC";
48
- // Feature gate key to turn GC sweep on / off.
48
+ /** Config key to turn GC sweep on / off. */
49
49
  export const runSweepKey = "Fluid.GarbageCollection.RunSweep";
50
- // Feature gate key to turn GC test mode on / off.
50
+ /** Config key to turn GC test mode on / off. */
51
51
  export const gcTestModeKey = "Fluid.GarbageCollection.GCTestMode";
52
- // Feature gate key to expire a session after a set period of time.
52
+ /** Config key to expire a session after a set period of time. Defaults to true. */
53
53
  export const runSessionExpiryKey = "Fluid.GarbageCollection.RunSessionExpiry";
54
- // Feature gate key to turn GC sweep log off.
54
+ /** Config key to turn GC sweep log off. */
55
55
  export const disableSweepLogKey = "Fluid.GarbageCollection.DisableSweepLog";
56
- // Feature gate key to disable the tombstone feature, i.e., tombstone information is not read / written into summary.
56
+ /** Config key to disable the tombstone feature, i.e., tombstone information is not read / written into summary. */
57
57
  export const disableTombstoneKey = "Fluid.GarbageCollection.DisableTombstone";
58
- // Feature gate to enable throwing an error when tombstone object is loaded (requested).
58
+ /** Config key to enable throwing an error when tombstone object is loaded (requested). */
59
59
  export const throwOnTombstoneLoadKey = "Fluid.GarbageCollection.ThrowOnTombstoneLoad";
60
- // Feature gate to enable throwing an error when tombstone object is used (e.g. outgoing or incoming ops).
60
+ /** Config key to enable throwing an error when tombstone object is used (e.g. outgoing or incoming ops). */
61
61
  export const throwOnTombstoneUsageKey = "Fluid.GarbageCollection.ThrowOnTombstoneUsage";
62
- // Feature gate to enable GC version upgrade.
62
+ /** Config key to enable GC version upgrade. */
63
63
  export const gcVersionUpgradeToV3Key = "Fluid.GarbageCollection.GCVersionUpgradeToV3";
64
- // Feature gate to enable GC sweep for datastores.
65
- // TODO: Remove Test from the flag when we are confident to turn on sweep
66
- export const sweepDatastoresKey = "Fluid.GarbageCollection.Test.SweepDataStores";
67
- // Feature gate to enable GC sweep for attachment blobs.
68
- export const sweepAttachmentBlobsKey = "Fluid.GarbageCollection.Test.SweepAttachmentBlobs";
64
+ /** Config key to disable GC sweep for datastores. */
65
+ export const disableDatastoreSweepKey = "Fluid.GarbageCollection.DisableDataStoreSweep";
66
+ /** Config key to disable GC sweep for attachment blobs. */
67
+ export const disableAttachmentBlobSweepKey = "Fluid.GarbageCollection.DisableAttachmentBlobSweep";
69
68
 
70
69
  // One day in milliseconds.
71
70
  export const oneDayMs = 1 * 24 * 60 * 60 * 1000;
@@ -228,11 +227,7 @@ export interface IGarbageCollector {
228
227
  /** Returns the GC details generated from the base snapshot. */
229
228
  getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
230
229
  /** Called when the latest summary of the system has been refreshed. */
231
- refreshLatestSummary(
232
- proposalHandle: string | undefined,
233
- result: RefreshSummaryResult,
234
- readAndParseBlob: ReadAndParseBlob,
235
- ): Promise<void>;
230
+ refreshLatestSummary(result: IRefreshSummaryResult): Promise<void>;
236
231
  /** Called when a node is updated. Used to detect and log when an inactive node is changed or loaded. */
237
232
  nodeUpdated(
238
233
  nodePath: string,
@@ -263,7 +258,6 @@ export interface IGarbageCollectorCreateParams {
263
258
  readonly getLastSummaryTimestampMs: () => number | undefined;
264
259
  readonly readAndParseBlob: ReadAndParseBlob;
265
260
  readonly activeConnection: () => boolean;
266
- readonly getContainerDiagnosticId: () => string;
267
261
  }
268
262
 
269
263
  export interface IGCRuntimeOptions {
@@ -350,6 +344,8 @@ export interface IGarbageCollectorConfigs {
350
344
  readonly sweepTimeoutMs: number | undefined;
351
345
  /** The time after which an unreferenced node is inactive. */
352
346
  readonly inactiveTimeoutMs: number;
347
+ /** It is easier for users to diagnose InactiveObject usage if we throw on load, which this option enables */
348
+ readonly throwOnInactiveLoad: boolean | undefined;
353
349
  /** Tracks whether GC should run in test mode. In this mode, unreferenced objects are deleted immediately. */
354
350
  readonly testMode: boolean;
355
351
  /**
@@ -0,0 +1,145 @@
1
+ # Garbage Collection: Advanced configuration for early adopters
2
+
3
+ _For a technical overview of Garbage Collection, start with [GarbageCollection.md](./garbageCollection.md)_
4
+
5
+ GC Sweep is not yet enabled by default, and until that time early adopters have several configuration options available
6
+ for how to enable GC and monitor for any GC-impacting bugs that would need to be mitigated.
7
+
8
+ Please refer to the section [Techniques Used for Configuration](./garbageCollection.md#techniques-used-for-configuration)
9
+ before continuing, to ensure you're familiar with using "GC Options" and "Config Settings" for configuring GC.
10
+
11
+ ## What's on by default
12
+
13
+ GC Mark Phase is enabled by default, which includes marking objects that are ready to be deleted as Tombstones.
14
+ FF will log an informational event if/when a Tombstoned object is loaded - a scenario that would represent data loss if Sweep were enabled.
15
+ The eventName for the Tombstone log ends with `GC_Tombstone_DataStore_Requested`.
16
+
17
+ There's a similar event logged long before an object is Tombstoned. Ater only 7 days (configurable), an unreferenced object is considered
18
+ "Inactive", and FF will log if an Inactive object is loaded as well.
19
+ The eventName for the Inactive log ends with `InactiveObject_Loaded`.
20
+
21
+ ## Getting earlier signals: Shortening the InactiveObject timeout
22
+
23
+ The default timeout for an unreferenced object to become "Inactive" is 7 days. This is intended to be long enough such that
24
+ it's very unlikely to hit a legitimate case where an object is revived within the same session it was deleted (e.g. delete then undo).
25
+ Based on your application's user experience, you may choose to shorten this timeout to get an earlier signal (but beware of false positives).
26
+
27
+ To override the default InactiveObject timeout, use the `inactiveTimeoutMs` GC Option.
28
+ There's also a Config Setting which can be used for testing (if the Config Provider allows overriding via localStorage/sessionStorage):
29
+ `Fluid.GarbageCollection.TestOverride.InactiveTimeoutMs`
30
+
31
+ ## Enabling Tombstone Enforcement
32
+
33
+ By default, GC is marking objects as Tombstoned, but merely logging if they're used after that point.
34
+ You can enable enforcement of Tombstone objects to simulate real Sweep while having the peace of mind
35
+ that the data is not yet deleted from the user's file, and can be recovered.
36
+
37
+ The first step is to prevent the Fluid Framework from loading a Tombstoned object (via `handle.get()` as described previously),
38
+ by using this Config Setting:
39
+
40
+ ```ts
41
+ "Fluid.GarbageCollection.ThrowOnTombstoneLoad": true
42
+ ```
43
+
44
+ Now, even with `Fluid.GarbageCollection.ThrowOnTombstoneLoad` set to true, changes to a Tombstoned object will be allowed.
45
+ This is required for the advanced recovery options to work, explained [below](#advanced-back-door-recovering-and-reviving-tombstoned-objects).
46
+
47
+ To instruct FF to treat Tombstoned objects as if they are truly not present in the document, use this Config Setting:
48
+
49
+ ```ts
50
+ "Fluid.GarbageCollection.ThrowOnTombstoneUsage": true
51
+ ```
52
+
53
+ ### In case of emergency: Bumping the gcTombstoneGeneration
54
+
55
+ GC includes a mechanism for Tombstone by which all new documents may be stamped with a "Generation" number,
56
+ and if set then Tombstone is only enforceable for documents of the latest Generation. This number is specified
57
+ via the `gcTombstoneGeneration` GC Option, and will not change over the lifetime of a given document.
58
+
59
+ In case a bug is released that is found to cause GC errors, a bump to the gcTombstoneGeneration can be incuded
60
+ with the fix, which will prevent any user pain for those potentially affected documents that were exposed to the bug.
61
+
62
+ If gcTombstoneGeneration is unset, Tombstone enforcement will be enabled/disabled as otherwise configured.
63
+ In other words, until you start using this, Tombstone enforcement will apply to all documents.
64
+
65
+ ### Advanced "Back door": Recovering and reviving Tombstoned objects
66
+
67
+ If your application has Tombstone enabled and your users are encountering Tombstones - even at the point where
68
+ Tombstone enforcement is enabled - there is a way to still access these objects to recover them and property
69
+ reference them ("revival"). However, please understand that this is an advanced and unsupported path that may
70
+ be immediately deprecated at any time.
71
+
72
+ As mentioned above, bumping the gcTombstoneGeneration will free up impacted documents, but that's a permanent
73
+ mitigation - those documents will never be exposed to GC Tombstone or Sweep.
74
+
75
+ If there's a particular codepath in your application where objects being loaded may be Tombstoned,
76
+ you may use this advanced "back door" to recover them and then properly reference them, thus restoring the document.
77
+ For this to work, you must disable the `Fluid.GarbageCollection.ThrowOnTombstoneUsage` Config Setting.
78
+
79
+ When a Tombstoned object (via `handle.get()`) fails to load, the 404 response error object has an `underlyingResponseHeaders` with the
80
+ `isTombstoned` flag set to true: i.e. `error.underlyingResponseHeaders?.isTombstoned === true`. In this case,
81
+ you may turn around and use `IContainerRuntime.resolveHandle` with `allowTombstone: true` in `IRequest.headers` to request
82
+ the object again - this time it will succeed.
83
+
84
+ To be very clear once again - This path uses deprecated APIs (`resolveHandle`) and comes with no guarantees of support.
85
+
86
+ ### Tombstones and the Summarizer Client
87
+
88
+ Note: The Summarizer client will _never_ throw on usage or load of a Tombstoned object.
89
+
90
+ ## Enabling Sweep
91
+
92
+ To enable Sweep for the first time, set this GC Option:
93
+
94
+ ```ts
95
+ gcSweepGeneration: 0;
96
+ ```
97
+
98
+ This will enable sweep for all documents moving forward _as well as_ any documents created with `gcTombstoneGeneration: 0`
99
+ (this is a special case in the code).
100
+
101
+ ### A caveat...
102
+
103
+ If you used `gcTombstoneGeneration` **and ever bumped it**, you should skip 0 here to avoid enabling Sweep for old / at-risk documents:
104
+
105
+ ```ts
106
+ gcSweepGeneration: 1;
107
+ ```
108
+
109
+ Remember, you can always bump `gcSweepGeneration` to disable Sweep for all existing documents and start fresh,
110
+ in case a major bug is discovered and fixed.
111
+
112
+ ### More about gcSweepGeneration and gcTombstoneGeneration
113
+
114
+ `gcSweepGeneration` is persisted and immutable in the document, just like `gcTombstoneGeneration`.
115
+ However, behavior differs in a few important ways.
116
+
117
+ For Tombstone, if `gcTombstoneGeneration` is not set, Tombstone enforcement will be **enabled**.
118
+ For Sweep however, if `gcSweepGeneration` is not set, Sweep enforcement will be **disabled**.
119
+
120
+ This means that until the `gcSweepGeneration` GC Option is set, _no existing document will be eligible for Sweep, ever_.
121
+ So all documents created since the most recent bump to the gcSweepGeneration will have Sweep enabled.
122
+ Note that if `gcSweepGeneration` is set and matches, Tombstone Mode is off for the session and `gcTombstoneGeneration` is ignored.
123
+
124
+ And as mentioned above, there is a special case when `gcSweepGeneration === 0`: Any document with `gcTombstoneGeneration: 0` will
125
+ be eligible for Sweep as well. This was done for historical reasons due to circumstances during GC's development.
126
+
127
+ ## More Advanced Configurations
128
+
129
+ There are a handful of other configuration options/settings that can be used to tweak GC's behavior,
130
+ mostly for testing. Please refer to the function [`generateGCConfigs` in gcConfigs.ts](./gcConfigs.ts) and the
131
+ [setting/option names listed in gcDefinitions.ts](./gcDefinitions.ts) for the full story.
132
+
133
+ Examples of available advanced configuration include:
134
+
135
+ - Disabling GC permanently for new files
136
+ - Overriding GC Mark/Sweep enablement for this session:
137
+ - Disabling running GC Mark and/or Sweep phases for this session
138
+ - Forcing GC Mark and/or Sweep to run for this session even if otherwise it would be disabled
139
+ - Disabling Tombstone Mode (don't even mark objects as Tombstones)
140
+ - Disabling the deletion of either DataStores or AttachmentBlobs independent of one another (when Sweep is enabled)
141
+ - Overriding the default Session Expiry for new files (or disabling it altogether, which will also disable Tombstone/Sweep)
142
+ - Overriding the Sweep Timeout, _independent of Session Expiry_, so use with care (for testing purposes only - data loss could occur)
143
+ - Running in "Test Mode", where objects are deleted as soon as they're unreferenced
144
+ - Force "Full GC" to run, which ignores incremental optimizations based on previously computed GC Data
145
+ - Treat InactiveObjects like Tombstones: throw an error on load (with the same back door to follow-up with a successful request)
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { assert } from "@fluidframework/common-utils";
6
+ import { assert } from "@fluidframework/core-utils";
7
7
  import { ISnapshotTree } from "@fluidframework/protocol-definitions";
8
8
  import {
9
9
  gcBlobPrefix,
@@ -12,7 +12,6 @@ import {
12
12
  IGarbageCollectionData,
13
13
  IGarbageCollectionDetailsBase,
14
14
  } from "@fluidframework/runtime-definitions";
15
- import { TelemetryDataTag } from "@fluidframework/telemetry-utils";
16
15
  import { GCFeatureMatrix, GCVersion, IGCMetadata } from "./gcDefinitions";
17
16
  import {
18
17
  IGarbageCollectionNodeData,
@@ -304,13 +303,3 @@ export function unpackChildNodesGCDetails(gcDetails: IGarbageCollectionDetailsBa
304
303
  export function trimLeadingAndTrailingSlashes(str: string) {
305
304
  return str.replace(/^\/+|\/+$/g, "");
306
305
  }
307
-
308
- /**
309
- * Tags the passed value as a CodeArtifact and returns the tagged value.
310
- */
311
- export function tagAsCodeArtifact(value: string) {
312
- return {
313
- value,
314
- tag: TelemetryDataTag.CodeArtifact,
315
- };
316
- }