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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (477) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +4 -3
  3. package/dist/batchTracker.d.ts +1 -1
  4. package/dist/batchTracker.d.ts.map +1 -1
  5. package/dist/batchTracker.js +5 -4
  6. package/dist/batchTracker.js.map +1 -1
  7. package/dist/blobManager.d.ts +4 -21
  8. package/dist/blobManager.d.ts.map +1 -1
  9. package/dist/blobManager.js +119 -185
  10. package/dist/blobManager.js.map +1 -1
  11. package/dist/connectionTelemetry.d.ts.map +1 -1
  12. package/dist/connectionTelemetry.js +13 -12
  13. package/dist/connectionTelemetry.js.map +1 -1
  14. package/dist/containerRuntime.d.ts +99 -16
  15. package/dist/containerRuntime.d.ts.map +1 -1
  16. package/dist/containerRuntime.js +380 -242
  17. package/dist/containerRuntime.js.map +1 -1
  18. package/dist/dataStore.d.ts.map +1 -1
  19. package/dist/dataStore.js +4 -5
  20. package/dist/dataStore.js.map +1 -1
  21. package/dist/dataStoreContext.d.ts +2 -1
  22. package/dist/dataStoreContext.d.ts.map +1 -1
  23. package/dist/dataStoreContext.js +40 -41
  24. package/dist/dataStoreContext.js.map +1 -1
  25. package/dist/dataStoreContexts.d.ts +1 -2
  26. package/dist/dataStoreContexts.d.ts.map +1 -1
  27. package/dist/dataStoreContexts.js +7 -8
  28. package/dist/dataStoreContexts.js.map +1 -1
  29. package/dist/dataStoreRegistry.js +2 -2
  30. package/dist/dataStoreRegistry.js.map +1 -1
  31. package/dist/dataStores.d.ts.map +1 -1
  32. package/dist/dataStores.js +23 -25
  33. package/dist/dataStores.js.map +1 -1
  34. package/dist/deltaManagerProxyBase.d.ts +1 -1
  35. package/dist/deltaManagerProxyBase.js +2 -2
  36. package/dist/deltaManagerProxyBase.js.map +1 -1
  37. package/dist/deltaScheduler.js +6 -6
  38. package/dist/deltaScheduler.js.map +1 -1
  39. package/dist/error.d.ts +14 -0
  40. package/dist/error.d.ts.map +1 -0
  41. package/dist/error.js +21 -0
  42. package/dist/error.js.map +1 -0
  43. package/dist/gc/garbageCollection.d.ts +4 -6
  44. package/dist/gc/garbageCollection.d.ts.map +1 -1
  45. package/dist/gc/garbageCollection.js +26 -25
  46. package/dist/gc/garbageCollection.js.map +1 -1
  47. package/dist/gc/gcConfigs.d.ts.map +1 -1
  48. package/dist/gc/gcConfigs.js +5 -3
  49. package/dist/gc/gcConfigs.js.map +1 -1
  50. package/dist/gc/gcDefinitions.d.ts +4 -2
  51. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  52. package/dist/gc/gcDefinitions.js.map +1 -1
  53. package/dist/gc/gcHelpers.js +7 -7
  54. package/dist/gc/gcHelpers.js.map +1 -1
  55. package/dist/gc/gcSummaryStateTracker.d.ts +4 -7
  56. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  57. package/dist/gc/gcSummaryStateTracker.js +15 -52
  58. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  59. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  60. package/dist/gc/gcTelemetry.js +2 -0
  61. package/dist/gc/gcTelemetry.js.map +1 -1
  62. package/dist/gc/gcUnreferencedStateTracker.js +4 -4
  63. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  64. package/dist/gc/index.d.ts +1 -1
  65. package/dist/gc/index.d.ts.map +1 -1
  66. package/dist/gc/index.js +1 -2
  67. package/dist/gc/index.js.map +1 -1
  68. package/dist/id-compressor/appendOnlySortedMap.d.ts +8 -30
  69. package/dist/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
  70. package/dist/id-compressor/appendOnlySortedMap.js +26 -68
  71. package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
  72. package/dist/id-compressor/finalSpace.d.ts +29 -0
  73. package/dist/id-compressor/finalSpace.d.ts.map +1 -0
  74. package/dist/id-compressor/finalSpace.js +62 -0
  75. package/dist/id-compressor/finalSpace.js.map +1 -0
  76. package/dist/id-compressor/idCompressor.d.ts +25 -250
  77. package/dist/id-compressor/idCompressor.d.ts.map +1 -1
  78. package/dist/id-compressor/idCompressor.js +387 -1150
  79. package/dist/id-compressor/idCompressor.js.map +1 -1
  80. package/dist/id-compressor/identifiers.d.ts +32 -0
  81. package/dist/id-compressor/identifiers.d.ts.map +1 -0
  82. package/dist/id-compressor/identifiers.js +15 -0
  83. package/dist/id-compressor/identifiers.js.map +1 -0
  84. package/dist/id-compressor/index.d.ts +5 -6
  85. package/dist/id-compressor/index.d.ts.map +1 -1
  86. package/dist/id-compressor/index.js +20 -26
  87. package/dist/id-compressor/index.js.map +1 -1
  88. package/dist/id-compressor/persistanceUtilities.d.ts +22 -0
  89. package/dist/id-compressor/persistanceUtilities.d.ts.map +1 -0
  90. package/dist/id-compressor/persistanceUtilities.js +43 -0
  91. package/dist/id-compressor/persistanceUtilities.js.map +1 -0
  92. package/dist/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
  93. package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
  94. package/dist/id-compressor/sessionSpaceNormalizer.js +80 -0
  95. package/dist/id-compressor/sessionSpaceNormalizer.js.map +1 -0
  96. package/dist/id-compressor/sessions.d.ts +115 -0
  97. package/dist/id-compressor/sessions.d.ts.map +1 -0
  98. package/dist/id-compressor/sessions.js +305 -0
  99. package/dist/id-compressor/sessions.js.map +1 -0
  100. package/dist/id-compressor/utilities.d.ts +49 -0
  101. package/dist/id-compressor/utilities.d.ts.map +1 -0
  102. package/dist/id-compressor/utilities.js +166 -0
  103. package/dist/id-compressor/utilities.js.map +1 -0
  104. package/dist/index.d.ts +3 -3
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.js +6 -4
  107. package/dist/index.js.map +1 -1
  108. package/dist/opLifecycle/opCompressor.js +5 -5
  109. package/dist/opLifecycle/opCompressor.js.map +1 -1
  110. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  111. package/dist/opLifecycle/opDecompressor.js +11 -10
  112. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  113. package/dist/opLifecycle/opGroupingManager.js +3 -3
  114. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  115. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  116. package/dist/opLifecycle/opSplitter.js +14 -15
  117. package/dist/opLifecycle/opSplitter.js.map +1 -1
  118. package/dist/opLifecycle/outbox.d.ts +1 -0
  119. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  120. package/dist/opLifecycle/outbox.js +16 -17
  121. package/dist/opLifecycle/outbox.js.map +1 -1
  122. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  123. package/dist/opLifecycle/remoteMessageProcessor.js +11 -5
  124. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  125. package/dist/packageVersion.d.ts +1 -1
  126. package/dist/packageVersion.js +1 -1
  127. package/dist/packageVersion.js.map +1 -1
  128. package/dist/pendingStateManager.d.ts +12 -5
  129. package/dist/pendingStateManager.d.ts.map +1 -1
  130. package/dist/pendingStateManager.js +36 -23
  131. package/dist/pendingStateManager.js.map +1 -1
  132. package/dist/scheduleManager.d.ts.map +1 -1
  133. package/dist/scheduleManager.js +23 -23
  134. package/dist/scheduleManager.js.map +1 -1
  135. package/dist/summary/index.d.ts +3 -3
  136. package/dist/summary/index.d.ts.map +1 -1
  137. package/dist/summary/index.js +2 -1
  138. package/dist/summary/index.js.map +1 -1
  139. package/dist/summary/orderedClientElection.d.ts +2 -3
  140. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  141. package/dist/summary/orderedClientElection.js +8 -8
  142. package/dist/summary/orderedClientElection.js.map +1 -1
  143. package/dist/summary/runWhileConnectedCoordinator.js +3 -3
  144. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  145. package/dist/summary/runningSummarizer.d.ts +27 -4
  146. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  147. package/dist/summary/runningSummarizer.js +246 -74
  148. package/dist/summary/runningSummarizer.js.map +1 -1
  149. package/dist/summary/summarizer.d.ts +6 -5
  150. package/dist/summary/summarizer.d.ts.map +1 -1
  151. package/dist/summary/summarizer.js +73 -69
  152. package/dist/summary/summarizer.js.map +1 -1
  153. package/dist/summary/summarizerClientElection.d.ts +2 -2
  154. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  155. package/dist/summary/summarizerClientElection.js +2 -2
  156. package/dist/summary/summarizerClientElection.js.map +1 -1
  157. package/dist/summary/summarizerHeuristics.js +2 -2
  158. package/dist/summary/summarizerHeuristics.js.map +1 -1
  159. package/dist/summary/summarizerNode/index.d.ts +1 -1
  160. package/dist/summary/summarizerNode/index.d.ts.map +1 -1
  161. package/dist/summary/summarizerNode/index.js.map +1 -1
  162. package/dist/summary/summarizerNode/summarizerNode.d.ts +5 -14
  163. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  164. package/dist/summary/summarizerNode/summarizerNode.js +32 -109
  165. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  166. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +6 -30
  167. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  168. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  169. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +0 -11
  170. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  171. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +5 -88
  172. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  173. package/dist/summary/summarizerTypes.d.ts +38 -25
  174. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  175. package/dist/summary/summarizerTypes.js.map +1 -1
  176. package/dist/summary/summaryCollection.d.ts +2 -3
  177. package/dist/summary/summaryCollection.d.ts.map +1 -1
  178. package/dist/summary/summaryCollection.js +9 -8
  179. package/dist/summary/summaryCollection.js.map +1 -1
  180. package/dist/summary/summaryFormat.js +2 -2
  181. package/dist/summary/summaryFormat.js.map +1 -1
  182. package/dist/summary/summaryGenerator.d.ts +10 -4
  183. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  184. package/dist/summary/summaryGenerator.js +52 -48
  185. package/dist/summary/summaryGenerator.js.map +1 -1
  186. package/dist/summary/summaryManager.d.ts +7 -6
  187. package/dist/summary/summaryManager.d.ts.map +1 -1
  188. package/dist/summary/summaryManager.js +30 -22
  189. package/dist/summary/summaryManager.js.map +1 -1
  190. package/lib/batchTracker.d.ts +1 -1
  191. package/lib/batchTracker.d.ts.map +1 -1
  192. package/lib/batchTracker.js +3 -2
  193. package/lib/batchTracker.js.map +1 -1
  194. package/lib/blobManager.d.ts +4 -21
  195. package/lib/blobManager.d.ts.map +1 -1
  196. package/lib/blobManager.js +91 -157
  197. package/lib/blobManager.js.map +1 -1
  198. package/lib/connectionTelemetry.d.ts.map +1 -1
  199. package/lib/connectionTelemetry.js +2 -1
  200. package/lib/connectionTelemetry.js.map +1 -1
  201. package/lib/containerRuntime.d.ts +99 -16
  202. package/lib/containerRuntime.d.ts.map +1 -1
  203. package/lib/containerRuntime.js +332 -192
  204. package/lib/containerRuntime.js.map +1 -1
  205. package/lib/dataStore.d.ts.map +1 -1
  206. package/lib/dataStore.js +2 -3
  207. package/lib/dataStore.js.map +1 -1
  208. package/lib/dataStoreContext.d.ts +2 -1
  209. package/lib/dataStoreContext.d.ts.map +1 -1
  210. package/lib/dataStoreContext.js +3 -4
  211. package/lib/dataStoreContext.js.map +1 -1
  212. package/lib/dataStoreContexts.d.ts +1 -2
  213. package/lib/dataStoreContexts.d.ts.map +1 -1
  214. package/lib/dataStoreContexts.js +1 -2
  215. package/lib/dataStoreContexts.js.map +1 -1
  216. package/lib/dataStoreRegistry.js +1 -1
  217. package/lib/dataStoreRegistry.js.map +1 -1
  218. package/lib/dataStores.d.ts.map +1 -1
  219. package/lib/dataStores.js +2 -4
  220. package/lib/dataStores.js.map +1 -1
  221. package/lib/deltaManagerProxyBase.d.ts +1 -1
  222. package/lib/deltaManagerProxyBase.js +1 -1
  223. package/lib/deltaManagerProxyBase.js.map +1 -1
  224. package/lib/deltaScheduler.js +1 -1
  225. package/lib/deltaScheduler.js.map +1 -1
  226. package/lib/error.d.ts +14 -0
  227. package/lib/error.d.ts.map +1 -0
  228. package/lib/error.js +17 -0
  229. package/lib/error.js.map +1 -0
  230. package/lib/gc/garbageCollection.d.ts +4 -6
  231. package/lib/gc/garbageCollection.d.ts.map +1 -1
  232. package/lib/gc/garbageCollection.js +26 -25
  233. package/lib/gc/garbageCollection.js.map +1 -1
  234. package/lib/gc/gcConfigs.d.ts.map +1 -1
  235. package/lib/gc/gcConfigs.js +3 -1
  236. package/lib/gc/gcConfigs.js.map +1 -1
  237. package/lib/gc/gcDefinitions.d.ts +4 -2
  238. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  239. package/lib/gc/gcDefinitions.js.map +1 -1
  240. package/lib/gc/gcHelpers.js +1 -1
  241. package/lib/gc/gcHelpers.js.map +1 -1
  242. package/lib/gc/gcSummaryStateTracker.d.ts +4 -7
  243. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  244. package/lib/gc/gcSummaryStateTracker.js +16 -53
  245. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  246. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  247. package/lib/gc/gcTelemetry.js +2 -0
  248. package/lib/gc/gcTelemetry.js.map +1 -1
  249. package/lib/gc/gcUnreferencedStateTracker.js +1 -1
  250. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  251. package/lib/gc/index.d.ts +1 -1
  252. package/lib/gc/index.d.ts.map +1 -1
  253. package/lib/gc/index.js +1 -1
  254. package/lib/gc/index.js.map +1 -1
  255. package/lib/id-compressor/appendOnlySortedMap.d.ts +8 -30
  256. package/lib/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
  257. package/lib/id-compressor/appendOnlySortedMap.js +25 -66
  258. package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
  259. package/lib/id-compressor/finalSpace.d.ts +29 -0
  260. package/lib/id-compressor/finalSpace.d.ts.map +1 -0
  261. package/lib/id-compressor/finalSpace.js +58 -0
  262. package/lib/id-compressor/finalSpace.js.map +1 -0
  263. package/lib/id-compressor/idCompressor.d.ts +25 -250
  264. package/lib/id-compressor/idCompressor.d.ts.map +1 -1
  265. package/lib/id-compressor/idCompressor.js +382 -1139
  266. package/lib/id-compressor/idCompressor.js.map +1 -1
  267. package/lib/id-compressor/identifiers.d.ts +32 -0
  268. package/lib/id-compressor/identifiers.d.ts.map +1 -0
  269. package/lib/id-compressor/identifiers.js +11 -0
  270. package/lib/id-compressor/identifiers.js.map +1 -0
  271. package/lib/id-compressor/index.d.ts +5 -6
  272. package/lib/id-compressor/index.d.ts.map +1 -1
  273. package/lib/id-compressor/index.js +5 -6
  274. package/lib/id-compressor/index.js.map +1 -1
  275. package/lib/id-compressor/persistanceUtilities.d.ts +22 -0
  276. package/lib/id-compressor/persistanceUtilities.d.ts.map +1 -0
  277. package/lib/id-compressor/persistanceUtilities.js +34 -0
  278. package/lib/id-compressor/persistanceUtilities.js.map +1 -0
  279. package/lib/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
  280. package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
  281. package/lib/id-compressor/sessionSpaceNormalizer.js +76 -0
  282. package/lib/id-compressor/sessionSpaceNormalizer.js.map +1 -0
  283. package/lib/id-compressor/sessions.d.ts +115 -0
  284. package/lib/id-compressor/sessions.d.ts.map +1 -0
  285. package/lib/id-compressor/sessions.js +290 -0
  286. package/lib/id-compressor/sessions.js.map +1 -0
  287. package/lib/id-compressor/utilities.d.ts +49 -0
  288. package/lib/id-compressor/utilities.d.ts.map +1 -0
  289. package/lib/id-compressor/utilities.js +148 -0
  290. package/lib/id-compressor/utilities.js.map +1 -0
  291. package/lib/index.d.ts +3 -3
  292. package/lib/index.d.ts.map +1 -1
  293. package/lib/index.js +2 -2
  294. package/lib/index.js.map +1 -1
  295. package/lib/opLifecycle/opCompressor.js +3 -3
  296. package/lib/opLifecycle/opCompressor.js.map +1 -1
  297. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  298. package/lib/opLifecycle/opDecompressor.js +2 -1
  299. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  300. package/lib/opLifecycle/opGroupingManager.js +1 -1
  301. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  302. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  303. package/lib/opLifecycle/opSplitter.js +2 -3
  304. package/lib/opLifecycle/opSplitter.js.map +1 -1
  305. package/lib/opLifecycle/outbox.d.ts +1 -0
  306. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  307. package/lib/opLifecycle/outbox.js +7 -8
  308. package/lib/opLifecycle/outbox.js.map +1 -1
  309. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  310. package/lib/opLifecycle/remoteMessageProcessor.js +12 -6
  311. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  312. package/lib/packageVersion.d.ts +1 -1
  313. package/lib/packageVersion.js +1 -1
  314. package/lib/packageVersion.js.map +1 -1
  315. package/lib/pendingStateManager.d.ts +12 -5
  316. package/lib/pendingStateManager.d.ts.map +1 -1
  317. package/lib/pendingStateManager.js +21 -8
  318. package/lib/pendingStateManager.js.map +1 -1
  319. package/lib/scheduleManager.d.ts.map +1 -1
  320. package/lib/scheduleManager.js +3 -3
  321. package/lib/scheduleManager.js.map +1 -1
  322. package/lib/summary/index.d.ts +3 -3
  323. package/lib/summary/index.d.ts.map +1 -1
  324. package/lib/summary/index.js +1 -1
  325. package/lib/summary/index.js.map +1 -1
  326. package/lib/summary/orderedClientElection.d.ts +2 -3
  327. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  328. package/lib/summary/orderedClientElection.js +3 -3
  329. package/lib/summary/orderedClientElection.js.map +1 -1
  330. package/lib/summary/runWhileConnectedCoordinator.js +1 -1
  331. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  332. package/lib/summary/runningSummarizer.d.ts +27 -4
  333. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  334. package/lib/summary/runningSummarizer.js +240 -68
  335. package/lib/summary/runningSummarizer.js.map +1 -1
  336. package/lib/summary/summarizer.d.ts +6 -5
  337. package/lib/summary/summarizer.d.ts.map +1 -1
  338. package/lib/summary/summarizer.js +69 -65
  339. package/lib/summary/summarizer.js.map +1 -1
  340. package/lib/summary/summarizerClientElection.d.ts +2 -2
  341. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  342. package/lib/summary/summarizerClientElection.js +1 -1
  343. package/lib/summary/summarizerClientElection.js.map +1 -1
  344. package/lib/summary/summarizerHeuristics.js +1 -1
  345. package/lib/summary/summarizerHeuristics.js.map +1 -1
  346. package/lib/summary/summarizerNode/index.d.ts +1 -1
  347. package/lib/summary/summarizerNode/index.d.ts.map +1 -1
  348. package/lib/summary/summarizerNode/index.js.map +1 -1
  349. package/lib/summary/summarizerNode/summarizerNode.d.ts +5 -14
  350. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  351. package/lib/summary/summarizerNode/summarizerNode.js +16 -93
  352. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  353. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +6 -30
  354. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  355. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  356. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +0 -11
  357. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  358. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +3 -86
  359. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  360. package/lib/summary/summarizerTypes.d.ts +38 -25
  361. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  362. package/lib/summary/summarizerTypes.js.map +1 -1
  363. package/lib/summary/summaryCollection.d.ts +2 -3
  364. package/lib/summary/summaryCollection.d.ts.map +1 -1
  365. package/lib/summary/summaryCollection.js +2 -1
  366. package/lib/summary/summaryCollection.js.map +1 -1
  367. package/lib/summary/summaryFormat.js +1 -1
  368. package/lib/summary/summaryFormat.js.map +1 -1
  369. package/lib/summary/summaryGenerator.d.ts +10 -4
  370. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  371. package/lib/summary/summaryGenerator.js +46 -42
  372. package/lib/summary/summaryGenerator.js.map +1 -1
  373. package/lib/summary/summaryManager.d.ts +7 -6
  374. package/lib/summary/summaryManager.d.ts.map +1 -1
  375. package/lib/summary/summaryManager.js +26 -18
  376. package/lib/summary/summaryManager.js.map +1 -1
  377. package/package.json +30 -29
  378. package/src/batchTracker.ts +3 -2
  379. package/src/blobManager.ts +105 -185
  380. package/src/connectionTelemetry.ts +2 -1
  381. package/src/containerRuntime.ts +481 -267
  382. package/src/dataStore.ts +2 -3
  383. package/src/dataStoreContext.ts +5 -8
  384. package/src/dataStoreContexts.ts +2 -4
  385. package/src/dataStoreRegistry.ts +1 -1
  386. package/src/dataStores.ts +4 -7
  387. package/src/deltaManagerProxyBase.ts +1 -1
  388. package/src/deltaScheduler.ts +1 -1
  389. package/src/error.ts +18 -0
  390. package/src/gc/garbageCollection.ts +39 -41
  391. package/src/gc/gcConfigs.ts +4 -2
  392. package/src/gc/gcDefinitions.ts +4 -6
  393. package/src/gc/gcHelpers.ts +1 -1
  394. package/src/gc/gcSummaryStateTracker.ts +19 -65
  395. package/src/gc/gcTelemetry.ts +2 -0
  396. package/src/gc/gcUnreferencedStateTracker.ts +1 -1
  397. package/src/gc/index.ts +0 -1
  398. package/src/id-compressor/appendOnlySortedMap.ts +26 -87
  399. package/src/id-compressor/finalSpace.ts +67 -0
  400. package/src/id-compressor/idCompressor.ts +456 -1681
  401. package/src/id-compressor/identifiers.ts +42 -0
  402. package/src/id-compressor/index.ts +11 -20
  403. package/src/id-compressor/persistanceUtilities.ts +58 -0
  404. package/src/id-compressor/sessionSpaceNormalizer.ts +83 -0
  405. package/src/id-compressor/sessions.ts +405 -0
  406. package/src/id-compressor/utilities.ts +187 -0
  407. package/src/index.ts +7 -1
  408. package/src/opLifecycle/opCompressor.ts +3 -3
  409. package/src/opLifecycle/opDecompressor.ts +2 -1
  410. package/src/opLifecycle/opGroupingManager.ts +1 -1
  411. package/src/opLifecycle/opSplitter.ts +4 -4
  412. package/src/opLifecycle/outbox.ts +14 -11
  413. package/src/opLifecycle/remoteMessageProcessor.ts +19 -6
  414. package/src/packageVersion.ts +1 -1
  415. package/src/pendingStateManager.ts +50 -29
  416. package/src/scheduleManager.ts +6 -4
  417. package/src/summary/index.ts +4 -3
  418. package/src/summary/orderedClientElection.ts +8 -5
  419. package/src/summary/runWhileConnectedCoordinator.ts +1 -1
  420. package/src/summary/runningSummarizer.ts +273 -97
  421. package/src/summary/summarizer.ts +23 -12
  422. package/src/summary/summarizerClientElection.ts +2 -2
  423. package/src/summary/summarizerHeuristics.ts +1 -1
  424. package/src/summary/summarizerNode/index.ts +1 -2
  425. package/src/summary/summarizerNode/summarizerNode.ts +23 -145
  426. package/src/summary/summarizerNode/summarizerNodeUtils.ts +7 -38
  427. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +3 -123
  428. package/src/summary/summarizerTypes.ts +40 -25
  429. package/src/summary/summaryCollection.ts +3 -3
  430. package/src/summary/summaryFormat.ts +1 -1
  431. package/src/summary/summaryGenerator.ts +52 -55
  432. package/src/summary/summaryManager.ts +36 -13
  433. package/dist/id-compressor/idRange.d.ts +0 -11
  434. package/dist/id-compressor/idRange.d.ts.map +0 -1
  435. package/dist/id-compressor/idRange.js +0 -29
  436. package/dist/id-compressor/idRange.js.map +0 -1
  437. package/dist/id-compressor/numericUuid.d.ts +0 -59
  438. package/dist/id-compressor/numericUuid.d.ts.map +0 -1
  439. package/dist/id-compressor/numericUuid.js +0 -325
  440. package/dist/id-compressor/numericUuid.js.map +0 -1
  441. package/dist/id-compressor/sessionIdNormalizer.d.ts +0 -138
  442. package/dist/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
  443. package/dist/id-compressor/sessionIdNormalizer.js +0 -483
  444. package/dist/id-compressor/sessionIdNormalizer.js.map +0 -1
  445. package/dist/id-compressor/utils.d.ts +0 -57
  446. package/dist/id-compressor/utils.d.ts.map +0 -1
  447. package/dist/id-compressor/utils.js +0 -90
  448. package/dist/id-compressor/utils.js.map +0 -1
  449. package/dist/id-compressor/uuidUtilities.d.ts +0 -28
  450. package/dist/id-compressor/uuidUtilities.d.ts.map +0 -1
  451. package/dist/id-compressor/uuidUtilities.js +0 -104
  452. package/dist/id-compressor/uuidUtilities.js.map +0 -1
  453. package/lib/id-compressor/idRange.d.ts +0 -11
  454. package/lib/id-compressor/idRange.d.ts.map +0 -1
  455. package/lib/id-compressor/idRange.js +0 -25
  456. package/lib/id-compressor/idRange.js.map +0 -1
  457. package/lib/id-compressor/numericUuid.d.ts +0 -59
  458. package/lib/id-compressor/numericUuid.d.ts.map +0 -1
  459. package/lib/id-compressor/numericUuid.js +0 -315
  460. package/lib/id-compressor/numericUuid.js.map +0 -1
  461. package/lib/id-compressor/sessionIdNormalizer.d.ts +0 -138
  462. package/lib/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
  463. package/lib/id-compressor/sessionIdNormalizer.js +0 -479
  464. package/lib/id-compressor/sessionIdNormalizer.js.map +0 -1
  465. package/lib/id-compressor/utils.d.ts +0 -57
  466. package/lib/id-compressor/utils.d.ts.map +0 -1
  467. package/lib/id-compressor/utils.js +0 -79
  468. package/lib/id-compressor/utils.js.map +0 -1
  469. package/lib/id-compressor/uuidUtilities.d.ts +0 -28
  470. package/lib/id-compressor/uuidUtilities.d.ts.map +0 -1
  471. package/lib/id-compressor/uuidUtilities.js +0 -96
  472. package/lib/id-compressor/uuidUtilities.js.map +0 -1
  473. package/src/id-compressor/idRange.ts +0 -35
  474. package/src/id-compressor/numericUuid.ts +0 -383
  475. package/src/id-compressor/sessionIdNormalizer.ts +0 -609
  476. package/src/id-compressor/utils.ts +0 -114
  477. package/src/id-compressor/uuidUtilities.ts +0 -120
package/src/dataStore.ts CHANGED
@@ -3,10 +3,9 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITelemetryLoggerExt, TelemetryDataTag } from "@fluidframework/telemetry-utils";
7
- import { assert, unreachableCase } from "@fluidframework/common-utils";
6
+ import { ITelemetryLoggerExt, TelemetryDataTag, UsageError } from "@fluidframework/telemetry-utils";
7
+ import { assert, unreachableCase } from "@fluidframework/core-utils";
8
8
  import { AttachState } from "@fluidframework/container-definitions";
9
- import { UsageError } from "@fluidframework/container-utils";
10
9
  import { FluidObject, IFluidHandle, IRequest, IResponse } from "@fluidframework/core-interfaces";
11
10
  import {
12
11
  AliasResult,
@@ -17,8 +17,8 @@ import {
17
17
  AttachState,
18
18
  ILoaderOptions,
19
19
  } from "@fluidframework/container-definitions";
20
- import { assert, Deferred, TypedEventEmitter } from "@fluidframework/common-utils";
21
- import { LazyPromise } from "@fluidframework/core-utils";
20
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
21
+ import { assert, Deferred, LazyPromise } from "@fluidframework/core-utils";
22
22
  import { IDocumentStorageService } from "@fluidframework/driver-definitions";
23
23
  import { BlobTreeEntry, readAndParse } from "@fluidframework/driver-utils";
24
24
  import {
@@ -57,6 +57,9 @@ import {
57
57
  import { addBlobToSummary, convertSummaryTreeToITree } from "@fluidframework/runtime-utils";
58
58
  import {
59
59
  createChildMonitoringContext,
60
+ DataCorruptionError,
61
+ DataProcessingError,
62
+ extractSafePropertiesFromMessage,
60
63
  generateStack,
61
64
  ITelemetryLoggerExt,
62
65
  LoggingError,
@@ -64,12 +67,6 @@ import {
64
67
  tagCodeArtifacts,
65
68
  ThresholdCounter,
66
69
  } from "@fluidframework/telemetry-utils";
67
- import {
68
- DataCorruptionError,
69
- DataProcessingError,
70
- extractSafePropertiesFromMessage,
71
- } from "@fluidframework/container-utils";
72
-
73
70
  import {
74
71
  dataStoreAttributesBlobName,
75
72
  hasIsolatedChannels,
@@ -3,10 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
7
- import { assert, Deferred } from "@fluidframework/common-utils";
8
- import { Lazy } from "@fluidframework/core-utils";
9
- import { IDisposable } from "@fluidframework/core-interfaces";
6
+ import { assert, Deferred, Lazy } from "@fluidframework/core-utils";
7
+ import { IDisposable, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
10
8
  import { createChildLogger, ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
11
9
  import { FluidDataStoreContext, LocalFluidDataStoreContext } from "./dataStoreContext";
12
10
 
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { UsageError } from "@fluidframework/container-utils";
5
+ import { UsageError } from "@fluidframework/telemetry-utils";
6
6
  import {
7
7
  FluidDataStoreRegistryEntry,
8
8
  IFluidDataStoreRegistry,
package/src/dataStores.ts CHANGED
@@ -3,10 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import {
7
- DataCorruptionError,
8
- extractSafePropertiesFromMessage,
9
- } from "@fluidframework/container-utils";
10
6
  import {
11
7
  ITelemetryBaseLogger,
12
8
  IDisposable,
@@ -42,15 +38,16 @@ import {
42
38
  unpackChildNodesUsedRoutes,
43
39
  } from "@fluidframework/runtime-utils";
44
40
  import {
41
+ createChildMonitoringContext,
42
+ DataCorruptionError,
43
+ extractSafePropertiesFromMessage,
45
44
  LoggingError,
46
45
  MonitoringContext,
47
- createChildMonitoringContext,
48
46
  tagCodeArtifacts,
49
47
  } from "@fluidframework/telemetry-utils";
50
48
  import { AttachState } from "@fluidframework/container-definitions";
51
49
  import { buildSnapshotTree } from "@fluidframework/driver-utils";
52
- import { assert } from "@fluidframework/common-utils";
53
- import { Lazy } from "@fluidframework/core-utils";
50
+ import { assert, Lazy } from "@fluidframework/core-utils";
54
51
  import { v4 as uuid } from "uuid";
55
52
  import { DataStoreContexts } from "./dataStoreContexts";
56
53
  import {
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { EventForwarder } from "@fluidframework/common-utils";
6
+ import { EventForwarder } from "@fluid-internal/client-utils";
7
7
  import {
8
8
  IDeltaManager,
9
9
  IDeltaManagerEvents,
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { ITelemetryLoggerExt, formatTick } from "@fluidframework/telemetry-utils";
7
- import { performance } from "@fluidframework/common-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
 
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
+ }
@@ -3,10 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { Timer } from "@fluidframework/common-utils";
7
- import { LazyPromise } from "@fluidframework/core-utils";
8
- import { ClientSessionExpiredError, DataProcessingError } from "@fluidframework/container-utils";
9
- import { IRequestHeader } from "@fluidframework/core-interfaces";
6
+ import { LazyPromise, Timer } from "@fluidframework/core-utils";
7
+ import { IRequest, IRequestHeader } from "@fluidframework/core-interfaces";
10
8
  import {
11
9
  gcTreeKey,
12
10
  IGarbageCollectionData,
@@ -14,17 +12,23 @@ import {
14
12
  ISummarizeResult,
15
13
  ITelemetryContext,
16
14
  } from "@fluidframework/runtime-definitions";
17
- import { ReadAndParseBlob } from "@fluidframework/runtime-utils";
15
+ import { createResponseError, responseToException } from "@fluidframework/runtime-utils";
18
16
  import {
19
17
  createChildLogger,
20
18
  createChildMonitoringContext,
19
+ DataProcessingError,
21
20
  ITelemetryLoggerExt,
22
21
  MonitoringContext,
23
22
  PerformanceEvent,
24
23
  } from "@fluidframework/telemetry-utils";
25
24
 
26
- import { RuntimeHeaders } from "../containerRuntime";
27
- 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";
28
32
  import { generateGCConfigs } from "./gcConfigs";
29
33
  import {
30
34
  GCNodeType,
@@ -838,45 +842,15 @@ export class GarbageCollector implements IGarbageCollector {
838
842
  }
839
843
 
840
844
  /**
841
- * Called to refresh the latest summary state. This happens when either a pending summary is acked or a snapshot
842
- * is downloaded and should be used to update the state.
845
+ * Called to refresh the latest summary state. This happens when either a pending summary is acked.
843
846
  */
844
- public async refreshLatestSummary(
845
- proposalHandle: string | undefined,
846
- result: RefreshSummaryResult,
847
- readAndParseBlob: ReadAndParseBlob,
848
- ): Promise<void> {
849
- const latestSnapshotData = await this.summaryStateTracker.refreshLatestSummary(
850
- proposalHandle,
851
- result,
852
- readAndParseBlob,
853
- );
854
-
855
- // If the latest summary was updated but it was not tracked by this client, our state needs to be updated from
856
- // this snapshot data.
857
- if (this.shouldRunGC && result.latestSummaryUpdated && !result.wasSummaryTracked) {
858
- // The current reference timestamp should be available if we are refreshing state from a snapshot. There has
859
- // to be at least one op (summary op / ack, if nothing else) if a snapshot was taken.
860
- const currentReferenceTimestampMs = this.runtime.getCurrentReferenceTimestampMs();
861
- if (currentReferenceTimestampMs === undefined) {
862
- throw DataProcessingError.create(
863
- "No reference timestamp when updating GC state from snapshot",
864
- "refreshLatestSummary",
865
- undefined,
866
- {
867
- proposalHandle,
868
- summaryRefSeq: result.summaryRefSeq,
869
- gcConfigs: JSON.stringify(this.configs),
870
- },
871
- );
872
- }
873
- this.updateStateFromSnapshotData(latestSnapshotData, currentReferenceTimestampMs);
874
- }
847
+ public async refreshLatestSummary(result: IRefreshSummaryResult): Promise<void> {
848
+ return this.summaryStateTracker.refreshLatestSummary(result);
875
849
  }
876
850
 
877
851
  /**
878
852
  * Called when a node with the given id is updated. If the node is inactive, log an error.
879
- * @param nodePath - The id of the node that changed.
853
+ * @param nodePath - The path of the node that changed.
880
854
  * @param reason - Whether the node was loaded or changed.
881
855
  * @param timestampMs - The timestamp when the node changed.
882
856
  * @param packagePath - The package path of the node. This may not be available if the node hasn't been loaded yet.
@@ -893,6 +867,7 @@ export class GarbageCollector implements IGarbageCollector {
893
867
  return;
894
868
  }
895
869
 
870
+ // This will log if appropriate
896
871
  this.telemetryTracker.nodeUsed({
897
872
  id: nodePath,
898
873
  usageType: reason,
@@ -904,6 +879,29 @@ export class GarbageCollector implements IGarbageCollector {
904
879
  lastSummaryTime: this.getLastSummaryTimestampMs(),
905
880
  viaHandle: requestHeaders?.[RuntimeHeaders.viaHandle],
906
881
  });
882
+
883
+ // Unless this is a Loaded event, we're done after telemetry tracking
884
+ if (reason !== "Loaded") {
885
+ return;
886
+ }
887
+
888
+ // We may throw when loading an Inactive object, depending on these preconditions
889
+ const shouldThrowOnInactiveLoad =
890
+ !this.isSummarizerClient &&
891
+ this.configs.throwOnInactiveLoad === true &&
892
+ requestHeaders?.[AllowInactiveRequestHeaderKey] !== true;
893
+ const state = this.unreferencedNodesState.get(nodePath)?.state;
894
+
895
+ if (shouldThrowOnInactiveLoad && state === "Inactive") {
896
+ const request: IRequest = { url: nodePath };
897
+ const error = responseToException(
898
+ createResponseError(404, "Object is inactive", request, {
899
+ [InactiveResponseHeaderKey]: true,
900
+ }),
901
+ request,
902
+ );
903
+ throw error;
904
+ }
907
905
  }
908
906
 
909
907
  /**
@@ -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;
@@ -228,11 +228,7 @@ export interface IGarbageCollector {
228
228
  /** Returns the GC details generated from the base snapshot. */
229
229
  getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
230
230
  /** 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>;
231
+ refreshLatestSummary(result: IRefreshSummaryResult): Promise<void>;
236
232
  /** Called when a node is updated. Used to detect and log when an inactive node is changed or loaded. */
237
233
  nodeUpdated(
238
234
  nodePath: string,
@@ -349,6 +345,8 @@ export interface IGarbageCollectorConfigs {
349
345
  readonly sweepTimeoutMs: number | undefined;
350
346
  /** The time after which an unreferenced node is inactive. */
351
347
  readonly inactiveTimeoutMs: number;
348
+ /** It is easier for users to diagnose InactiveObject usage if we throw on load, which this option enables */
349
+ readonly throwOnInactiveLoad: boolean | undefined;
352
350
  /** Tracks whether GC should run in test mode. In this mode, unreferenced objects are deleted immediately. */
353
351
  readonly testMode: boolean;
354
352
  /**
@@ -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,12 +12,11 @@ import {
12
12
  ISummarizeResult,
13
13
  ISummaryTreeWithStats,
14
14
  } from "@fluidframework/runtime-definitions";
15
- import { mergeStats, ReadAndParseBlob, SummaryTreeBuilder } from "@fluidframework/runtime-utils";
16
- import { IContainerRuntimeMetadata, metadataBlobName, RefreshSummaryResult } from "../summary";
17
- import { GCVersion, IGCStats } from "./gcDefinitions";
18
- import { getGCDataFromSnapshot, generateSortedGCState, getGCVersion } from "./gcHelpers";
15
+ import { mergeStats, SummaryTreeBuilder } from "@fluidframework/runtime-utils";
16
+ import { IRefreshSummaryResult } from "../summary";
17
+ import { GCVersion, IGarbageCollectorConfigs, IGCStats } from "./gcDefinitions";
18
+ import { generateSortedGCState } from "./gcHelpers";
19
19
  import { IGarbageCollectionSnapshotData, IGarbageCollectionState } from "./gcSummaryDefinitions";
20
- import { IGarbageCollectorConfigs } from ".";
21
20
 
22
21
  export const gcStateBlobKey = `${gcBlobPrefix}_root`;
23
22
 
@@ -264,72 +263,27 @@ export class GCSummaryStateTracker {
264
263
  }
265
264
 
266
265
  /**
267
- * Called to refresh the latest summary state. This happens when either a pending summary is acked or a snapshot
268
- * is downloaded and should be used to update the state.
266
+ * Called to refresh the latest summary state. This happens when either a pending summary is acked.
269
267
  */
270
- public async refreshLatestSummary(
271
- proposalHandle: string | undefined,
272
- result: RefreshSummaryResult,
273
- readAndParseBlob: ReadAndParseBlob,
274
- ): Promise<IGarbageCollectionSnapshotData | undefined> {
275
- // If the latest summary was updated and the summary was tracked, this client is the one that generated this
276
- // summary. So, update wasGCRunInLatestSummary.
277
- // Note that this has to be updated if GC did not run too. Otherwise, `gcStateNeedsReset` will always return
278
- // true in scenarios where GC is disabled but enabled in the snapshot we loaded from.
279
- if (result.latestSummaryUpdated && result.wasSummaryTracked) {
280
- this.wasGCRunInLatestSummary = this.configs.shouldRunGC;
281
- }
282
-
283
- if (!result.latestSummaryUpdated || !this.configs.shouldRunGC) {
284
- return undefined;
285
- }
286
-
287
- // If the summary was tracked by this client, it was the one that generated the summary in the first place.
288
- // Update latest state from pending.
289
- if (result.wasSummaryTracked) {
290
- this.latestSummaryGCVersion = this.configs.gcVersionInEffect;
291
- this.latestSummaryData = this.pendingSummaryData;
292
- this.pendingSummaryData = undefined;
293
- this.updatedDSCountSinceLastSummary = 0;
294
- return undefined;
295
- }
296
-
297
- // If the summary was not tracked by this client, the state should be updated from the downloaded snapshot.
298
- const snapshotTree = result.snapshotTree;
299
- const metadataBlobId = snapshotTree.blobs[metadataBlobName];
300
- const metadata = metadataBlobId
301
- ? await readAndParseBlob<IContainerRuntimeMetadata>(metadataBlobId)
302
- : undefined;
303
- this.latestSummaryGCVersion = getGCVersion(metadata);
304
-
305
- const gcSnapshotTree = snapshotTree.trees[gcTreeKey];
306
- // If GC ran in the container that generated this snapshot, it will have a GC tree.
307
- this.wasGCRunInLatestSummary = gcSnapshotTree !== undefined;
308
-
309
- if (gcSnapshotTree === undefined) {
310
- return undefined;
268
+ public async refreshLatestSummary(result: IRefreshSummaryResult): Promise<void> {
269
+ if (!result.isSummaryTracked) {
270
+ return;
311
271
  }
312
272
 
313
- let snapshotData = await getGCDataFromSnapshot(gcSnapshotTree, readAndParseBlob);
273
+ // If the summary is tracked, this client is the one that generated it. So, update wasGCRunInLatestSummary.
274
+ // Note that this has to be updated if GC did not run too. Otherwise, `gcStateNeedsReset` will always return
275
+ // true in scenarios where GC is currently disabled but enabled in the snapshot we loaded from.
276
+ this.wasGCRunInLatestSummary = this.configs.shouldRunGC;
314
277
 
315
- // If the GC version in the snapshot does not match the GC version currently in effect, the GC data
316
- // in the snapshot cannot be interpreted correctly. Set everything to undefined except for deletedNodes
317
- // because irrespective of GC versions, these nodes have been deleted and cannot be brought back. The
318
- // deletedNodes info is needed to identify when these nodes are used.
319
- if (getGCVersion(metadata) !== this.configs.gcVersionInEffect) {
320
- snapshotData = {
321
- gcState: undefined,
322
- tombstones: undefined,
323
- deletedNodes: snapshotData.deletedNodes,
324
- };
278
+ if (!this.configs.shouldRunGC) {
279
+ return;
325
280
  }
326
281
 
327
- this.latestSummaryData = {
328
- serializedGCState: JSON.stringify(snapshotData.gcState),
329
- serializedTombstones: JSON.stringify(snapshotData.tombstones),
330
- serializedDeletedNodes: JSON.stringify(snapshotData.deletedNodes),
331
- };
332
- return snapshotData;
282
+ this.latestSummaryGCVersion = this.configs.gcVersionInEffect;
283
+ this.latestSummaryData = this.pendingSummaryData;
284
+ this.pendingSummaryData = undefined;
285
+ this.updatedDSCountSinceLastSummary = 0;
286
+ return;
333
287
  }
334
288
 
335
289
  /**
@@ -23,6 +23,7 @@ import {
23
23
  runSweepKey,
24
24
  } from "./gcDefinitions";
25
25
  import { UnreferencedStateTracker } from "./gcUnreferencedStateTracker";
26
+ // eslint-disable-next-line import/no-deprecated
26
27
  import { tagAsCodeArtifact } from "./gcHelpers";
27
28
 
28
29
  type NodeUsageType = "Changed" | "Loaded" | "Revived";
@@ -183,6 +184,7 @@ export class GCTelemetryTracker {
183
184
  {
184
185
  eventName: `GC_Tombstone_${nodeType}_Revived`,
185
186
  category: "generic",
187
+ // eslint-disable-next-line import/no-deprecated
186
188
  url: tagAsCodeArtifact(id),
187
189
  gcTombstoneEnforcementAllowed: this.gcTombstoneEnforcementAllowed,
188
190
  },
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { assert, Timer } from "@fluidframework/common-utils";
6
+ import { assert, Timer } from "@fluidframework/core-utils";
7
7
  import { UnreferencedState } from "./gcDefinitions";
8
8
 
9
9
  /** A wrapper around common-utils Timer that requires the timeout when calling start/restart */
package/src/gc/index.ts CHANGED
@@ -38,7 +38,6 @@ export {
38
38
  export {
39
39
  cloneGCData,
40
40
  concatGarbageCollectionStates,
41
- getGCDataFromSnapshot,
42
41
  shouldAllowGcTombstoneEnforcement,
43
42
  shouldAllowGcSweep,
44
43
  trimLeadingAndTrailingSlashes,
@@ -3,10 +3,9 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ /* eslint-disable tsdoc/syntax */
6
7
  /* eslint-disable no-bitwise */
7
-
8
- import { assert } from "@fluidframework/common-utils";
9
- import { fail } from "./utils";
8
+ import { assert } from "@fluidframework/core-utils";
10
9
 
11
10
  /**
12
11
  * A map in which entries are always added in key-sorted order.
@@ -133,7 +132,7 @@ export class AppendOnlySortedMap<K, V> {
133
132
  }
134
133
 
135
134
  /**
136
- * Adds a new key/value pair to the map. `key` must be \> to all keys in the map.
135
+ * Adds a new key/value pair to the map. `key` must be > to all keys in the map.
137
136
  * @param key - the key to add.
138
137
  * @param value - the value to add.
139
138
  */
@@ -141,7 +140,27 @@ export class AppendOnlySortedMap<K, V> {
141
140
  const { elements } = this;
142
141
  const { length } = elements;
143
142
  if (length !== 0 && this.comparator(key, this.maxKey() as K) <= 0) {
144
- fail("Inserted key must be > all others in the map.");
143
+ throw new Error("Inserted key must be > all others in the map.");
144
+ }
145
+ elements.push(key);
146
+ elements.push(value);
147
+ }
148
+
149
+ /**
150
+ * Replaces the last key/value pair with the given one. If the map is empty, it simply appends.
151
+ * `key` must be > to all keys in the map prior to the one replaced.
152
+ * @param key - the key to add.
153
+ * @param value - the value to add.
154
+ */
155
+ public replaceLast(key: K, value: V): void {
156
+ const { elements, comparator } = this;
157
+ const { length } = elements;
158
+ if (length !== 0) {
159
+ elements.pop();
160
+ elements.pop();
161
+ if (comparator(key, this.maxKey() as K) <= 0) {
162
+ throw new Error("Inserted key must be > all others in the map.");
163
+ }
145
164
  }
146
165
  elements.push(key);
147
166
  elements.push(value);
@@ -217,7 +236,7 @@ export class AppendOnlySortedMap<K, V> {
217
236
  if (prev !== undefined) {
218
237
  assert(
219
238
  this.comparator(kv[0], prev[0]) > 0,
220
- 0x47f /* Keys in map must be sorted. */,
239
+ 0x752 /* Keys in map must be sorted. */,
221
240
  );
222
241
  }
223
242
  prev = kv;
@@ -338,90 +357,10 @@ export class AppendOnlySortedMap<K, V> {
338
357
  } else if (c === 0) {
339
358
  return keyIndex;
340
359
  } else {
341
- fail("Invalid comparator.");
360
+ throw new Error("Invalid comparator.");
342
361
  }
343
362
  mid = (low + high) >> 1;
344
363
  }
345
364
  return (mid * 2) ^ AppendOnlySortedMap.failureXor;
346
365
  }
347
366
  }
348
-
349
- /**
350
- * A map in which entries are always added in both key-sorted and value-sorted order.
351
- * Supports appending and searching.
352
- */
353
- export class AppendOnlyDoublySortedMap<K, V, S> extends AppendOnlySortedMap<K, V> {
354
- public constructor(
355
- keyComparator: (a: K, b: K) => number,
356
- private readonly extractSearchValue: (value: V) => S,
357
- private readonly valueComparator: (search: S, value: S) => number,
358
- ) {
359
- super(keyComparator);
360
- }
361
-
362
- public override append(key: K, value: V): void {
363
- if (
364
- this.elements.length !== 0 &&
365
- this.valueComparator(
366
- this.extractSearchValue(value),
367
- this.extractSearchValue(this.maxValue() as V),
368
- ) <= 0
369
- ) {
370
- fail("Inserted value must be > all others in the map.");
371
- }
372
- super.append(key, value);
373
- }
374
-
375
- private readonly compareValues = (search: S, _: K, value: V): number => {
376
- return this.valueComparator(search, this.extractSearchValue(value));
377
- };
378
-
379
- // /**
380
- // * @param value - the value to lookup.
381
- // * @returns the key associated with `value` if such an entry exists, and undefined otherwise.
382
- // */
383
- // public getByValue(value: S): K | undefined {
384
- // const index = AppendOnlySortedMap.keyIndexOf(this.elements, value, this.compareValues);
385
- // return this.elements[index]?.[0];
386
- // }
387
-
388
- /**
389
- * @param searchValue - the search value to lookup.
390
- * @returns the entry who's value, when run through the extractor provided to the constructor, matches
391
- * `searchValue`. If no such entry exists, this method returns the next lower entry as determined by the value
392
- * comparator provided to the constructor. If no such entry exists, this method returns undefined.
393
- */
394
- public getPairOrNextLowerByValue(searchValue: S): readonly [K, V] | undefined {
395
- return this.getPairOrNextLowerBy(searchValue, this.compareValues);
396
- }
397
-
398
- /**
399
- * @param searchValue - the search value to lookup.
400
- * @returns the entry who's value, when run through the extractor provided to the constructor, matches `searchValue`. If no such entry
401
- * exists, this method returns the next higher entry as determined by the value comparator provided to the constructor. If no such entry
402
- * exists, this method returns undefined.
403
- */
404
- public getPairOrNextHigherByValue(searchValue: S): readonly [K, V] | undefined {
405
- return this.getPairOrNextHigherBy(searchValue, this.compareValues);
406
- }
407
-
408
- /**
409
- * Test-only expensive assertions to check the internal validity of the data structure.
410
- */
411
- public override assertValid(): void {
412
- super.assertValid();
413
- let prev: readonly [unknown, V] | undefined;
414
- for (const kv of this.entries()) {
415
- if (prev !== undefined) {
416
- assert(
417
- this.valueComparator(
418
- this.extractSearchValue(kv[1]),
419
- this.extractSearchValue(prev[1]),
420
- ) > 0,
421
- 0x480 /* Values in map must be sorted. */,
422
- );
423
- }
424
- prev = kv;
425
- }
426
- }
427
- }