@fluidframework/container-runtime 2.53.1 → 2.61.0-355054

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 (478) hide show
  1. package/.mocharc.cjs +1 -2
  2. package/CHANGELOG.md +4 -0
  3. package/api-report/{container-runtime.legacy.alpha.api.md → container-runtime.legacy.beta.api.md} +55 -55
  4. package/container-runtime.test-files.tar +0 -0
  5. package/dist/batchTracker.d.ts +1 -1
  6. package/dist/batchTracker.d.ts.map +1 -1
  7. package/dist/batchTracker.js.map +1 -1
  8. package/dist/blobManager/blobManager.d.ts +29 -17
  9. package/dist/blobManager/blobManager.d.ts.map +1 -1
  10. package/dist/blobManager/blobManager.js +150 -135
  11. package/dist/blobManager/blobManager.js.map +1 -1
  12. package/dist/blobManager/blobManagerSnapSum.d.ts +4 -4
  13. package/dist/blobManager/blobManagerSnapSum.d.ts.map +1 -1
  14. package/dist/blobManager/blobManagerSnapSum.js +30 -33
  15. package/dist/blobManager/blobManagerSnapSum.js.map +1 -1
  16. package/dist/blobManager/index.d.ts +2 -2
  17. package/dist/blobManager/index.d.ts.map +1 -1
  18. package/dist/blobManager/index.js.map +1 -1
  19. package/dist/channelCollection.d.ts +9 -11
  20. package/dist/channelCollection.d.ts.map +1 -1
  21. package/dist/channelCollection.js +2 -3
  22. package/dist/channelCollection.js.map +1 -1
  23. package/dist/compressionDefinitions.d.ts +3 -6
  24. package/dist/compressionDefinitions.d.ts.map +1 -1
  25. package/dist/compressionDefinitions.js +2 -4
  26. package/dist/compressionDefinitions.js.map +1 -1
  27. package/dist/connectionTelemetry.d.ts +3 -4
  28. package/dist/connectionTelemetry.d.ts.map +1 -1
  29. package/dist/connectionTelemetry.js.map +1 -1
  30. package/dist/containerHandleContext.d.ts +2 -2
  31. package/dist/containerHandleContext.d.ts.map +1 -1
  32. package/dist/containerHandleContext.js.map +1 -1
  33. package/dist/containerRuntime.d.ts +13 -20
  34. package/dist/containerRuntime.d.ts.map +1 -1
  35. package/dist/containerRuntime.js +4 -7
  36. package/dist/containerRuntime.js.map +1 -1
  37. package/dist/dataStore.d.ts +3 -3
  38. package/dist/dataStore.d.ts.map +1 -1
  39. package/dist/dataStore.js.map +1 -1
  40. package/dist/dataStoreContext.d.ts +8 -8
  41. package/dist/dataStoreContext.d.ts.map +1 -1
  42. package/dist/dataStoreContext.js.map +1 -1
  43. package/dist/dataStoreContexts.d.ts +2 -2
  44. package/dist/dataStoreContexts.d.ts.map +1 -1
  45. package/dist/dataStoreContexts.js.map +1 -1
  46. package/dist/dataStoreRegistry.d.ts +1 -1
  47. package/dist/dataStoreRegistry.d.ts.map +1 -1
  48. package/dist/dataStoreRegistry.js.map +1 -1
  49. package/dist/deltaManagerProxies.d.ts +2 -3
  50. package/dist/deltaManagerProxies.d.ts.map +1 -1
  51. package/dist/deltaManagerProxies.js.map +1 -1
  52. package/dist/deltaScheduler.d.ts +2 -2
  53. package/dist/deltaScheduler.d.ts.map +1 -1
  54. package/dist/deltaScheduler.js.map +1 -1
  55. package/dist/error.d.ts +1 -1
  56. package/dist/error.d.ts.map +1 -1
  57. package/dist/error.js.map +1 -1
  58. package/dist/gc/garbageCollection.d.ts +4 -4
  59. package/dist/gc/garbageCollection.d.ts.map +1 -1
  60. package/dist/gc/garbageCollection.js.map +1 -1
  61. package/dist/gc/gcConfigs.d.ts +3 -3
  62. package/dist/gc/gcConfigs.d.ts.map +1 -1
  63. package/dist/gc/gcConfigs.js.map +1 -1
  64. package/dist/gc/gcDefinitions.d.ts +10 -11
  65. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  66. package/dist/gc/gcDefinitions.js.map +1 -1
  67. package/dist/gc/gcHelpers.d.ts +4 -4
  68. package/dist/gc/gcHelpers.d.ts.map +1 -1
  69. package/dist/gc/gcHelpers.js.map +1 -1
  70. package/dist/gc/gcReferenceGraphAlgorithm.d.ts +1 -1
  71. package/dist/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -1
  72. package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -1
  73. package/dist/gc/gcSummaryDefinitions.d.ts +1 -1
  74. package/dist/gc/gcSummaryDefinitions.d.ts.map +1 -1
  75. package/dist/gc/gcSummaryDefinitions.js.map +1 -1
  76. package/dist/gc/gcSummaryStateTracker.d.ts +4 -4
  77. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  78. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  79. package/dist/gc/gcTelemetry.d.ts +6 -6
  80. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  81. package/dist/gc/gcTelemetry.js.map +1 -1
  82. package/dist/gc/index.d.ts +3 -3
  83. package/dist/gc/index.d.ts.map +1 -1
  84. package/dist/gc/index.js.map +1 -1
  85. package/dist/inboundBatchAggregator.d.ts +2 -2
  86. package/dist/inboundBatchAggregator.d.ts.map +1 -1
  87. package/dist/inboundBatchAggregator.js.map +1 -1
  88. package/dist/index.d.ts +7 -7
  89. package/dist/index.d.ts.map +1 -1
  90. package/dist/index.js.map +1 -1
  91. package/dist/legacy.d.ts +2 -1
  92. package/dist/messageTypes.d.ts +7 -8
  93. package/dist/messageTypes.d.ts.map +1 -1
  94. package/dist/messageTypes.js +1 -2
  95. package/dist/messageTypes.js.map +1 -1
  96. package/dist/opLifecycle/batchManager.d.ts +2 -2
  97. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  98. package/dist/opLifecycle/batchManager.js.map +1 -1
  99. package/dist/opLifecycle/definitions.d.ts +1 -1
  100. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  101. package/dist/opLifecycle/definitions.js.map +1 -1
  102. package/dist/opLifecycle/duplicateBatchDetector.d.ts +1 -1
  103. package/dist/opLifecycle/duplicateBatchDetector.d.ts.map +1 -1
  104. package/dist/opLifecycle/duplicateBatchDetector.js.map +1 -1
  105. package/dist/opLifecycle/index.d.ts +5 -5
  106. package/dist/opLifecycle/index.d.ts.map +1 -1
  107. package/dist/opLifecycle/index.js.map +1 -1
  108. package/dist/opLifecycle/opCompressor.d.ts +2 -2
  109. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  110. package/dist/opLifecycle/opCompressor.js.map +1 -1
  111. package/dist/opLifecycle/opDecompressor.d.ts +2 -2
  112. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  113. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  114. package/dist/opLifecycle/opGroupingManager.d.ts +3 -3
  115. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  116. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  117. package/dist/opLifecycle/opSplitter.d.ts +4 -4
  118. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  119. package/dist/opLifecycle/opSplitter.js.map +1 -1
  120. package/dist/opLifecycle/outbox.d.ts +9 -9
  121. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  122. package/dist/opLifecycle/outbox.js.map +1 -1
  123. package/dist/opLifecycle/remoteMessageProcessor.d.ts +4 -4
  124. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  125. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  126. package/dist/opProperties.d.ts +1 -1
  127. package/dist/opProperties.d.ts.map +1 -1
  128. package/dist/opProperties.js.map +1 -1
  129. package/dist/packageVersion.d.ts +1 -1
  130. package/dist/packageVersion.d.ts.map +1 -1
  131. package/dist/packageVersion.js +1 -1
  132. package/dist/packageVersion.js.map +1 -1
  133. package/dist/pendingStateManager.d.ts +3 -3
  134. package/dist/pendingStateManager.d.ts.map +1 -1
  135. package/dist/pendingStateManager.js.map +1 -1
  136. package/dist/storageServiceWithAttachBlobs.d.ts +1 -1
  137. package/dist/storageServiceWithAttachBlobs.d.ts.map +1 -1
  138. package/dist/storageServiceWithAttachBlobs.js.map +1 -1
  139. package/dist/summary/documentSchema.d.ts +1 -2
  140. package/dist/summary/documentSchema.d.ts.map +1 -1
  141. package/dist/summary/documentSchema.js.map +1 -1
  142. package/dist/summary/index.d.ts +10 -10
  143. package/dist/summary/index.d.ts.map +1 -1
  144. package/dist/summary/index.js.map +1 -1
  145. package/dist/summary/orderedClientElection.d.ts +4 -4
  146. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  147. package/dist/summary/orderedClientElection.js.map +1 -1
  148. package/dist/summary/summarizerClientElection.d.ts +5 -5
  149. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  150. package/dist/summary/summarizerClientElection.js.map +1 -1
  151. package/dist/summary/summarizerNode/index.d.ts +3 -3
  152. package/dist/summary/summarizerNode/index.d.ts.map +1 -1
  153. package/dist/summary/summarizerNode/index.js.map +1 -1
  154. package/dist/summary/summarizerNode/summarizerNode.d.ts +5 -6
  155. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  156. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  157. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +3 -3
  158. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  159. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  160. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +3 -3
  161. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  162. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  163. package/dist/summary/summarizerTypes.d.ts +25 -44
  164. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  165. package/dist/summary/summarizerTypes.js.map +1 -1
  166. package/dist/summary/summarizerUtils.d.ts +3 -3
  167. package/dist/summary/summarizerUtils.d.ts.map +1 -1
  168. package/dist/summary/summarizerUtils.js.map +1 -1
  169. package/dist/summary/summaryCollection.d.ts +13 -23
  170. package/dist/summary/summaryCollection.d.ts.map +1 -1
  171. package/dist/summary/summaryCollection.js +1 -2
  172. package/dist/summary/summaryCollection.js.map +1 -1
  173. package/dist/summary/summaryDelayLoadedModule/index.d.ts +2 -2
  174. package/dist/summary/summaryDelayLoadedModule/index.d.ts.map +1 -1
  175. package/dist/summary/summaryDelayLoadedModule/index.js.map +1 -1
  176. package/dist/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.d.ts +1 -1
  177. package/dist/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.d.ts.map +1 -1
  178. package/dist/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.js.map +1 -1
  179. package/dist/summary/summaryDelayLoadedModule/runningSummarizer.d.ts +3 -3
  180. package/dist/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
  181. package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
  182. package/dist/summary/summaryDelayLoadedModule/summarizer.d.ts +5 -5
  183. package/dist/summary/summaryDelayLoadedModule/summarizer.d.ts.map +1 -1
  184. package/dist/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
  185. package/dist/summary/summaryDelayLoadedModule/summarizerHeuristics.d.ts +3 -4
  186. package/dist/summary/summaryDelayLoadedModule/summarizerHeuristics.d.ts.map +1 -1
  187. package/dist/summary/summaryDelayLoadedModule/summarizerHeuristics.js.map +1 -1
  188. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.d.ts +3 -3
  189. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.d.ts.map +1 -1
  190. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
  191. package/dist/summary/summaryDelayLoadedModule/summaryResultBuilder.d.ts +1 -1
  192. package/dist/summary/summaryDelayLoadedModule/summaryResultBuilder.d.ts.map +1 -1
  193. package/dist/summary/summaryDelayLoadedModule/summaryResultBuilder.js.map +1 -1
  194. package/dist/summary/summaryDelayLoadedModule/summaryResultTypes.d.ts +5 -10
  195. package/dist/summary/summaryDelayLoadedModule/summaryResultTypes.d.ts.map +1 -1
  196. package/dist/summary/summaryDelayLoadedModule/summaryResultTypes.js.map +1 -1
  197. package/dist/summary/summaryFormat.d.ts +9 -14
  198. package/dist/summary/summaryFormat.d.ts.map +1 -1
  199. package/dist/summary/summaryFormat.js.map +1 -1
  200. package/dist/summary/summaryHelpers.d.ts +1 -2
  201. package/dist/summary/summaryHelpers.d.ts.map +1 -1
  202. package/dist/summary/summaryHelpers.js +1 -2
  203. package/dist/summary/summaryHelpers.js.map +1 -1
  204. package/dist/summary/summaryManager.d.ts +3 -3
  205. package/dist/summary/summaryManager.d.ts.map +1 -1
  206. package/dist/summary/summaryManager.js.map +1 -1
  207. package/internal.d.ts +1 -1
  208. package/legacy.d.ts +1 -1
  209. package/lib/batchTracker.d.ts +1 -1
  210. package/lib/batchTracker.d.ts.map +1 -1
  211. package/lib/batchTracker.js.map +1 -1
  212. package/lib/blobManager/blobManager.d.ts +29 -17
  213. package/lib/blobManager/blobManager.d.ts.map +1 -1
  214. package/lib/blobManager/blobManager.js +142 -127
  215. package/lib/blobManager/blobManager.js.map +1 -1
  216. package/lib/blobManager/blobManagerSnapSum.d.ts +4 -4
  217. package/lib/blobManager/blobManagerSnapSum.d.ts.map +1 -1
  218. package/lib/blobManager/blobManagerSnapSum.js +26 -29
  219. package/lib/blobManager/blobManagerSnapSum.js.map +1 -1
  220. package/lib/blobManager/index.d.ts +2 -2
  221. package/lib/blobManager/index.d.ts.map +1 -1
  222. package/lib/blobManager/index.js.map +1 -1
  223. package/lib/channelCollection.d.ts +9 -11
  224. package/lib/channelCollection.d.ts.map +1 -1
  225. package/lib/channelCollection.js +2 -3
  226. package/lib/channelCollection.js.map +1 -1
  227. package/lib/compressionDefinitions.d.ts +3 -6
  228. package/lib/compressionDefinitions.d.ts.map +1 -1
  229. package/lib/compressionDefinitions.js +2 -4
  230. package/lib/compressionDefinitions.js.map +1 -1
  231. package/lib/connectionTelemetry.d.ts +3 -4
  232. package/lib/connectionTelemetry.d.ts.map +1 -1
  233. package/lib/connectionTelemetry.js.map +1 -1
  234. package/lib/containerHandleContext.d.ts +2 -2
  235. package/lib/containerHandleContext.d.ts.map +1 -1
  236. package/lib/containerHandleContext.js.map +1 -1
  237. package/lib/containerRuntime.d.ts +13 -20
  238. package/lib/containerRuntime.d.ts.map +1 -1
  239. package/lib/containerRuntime.js +4 -7
  240. package/lib/containerRuntime.js.map +1 -1
  241. package/lib/dataStore.d.ts +3 -3
  242. package/lib/dataStore.d.ts.map +1 -1
  243. package/lib/dataStore.js.map +1 -1
  244. package/lib/dataStoreContext.d.ts +8 -8
  245. package/lib/dataStoreContext.d.ts.map +1 -1
  246. package/lib/dataStoreContext.js.map +1 -1
  247. package/lib/dataStoreContexts.d.ts +2 -2
  248. package/lib/dataStoreContexts.d.ts.map +1 -1
  249. package/lib/dataStoreContexts.js.map +1 -1
  250. package/lib/dataStoreRegistry.d.ts +1 -1
  251. package/lib/dataStoreRegistry.d.ts.map +1 -1
  252. package/lib/dataStoreRegistry.js.map +1 -1
  253. package/lib/deltaManagerProxies.d.ts +2 -3
  254. package/lib/deltaManagerProxies.d.ts.map +1 -1
  255. package/lib/deltaManagerProxies.js.map +1 -1
  256. package/lib/deltaScheduler.d.ts +2 -2
  257. package/lib/deltaScheduler.d.ts.map +1 -1
  258. package/lib/deltaScheduler.js +1 -1
  259. package/lib/deltaScheduler.js.map +1 -1
  260. package/lib/error.d.ts +1 -1
  261. package/lib/error.d.ts.map +1 -1
  262. package/lib/error.js.map +1 -1
  263. package/lib/gc/garbageCollection.d.ts +4 -4
  264. package/lib/gc/garbageCollection.d.ts.map +1 -1
  265. package/lib/gc/garbageCollection.js.map +1 -1
  266. package/lib/gc/gcConfigs.d.ts +3 -3
  267. package/lib/gc/gcConfigs.d.ts.map +1 -1
  268. package/lib/gc/gcConfigs.js.map +1 -1
  269. package/lib/gc/gcDefinitions.d.ts +10 -11
  270. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  271. package/lib/gc/gcDefinitions.js.map +1 -1
  272. package/lib/gc/gcHelpers.d.ts +4 -4
  273. package/lib/gc/gcHelpers.d.ts.map +1 -1
  274. package/lib/gc/gcHelpers.js.map +1 -1
  275. package/lib/gc/gcReferenceGraphAlgorithm.d.ts +1 -1
  276. package/lib/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -1
  277. package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -1
  278. package/lib/gc/gcSummaryDefinitions.d.ts +1 -1
  279. package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -1
  280. package/lib/gc/gcSummaryDefinitions.js.map +1 -1
  281. package/lib/gc/gcSummaryStateTracker.d.ts +4 -4
  282. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  283. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  284. package/lib/gc/gcTelemetry.d.ts +6 -6
  285. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  286. package/lib/gc/gcTelemetry.js.map +1 -1
  287. package/lib/gc/index.d.ts +3 -3
  288. package/lib/gc/index.d.ts.map +1 -1
  289. package/lib/gc/index.js.map +1 -1
  290. package/lib/inboundBatchAggregator.d.ts +2 -2
  291. package/lib/inboundBatchAggregator.d.ts.map +1 -1
  292. package/lib/inboundBatchAggregator.js.map +1 -1
  293. package/lib/index.d.ts +7 -7
  294. package/lib/index.d.ts.map +1 -1
  295. package/lib/index.js.map +1 -1
  296. package/lib/legacy.d.ts +2 -1
  297. package/lib/messageTypes.d.ts +7 -8
  298. package/lib/messageTypes.d.ts.map +1 -1
  299. package/lib/messageTypes.js +1 -2
  300. package/lib/messageTypes.js.map +1 -1
  301. package/lib/opLifecycle/batchManager.d.ts +2 -2
  302. package/lib/opLifecycle/batchManager.d.ts.map +1 -1
  303. package/lib/opLifecycle/batchManager.js.map +1 -1
  304. package/lib/opLifecycle/definitions.d.ts +1 -1
  305. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  306. package/lib/opLifecycle/definitions.js.map +1 -1
  307. package/lib/opLifecycle/duplicateBatchDetector.d.ts +1 -1
  308. package/lib/opLifecycle/duplicateBatchDetector.d.ts.map +1 -1
  309. package/lib/opLifecycle/duplicateBatchDetector.js.map +1 -1
  310. package/lib/opLifecycle/index.d.ts +5 -5
  311. package/lib/opLifecycle/index.d.ts.map +1 -1
  312. package/lib/opLifecycle/index.js.map +1 -1
  313. package/lib/opLifecycle/opCompressor.d.ts +2 -2
  314. package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
  315. package/lib/opLifecycle/opCompressor.js.map +1 -1
  316. package/lib/opLifecycle/opDecompressor.d.ts +2 -2
  317. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  318. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  319. package/lib/opLifecycle/opGroupingManager.d.ts +3 -3
  320. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  321. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  322. package/lib/opLifecycle/opSplitter.d.ts +4 -4
  323. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  324. package/lib/opLifecycle/opSplitter.js +1 -1
  325. package/lib/opLifecycle/opSplitter.js.map +1 -1
  326. package/lib/opLifecycle/outbox.d.ts +9 -9
  327. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  328. package/lib/opLifecycle/outbox.js.map +1 -1
  329. package/lib/opLifecycle/remoteMessageProcessor.d.ts +4 -4
  330. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  331. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  332. package/lib/opProperties.d.ts +1 -1
  333. package/lib/opProperties.d.ts.map +1 -1
  334. package/lib/opProperties.js.map +1 -1
  335. package/lib/packageVersion.d.ts +1 -1
  336. package/lib/packageVersion.d.ts.map +1 -1
  337. package/lib/packageVersion.js +1 -1
  338. package/lib/packageVersion.js.map +1 -1
  339. package/lib/pendingStateManager.d.ts +3 -3
  340. package/lib/pendingStateManager.d.ts.map +1 -1
  341. package/lib/pendingStateManager.js.map +1 -1
  342. package/lib/storageServiceWithAttachBlobs.d.ts +1 -1
  343. package/lib/storageServiceWithAttachBlobs.d.ts.map +1 -1
  344. package/lib/storageServiceWithAttachBlobs.js.map +1 -1
  345. package/lib/summary/documentSchema.d.ts +1 -2
  346. package/lib/summary/documentSchema.d.ts.map +1 -1
  347. package/lib/summary/documentSchema.js.map +1 -1
  348. package/lib/summary/index.d.ts +10 -10
  349. package/lib/summary/index.d.ts.map +1 -1
  350. package/lib/summary/index.js.map +1 -1
  351. package/lib/summary/orderedClientElection.d.ts +4 -4
  352. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  353. package/lib/summary/orderedClientElection.js.map +1 -1
  354. package/lib/summary/summarizerClientElection.d.ts +5 -5
  355. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  356. package/lib/summary/summarizerClientElection.js.map +1 -1
  357. package/lib/summary/summarizerNode/index.d.ts +3 -3
  358. package/lib/summary/summarizerNode/index.d.ts.map +1 -1
  359. package/lib/summary/summarizerNode/index.js.map +1 -1
  360. package/lib/summary/summarizerNode/summarizerNode.d.ts +5 -6
  361. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  362. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  363. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +3 -3
  364. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  365. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  366. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +3 -3
  367. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  368. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  369. package/lib/summary/summarizerTypes.d.ts +25 -44
  370. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  371. package/lib/summary/summarizerTypes.js.map +1 -1
  372. package/lib/summary/summarizerUtils.d.ts +3 -3
  373. package/lib/summary/summarizerUtils.d.ts.map +1 -1
  374. package/lib/summary/summarizerUtils.js.map +1 -1
  375. package/lib/summary/summaryCollection.d.ts +13 -23
  376. package/lib/summary/summaryCollection.d.ts.map +1 -1
  377. package/lib/summary/summaryCollection.js +1 -2
  378. package/lib/summary/summaryCollection.js.map +1 -1
  379. package/lib/summary/summaryDelayLoadedModule/index.d.ts +2 -2
  380. package/lib/summary/summaryDelayLoadedModule/index.d.ts.map +1 -1
  381. package/lib/summary/summaryDelayLoadedModule/index.js.map +1 -1
  382. package/lib/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.d.ts +1 -1
  383. package/lib/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.d.ts.map +1 -1
  384. package/lib/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.js.map +1 -1
  385. package/lib/summary/summaryDelayLoadedModule/runningSummarizer.d.ts +3 -3
  386. package/lib/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
  387. package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
  388. package/lib/summary/summaryDelayLoadedModule/summarizer.d.ts +5 -5
  389. package/lib/summary/summaryDelayLoadedModule/summarizer.d.ts.map +1 -1
  390. package/lib/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
  391. package/lib/summary/summaryDelayLoadedModule/summarizerHeuristics.d.ts +3 -4
  392. package/lib/summary/summaryDelayLoadedModule/summarizerHeuristics.d.ts.map +1 -1
  393. package/lib/summary/summaryDelayLoadedModule/summarizerHeuristics.js.map +1 -1
  394. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.d.ts +3 -3
  395. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.d.ts.map +1 -1
  396. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
  397. package/lib/summary/summaryDelayLoadedModule/summaryResultBuilder.d.ts +1 -1
  398. package/lib/summary/summaryDelayLoadedModule/summaryResultBuilder.d.ts.map +1 -1
  399. package/lib/summary/summaryDelayLoadedModule/summaryResultBuilder.js.map +1 -1
  400. package/lib/summary/summaryDelayLoadedModule/summaryResultTypes.d.ts +5 -10
  401. package/lib/summary/summaryDelayLoadedModule/summaryResultTypes.d.ts.map +1 -1
  402. package/lib/summary/summaryDelayLoadedModule/summaryResultTypes.js.map +1 -1
  403. package/lib/summary/summaryFormat.d.ts +9 -14
  404. package/lib/summary/summaryFormat.d.ts.map +1 -1
  405. package/lib/summary/summaryFormat.js.map +1 -1
  406. package/lib/summary/summaryHelpers.d.ts +1 -2
  407. package/lib/summary/summaryHelpers.d.ts.map +1 -1
  408. package/lib/summary/summaryHelpers.js +1 -2
  409. package/lib/summary/summaryHelpers.js.map +1 -1
  410. package/lib/summary/summaryManager.d.ts +3 -3
  411. package/lib/summary/summaryManager.d.ts.map +1 -1
  412. package/lib/summary/summaryManager.js.map +1 -1
  413. package/lib/tsdoc-metadata.json +1 -1
  414. package/package.json +27 -27
  415. package/src/batchTracker.ts +3 -3
  416. package/src/blobManager/blobManager.ts +165 -174
  417. package/src/blobManager/blobManagerSnapSum.ts +31 -53
  418. package/src/blobManager/index.ts +4 -4
  419. package/src/channelCollection.ts +28 -29
  420. package/src/compressionDefinitions.ts +3 -6
  421. package/src/connectionTelemetry.ts +8 -9
  422. package/src/containerHandleContext.ts +2 -2
  423. package/src/containerRuntime.ts +43 -50
  424. package/src/dataStore.ts +6 -6
  425. package/src/dataStoreContext.ts +33 -33
  426. package/src/dataStoreContexts.ts +3 -3
  427. package/src/dataStoreRegistry.ts +1 -1
  428. package/src/deltaManagerProxies.ts +3 -3
  429. package/src/deltaScheduler.ts +6 -3
  430. package/src/error.ts +1 -1
  431. package/src/gc/garbageCollection.ts +18 -18
  432. package/src/gc/gcConfigs.ts +7 -7
  433. package/src/gc/gcDefinitions.ts +11 -12
  434. package/src/gc/gcHelpers.ts +7 -7
  435. package/src/gc/gcReferenceGraphAlgorithm.ts +1 -1
  436. package/src/gc/gcSummaryDefinitions.ts +1 -1
  437. package/src/gc/gcSummaryStateTracker.ts +5 -5
  438. package/src/gc/gcTelemetry.ts +8 -8
  439. package/src/gc/index.ts +18 -18
  440. package/src/inboundBatchAggregator.ts +4 -4
  441. package/src/index.ts +79 -79
  442. package/src/messageTypes.ts +9 -10
  443. package/src/opLifecycle/batchManager.ts +2 -2
  444. package/src/opLifecycle/definitions.ts +1 -1
  445. package/src/opLifecycle/duplicateBatchDetector.ts +1 -1
  446. package/src/opLifecycle/index.ts +9 -9
  447. package/src/opLifecycle/opCompressor.ts +2 -2
  448. package/src/opLifecycle/opDecompressor.ts +3 -3
  449. package/src/opLifecycle/opGroupingManager.ts +6 -6
  450. package/src/opLifecycle/opSplitter.ts +10 -7
  451. package/src/opLifecycle/outbox.ts +17 -14
  452. package/src/opLifecycle/remoteMessageProcessor.ts +4 -4
  453. package/src/opProperties.ts +1 -1
  454. package/src/packageVersion.ts +1 -1
  455. package/src/pendingStateManager.ts +10 -10
  456. package/src/storageServiceWithAttachBlobs.ts +11 -11
  457. package/src/summary/documentSchema.ts +1 -2
  458. package/src/summary/index.ts +69 -69
  459. package/src/summary/orderedClientElection.ts +12 -4
  460. package/src/summary/summarizerClientElection.ts +5 -5
  461. package/src/summary/summarizerNode/index.ts +3 -3
  462. package/src/summary/summarizerNode/summarizerNode.ts +14 -12
  463. package/src/summary/summarizerNode/summarizerNodeUtils.ts +3 -3
  464. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +3 -3
  465. package/src/summary/summarizerTypes.ts +25 -44
  466. package/src/summary/summarizerUtils.ts +3 -3
  467. package/src/summary/summaryCollection.ts +19 -29
  468. package/src/summary/summaryDelayLoadedModule/index.ts +2 -2
  469. package/src/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.ts +1 -1
  470. package/src/summary/summaryDelayLoadedModule/runningSummarizer.ts +4 -4
  471. package/src/summary/summaryDelayLoadedModule/summarizer.ts +8 -8
  472. package/src/summary/summaryDelayLoadedModule/summarizerHeuristics.ts +4 -4
  473. package/src/summary/summaryDelayLoadedModule/summaryGenerator.ts +3 -3
  474. package/src/summary/summaryDelayLoadedModule/summaryResultBuilder.ts +3 -3
  475. package/src/summary/summaryDelayLoadedModule/summaryResultTypes.ts +5 -10
  476. package/src/summary/summaryFormat.ts +9 -14
  477. package/src/summary/summaryHelpers.ts +1 -2
  478. package/src/summary/summaryManager.ts +4 -4
@@ -8,9 +8,8 @@ exports.isBlobPath = exports.BlobManager = exports.blobManagerBasePath = exports
8
8
  const client_utils_1 = require("@fluid-internal/client-utils");
9
9
  const internal_1 = require("@fluidframework/container-definitions/internal");
10
10
  const internal_2 = require("@fluidframework/core-utils/internal");
11
- const internal_3 = require("@fluidframework/driver-utils/internal");
12
- const internal_4 = require("@fluidframework/runtime-utils/internal");
13
- const internal_5 = require("@fluidframework/telemetry-utils/internal");
11
+ const internal_3 = require("@fluidframework/runtime-utils/internal");
12
+ const internal_4 = require("@fluidframework/telemetry-utils/internal");
14
13
  const uuid_1 = require("uuid");
15
14
  const metadata_js_1 = require("../metadata.js");
16
15
  const blobManagerSnapSum_js_1 = require("./blobManagerSnapSum.js");
@@ -21,7 +20,7 @@ const blobManagerSnapSum_js_1 = require("./blobManagerSnapSum.js");
21
20
  * DataObject.request() recognizes requests in the form of `/blobs/<id>`
22
21
  * and loads blob.
23
22
  */
24
- class BlobHandle extends internal_4.FluidHandleBase {
23
+ class BlobHandle extends internal_3.FluidHandleBase {
25
24
  get isAttached() {
26
25
  return this.routeContext.isAttached && this.attached;
27
26
  }
@@ -51,7 +50,7 @@ class BlobHandle extends internal_4.FluidHandleBase {
51
50
  this._payloadShareError = error;
52
51
  this._events?.emit("payloadShareFailed", error);
53
52
  };
54
- this.absolutePath = (0, internal_4.generateHandleContextPath)(path, this.routeContext);
53
+ this.absolutePath = (0, internal_3.generateHandleContextPath)(path, this.routeContext);
55
54
  }
56
55
  attachGraph() {
57
56
  if (!this.attached) {
@@ -79,20 +78,20 @@ class BlobManager {
79
78
  * because we know that the server will not delete the blob corresponding to that storage ID.
80
79
  */
81
80
  this.opsInFlight = new Map();
82
- const { routeContext, blobManagerLoadInfo, storage, sendBlobAttachOp, blobRequested, isBlobDeleted, runtime, localBlobIdGenerator, createBlobPayloadPending, } = props;
81
+ const { routeContext, blobManagerLoadInfo, storage, sendBlobAttachOp, blobRequested, isBlobDeleted, runtime, localIdGenerator, createBlobPayloadPending, } = props;
83
82
  this.routeContext = routeContext;
84
83
  this.storage = storage;
85
84
  this.blobRequested = blobRequested;
86
85
  this.isBlobDeleted = isBlobDeleted;
87
86
  this.runtime = runtime;
88
- this.localBlobIdGenerator = localBlobIdGenerator ?? uuid_1.v4;
87
+ this.localIdGenerator = localIdGenerator ?? uuid_1.v4;
89
88
  this.createBlobPayloadPending = createBlobPayloadPending;
90
- this.mc = (0, internal_5.createChildMonitoringContext)({
89
+ this.mc = (0, internal_4.createChildMonitoringContext)({
91
90
  logger: this.runtime.baseLogger,
92
91
  namespace: "BlobManager",
93
92
  });
94
- this.redirectTable = (0, blobManagerSnapSum_js_1.toRedirectTable)(blobManagerLoadInfo, this.mc.logger, this.runtime.attachState);
95
- this.sendBlobAttachOp = (localId, blobId) => {
93
+ this.redirectTable = (0, blobManagerSnapSum_js_1.toRedirectTable)(blobManagerLoadInfo, this.mc.logger);
94
+ this.sendBlobAttachOp = (localId, storageId) => {
96
95
  const pendingEntry = this.pendingBlobs.get(localId);
97
96
  (0, internal_2.assert)(pendingEntry !== undefined, 0x725 /* Must have pending blob entry for upcoming op */);
98
97
  if (pendingEntry?.uploadTime && pendingEntry?.minTTLInSeconds) {
@@ -118,7 +117,7 @@ class BlobManager {
118
117
  }
119
118
  }
120
119
  pendingEntry.opsent = true;
121
- sendBlobAttachOp(localId, blobId);
120
+ sendBlobAttachOp(localId, storageId);
122
121
  };
123
122
  }
124
123
  get allBlobsAttached() {
@@ -134,63 +133,53 @@ class BlobManager {
134
133
  this.pendingBlobs.size > 0);
135
134
  }
136
135
  createAbortError(pending) {
137
- return new internal_5.LoggingError("uploadBlob aborted", {
136
+ return new internal_4.LoggingError("uploadBlob aborted", {
138
137
  acked: pending?.acked,
139
138
  uploadTime: pending?.uploadTime,
140
139
  });
141
140
  }
142
- hasBlob(blobId) {
143
- return this.redirectTable.get(blobId) !== undefined;
141
+ hasBlob(localId) {
142
+ return this.redirectTable.get(localId) !== undefined;
144
143
  }
145
144
  /**
146
145
  * Retrieve the blob with the given local blob id.
147
- * @param blobId - The local blob id. Likely coming from a handle.
146
+ * @param localId - The local blob id. Likely coming from a handle.
148
147
  * @param payloadPending - Whether we suspect the payload may be pending and not available yet.
149
148
  * @returns A promise which resolves to the blob contents
150
149
  */
151
- async getBlob(blobId, payloadPending) {
150
+ async getBlob(localId, payloadPending) {
152
151
  // Verify that the blob is not deleted, i.e., it has not been garbage collected. If it is, this will throw
153
152
  // an error, failing the call.
154
- this.verifyBlobNotDeleted(blobId);
153
+ this.verifyBlobNotDeleted(localId);
155
154
  // Let runtime know that the corresponding GC node was requested.
156
155
  // Note that this will throw if the blob is inactive or tombstoned and throwing on incorrect usage
157
156
  // is configured.
158
- this.blobRequested(getGCNodePathFromBlobId(blobId));
159
- const pending = this.pendingBlobs.get(blobId);
157
+ this.blobRequested(getGCNodePathFromLocalId(localId));
158
+ const pending = this.pendingBlobs.get(localId);
160
159
  if (pending) {
161
160
  return pending.blob;
162
161
  }
163
- let storageId;
164
- if (this.runtime.attachState === internal_1.AttachState.Detached) {
165
- (0, internal_2.assert)(this.redirectTable.has(blobId), 0x383 /* requesting unknown blobs */);
166
- // Blobs created while the container is detached are stored in IDetachedBlobStorage.
167
- // The 'IContainerStorageService.readBlob()' call below will retrieve these via localId.
168
- storageId = blobId;
169
- }
170
- else {
171
- const attachedStorageId = this.redirectTable.get(blobId);
172
- if (!payloadPending) {
173
- // Only blob handles explicitly marked with pending payload are permitted to exist without
174
- // yet knowing their storage id. Otherwise they must already be associated with a storage id.
175
- (0, internal_2.assert)(attachedStorageId !== undefined, 0x11f /* "requesting unknown blobs" */);
176
- }
177
- // If we didn't find it in the redirectTable, assume the attach op is coming eventually and wait.
178
- // We do this even if the local client doesn't have the blob payloadPending flag enabled, in case a
179
- // remote client does have it enabled. This wait may be infinite if the uploading client failed
180
- // the upload and doesn't exist anymore.
181
- storageId =
182
- attachedStorageId ??
183
- (await new Promise((resolve) => {
184
- const onProcessBlobAttach = (localId, _storageId) => {
185
- if (localId === blobId) {
186
- this.internalEvents.off("processedBlobAttach", onProcessBlobAttach);
187
- resolve(_storageId);
188
- }
189
- };
190
- this.internalEvents.on("processedBlobAttach", onProcessBlobAttach);
191
- }));
162
+ let storageId = this.redirectTable.get(localId);
163
+ if (storageId === undefined) {
164
+ // Only blob handles explicitly marked with pending payload are permitted to exist without
165
+ // yet knowing their storage id. Otherwise they must already be associated with a storage id.
166
+ // Handles for detached blobs are not payload pending.
167
+ (0, internal_2.assert)(payloadPending, 0x11f /* "requesting unknown blobs" */);
168
+ // If we didn't find it in the redirectTable and it's payloadPending, assume the attach op is coming
169
+ // eventually and wait. We do this even if the local client doesn't have the blob payloadPending flag
170
+ // enabled, in case a remote client does have it enabled. This wait may be infinite if the uploading
171
+ // client failed the upload and doesn't exist anymore.
172
+ storageId = await new Promise((resolve) => {
173
+ const onProcessBlobAttach = (_localId, _storageId) => {
174
+ if (_localId === localId) {
175
+ this.internalEvents.off("processedBlobAttach", onProcessBlobAttach);
176
+ resolve(_storageId);
177
+ }
178
+ };
179
+ this.internalEvents.on("processedBlobAttach", onProcessBlobAttach);
180
+ });
192
181
  }
193
- return internal_5.PerformanceEvent.timedExecAsync(this.mc.logger, { eventName: "AttachmentReadBlob", id: storageId }, async (event) => {
182
+ return internal_4.PerformanceEvent.timedExecAsync(this.mc.logger, { eventName: "AttachmentReadBlob", id: storageId }, async (event) => {
194
183
  return this.storage.readBlob(storageId).catch((error) => {
195
184
  if (this.runtime.disposed) {
196
185
  // If the runtime is disposed, this is not an error we care to track, it's expected behavior.
@@ -212,15 +201,17 @@ class BlobManager {
212
201
  this.deletePendingBlobMaybe(localId);
213
202
  }
214
203
  : undefined;
215
- return new BlobHandle(getGCNodePathFromBlobId(localId), this.routeContext, async () => this.getBlob(localId, false), false, // payloadPending
204
+ return new BlobHandle(getGCNodePathFromLocalId(localId), this.routeContext, async () => this.getBlob(localId, false), false, // payloadPending
216
205
  callback);
217
206
  }
218
207
  async createBlobDetached(blob) {
208
+ const localId = this.localIdGenerator();
219
209
  // Blobs created while the container is detached are stored in IDetachedBlobStorage.
220
- // The 'IContainerStorageService.createBlob()' call below will respond with a localId.
221
- const response = await this.storage.createBlob(blob);
222
- this.setRedirection(response.id, undefined);
223
- return this.getBlobHandle(response.id);
210
+ // The 'IContainerStorageService.createBlob()' call below will respond with a pseudo storage ID.
211
+ // That pseudo storage ID will be replaced with the real storage ID at attach time.
212
+ const { id: detachedStorageId } = await this.storage.createBlob(blob);
213
+ this.setRedirection(localId, detachedStorageId);
214
+ return this.getBlobHandle(localId);
224
215
  }
225
216
  async createBlob(blob, signal) {
226
217
  if (this.runtime.attachState === internal_1.AttachState.Detached) {
@@ -242,7 +233,7 @@ class BlobManager {
242
233
  }
243
234
  // Create a local ID for the blob. After uploading it to storage and before returning it, a local ID to
244
235
  // storage ID mapping is created.
245
- const localId = this.localBlobIdGenerator();
236
+ const localId = this.localIdGenerator();
246
237
  const pendingEntry = {
247
238
  blob,
248
239
  handleP: new internal_2.Deferred(),
@@ -264,8 +255,8 @@ class BlobManager {
264
255
  });
265
256
  }
266
257
  createBlobWithPayloadPending(blob) {
267
- const localId = this.localBlobIdGenerator();
268
- const blobHandle = new BlobHandle(getGCNodePathFromBlobId(localId), this.routeContext, async () => blob, true, // payloadPending
258
+ const localId = this.localIdGenerator();
259
+ const blobHandle = new BlobHandle(getGCNodePathFromLocalId(localId), this.routeContext, async () => blob, true, // payloadPending
269
260
  () => {
270
261
  const pendingEntry = {
271
262
  blob,
@@ -293,36 +284,49 @@ class BlobManager {
293
284
  this.internalEvents.on("uploadFailed", onUploadFailed);
294
285
  return blobHandle;
295
286
  }
287
+ /**
288
+ * Upload a blob to the storage service.
289
+ * @returns A promise that resolves when the upload is complete and a blob attach op has been sent (but not ack'd).
290
+ *
291
+ * @privateRemarks This method must not reject, as there is no error handling for it in current tracking.
292
+ */
296
293
  async uploadBlob(localId, blob) {
297
- return (0, internal_3.runWithRetry)(async () => {
298
- try {
299
- return await this.storage.createBlob(blob);
300
- }
301
- catch (error) {
302
- const entry = this.pendingBlobs.get(localId);
303
- (0, internal_2.assert)(!!entry, 0x387 /* Must have pending blob entry for blob which failed to upload */);
304
- if (entry.opsent && !(0, internal_3.canRetryOnError)(error)) {
305
- throw (0, internal_5.wrapError)(error, () => new internal_5.LoggingError(`uploadBlob error`, { canRetry: true }));
306
- }
307
- throw error;
308
- }
309
- }, "createBlob", this.mc.logger, {
310
- cancel: this.pendingBlobs.get(localId)?.abortSignal,
311
- }).then((response) => this.onUploadResolve(localId, response), (error) => {
294
+ let response;
295
+ try {
296
+ response = await this.storage.createBlob(blob);
297
+ }
298
+ catch (error) {
299
+ const entry = this.pendingBlobs.get(localId);
312
300
  this.mc.logger.sendTelemetryEvent({
313
301
  eventName: "UploadBlobReject",
314
302
  // TODO: better typing
315
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
316
- error,
303
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
304
+ error: error,
305
+ message: entry === undefined ? "Missing pendingBlob" : undefined,
317
306
  localId,
318
307
  });
319
- // it will only reject if we haven't sent an op
320
- // and is a non-retriable error. It will only reject
321
- // the promise but not throw any error outside.
322
- this.pendingBlobs.get(localId)?.handleP.reject(error);
323
- this.deletePendingBlob(localId);
308
+ // We probably should assert the pendingBlobs entry here, but we don't currently have any error handling
309
+ // for the uploadP - a promise rejection would be unhandled anyway. For now we can detect this with the
310
+ // message on the UploadBlobReject telemetry.
311
+ if (entry !== undefined) {
312
+ entry.handleP.reject(error);
313
+ this.deletePendingBlob(localId);
314
+ }
324
315
  this.internalEvents.emit("uploadFailed", localId, error);
325
- });
316
+ return;
317
+ }
318
+ try {
319
+ this.onUploadResolve(localId, response);
320
+ }
321
+ catch (error) {
322
+ this.mc.logger.sendTelemetryEvent({
323
+ eventName: "OnUploadResolveError",
324
+ // TODO: better typing
325
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
326
+ error: error,
327
+ localId,
328
+ });
329
+ }
326
330
  }
327
331
  /**
328
332
  * Set up a mapping in the redirect table from fromId to toId. Also, notify the runtime that a reference is added
@@ -367,7 +371,7 @@ class BlobManager {
367
371
  if (!entry.opsent) {
368
372
  this.sendBlobAttachOp(localId, response.id);
369
373
  }
370
- const storageIds = (0, blobManagerSnapSum_js_1.getStorageIds)(this.redirectTable, this.runtime.attachState);
374
+ const storageIds = (0, blobManagerSnapSum_js_1.getStorageIds)(this.redirectTable);
371
375
  if (storageIds.has(response.id)) {
372
376
  // The blob is de-duped. Set up a local ID to storage ID mapping and return the blob. Since this is
373
377
  // an existing blob, we don't have to wait for the op to be ack'd since this step has already
@@ -400,7 +404,7 @@ class BlobManager {
400
404
  */
401
405
  reSubmit(metadata) {
402
406
  (0, internal_2.assert)((0, metadata_js_1.isBlobMetadata)(metadata), 0xc01 /* Expected blob metadata for a BlobAttach op */);
403
- const { localId, blobId } = metadata;
407
+ const { localId, blobId: storageId } = metadata;
404
408
  // Any blob that we're actively trying to advance to attached state must have a
405
409
  // pendingBlobs entry. Decline to resubmit for anything else.
406
410
  // For example, we might be asked to resubmit stashed ops for blobs that never had
@@ -408,22 +412,22 @@ class BlobManager {
408
412
  // try to attach them since they won't be accessible to the customer and would just
409
413
  // be considered garbage immediately.
410
414
  if (this.pendingBlobs.has(localId)) {
411
- this.sendBlobAttachOp(localId, blobId);
415
+ this.sendBlobAttachOp(localId, storageId);
412
416
  }
413
417
  }
414
418
  processBlobAttachMessage(message, local) {
415
419
  (0, internal_2.assert)((0, metadata_js_1.isBlobMetadata)(message.metadata), 0xc02 /* Expected blob metadata for a BlobAttach op */);
416
- const { localId, blobId } = message.metadata;
420
+ const { localId, blobId: storageId } = message.metadata;
417
421
  const pendingEntry = this.pendingBlobs.get(localId);
418
422
  if (pendingEntry?.abortSignal?.aborted) {
419
423
  this.deletePendingBlob(localId);
420
424
  return;
421
425
  }
422
- this.setRedirection(localId, blobId);
426
+ this.setRedirection(localId, storageId);
423
427
  // set identity (id -> id) entry
424
- this.setRedirection(blobId, blobId);
428
+ this.setRedirection(storageId, storageId);
425
429
  if (local) {
426
- const waitingBlobs = this.opsInFlight.get(blobId);
430
+ const waitingBlobs = this.opsInFlight.get(storageId);
427
431
  if (waitingBlobs !== undefined) {
428
432
  // For each op corresponding to this storage ID that we are waiting for, resolve the pending blob.
429
433
  // This is safe because the server will keep the blob alive and the op containing the local ID to
@@ -431,14 +435,14 @@ class BlobManager {
431
435
  for (const pendingLocalId of waitingBlobs) {
432
436
  const entry = this.pendingBlobs.get(pendingLocalId);
433
437
  (0, internal_2.assert)(entry !== undefined, 0x38f /* local online BlobAttach op with no pending blob entry */);
434
- this.setRedirection(pendingLocalId, blobId);
438
+ this.setRedirection(pendingLocalId, storageId);
435
439
  entry.acked = true;
436
440
  const blobHandle = this.getBlobHandle(pendingLocalId);
437
441
  blobHandle.notifyShared();
438
442
  entry.handleP.resolve(blobHandle);
439
443
  this.deletePendingBlobMaybe(pendingLocalId);
440
444
  }
441
- this.opsInFlight.delete(blobId);
445
+ this.opsInFlight.delete(storageId);
442
446
  }
443
447
  const localEntry = this.pendingBlobs.get(localId);
444
448
  if (localEntry) {
@@ -449,10 +453,10 @@ class BlobManager {
449
453
  this.deletePendingBlobMaybe(localId);
450
454
  }
451
455
  }
452
- this.internalEvents.emit("processedBlobAttach", localId, blobId);
456
+ this.internalEvents.emit("processedBlobAttach", localId, storageId);
453
457
  }
454
458
  summarize(telemetryContext) {
455
- return (0, blobManagerSnapSum_js_1.summarizeBlobManagerState)(this.redirectTable, this.runtime.attachState);
459
+ return (0, blobManagerSnapSum_js_1.summarizeBlobManagerState)(this.redirectTable);
456
460
  }
457
461
  /**
458
462
  * Generates data used for garbage collection. Each blob uploaded represents a node in the GC graph as it can be
@@ -463,13 +467,12 @@ class BlobManager {
463
467
  getGCData(fullGC = false) {
464
468
  const gcData = { gcNodes: {} };
465
469
  for (const [localId, storageId] of this.redirectTable) {
466
- (0, internal_2.assert)(!!storageId, 0x390 /* Must be attached to get GC data */);
467
- // Only return local ids as GC nodes because a blob can only be referenced via its local id. The storage
468
- // id entries have the same key and value, ignore them.
469
- // The outbound routes are empty because a blob node cannot reference other nodes. It can only be referenced
470
- // by adding its handle to a referenced DDS.
470
+ // Don't report the identity mappings to GC - these exist to service old handles that referenced the storage
471
+ // IDs directly. We'll implicitly clean them up if all of their localId references get GC'd first.
471
472
  if (localId !== storageId) {
472
- gcData.gcNodes[getGCNodePathFromBlobId(localId)] = [];
473
+ // The outbound routes are empty because a blob node cannot reference other nodes. It can only be referenced
474
+ // by adding its handle to a referenced DDS.
475
+ gcData.gcNodes[getGCNodePathFromLocalId(localId)] = [];
473
476
  }
474
477
  }
475
478
  return gcData;
@@ -488,55 +491,53 @@ class BlobManager {
488
491
  * Delete blobs with the given routes from the redirect table.
489
492
  *
490
493
  * @remarks
491
- * The routes are GC nodes paths of format -`/<blobManagerBasePath>/<blobId>`. The blob ids are all local ids.
494
+ * The routes are GC nodes paths of format -`/<blobManagerBasePath>/<localId>`.
492
495
  * Deleting the blobs involves 2 steps:
493
496
  *
494
497
  * 1. The redirect table entry for the local ids are deleted.
495
498
  *
496
- * 2. If the storage ids corresponding to the deleted local ids are not in-use anymore, the redirect table entries
497
- * for the storage ids are deleted as well.
499
+ * 2. If the storage ids corresponding to the deleted local ids are not referenced by any further local ids, the
500
+ * identity mappings in the redirect table are deleted as well.
498
501
  *
499
502
  * Note that this does not delete the blobs from storage service immediately. Deleting the blobs from redirect table
500
- * will remove them the next summary. The service would them delete them some time in the future.
503
+ * will ensure we don't create an attachment blob for them at the next summary. The service would then delete them
504
+ * some time in the future.
501
505
  */
502
506
  deleteBlobsFromRedirectTable(blobRoutes) {
503
- if (blobRoutes.length === 0) {
504
- return;
505
- }
506
- // This tracks the storage ids of local ids that are deleted. After the local ids have been deleted, if any of
507
- // these storage ids are unused, they will be deleted as well.
507
+ // maybeUnusedStorageIds is used to compute the set of storage IDs that *used to have a local ID*, but that
508
+ // local ID is being deleted.
508
509
  const maybeUnusedStorageIds = new Set();
509
510
  for (const route of blobRoutes) {
510
- const blobId = getBlobIdFromGCNodePath(route);
511
+ const localId = getLocalIdFromGCNodePath(route);
511
512
  // If the blob hasn't already been deleted, log an error because this should never happen.
512
513
  // If the blob has already been deleted, log a telemetry event. This can happen because multiple GC
513
514
  // sweep ops can contain the same data store. It would be interesting to track how often this happens.
514
515
  const alreadyDeleted = this.isBlobDeleted(route);
515
- if (!this.redirectTable.has(blobId)) {
516
+ const storageId = this.redirectTable.get(localId);
517
+ if (storageId === undefined) {
516
518
  this.mc.logger.sendTelemetryEvent({
517
519
  eventName: "DeletedAttachmentBlobNotFound",
518
520
  category: alreadyDeleted ? "generic" : "error",
519
- blobId,
521
+ blobId: localId,
520
522
  details: { alreadyDeleted },
521
523
  });
522
524
  continue;
523
525
  }
524
- const storageId = this.redirectTable.get(blobId);
525
- (0, internal_2.assert)(!!storageId, 0x5bb /* Must be attached to run GC */);
526
526
  maybeUnusedStorageIds.add(storageId);
527
- this.redirectTable.delete(blobId);
527
+ this.redirectTable.delete(localId);
528
528
  }
529
- // Find out storage ids that are in-use and remove them from maybeUnusedStorageIds. A storage id is in-use if
530
- // the redirect table has a local id -> storage id entry for it.
531
- for (const [localId, storageId] of this.redirectTable.entries()) {
532
- (0, internal_2.assert)(!!storageId, 0x5bc /* Must be attached to run GC */);
533
- // For every storage id, the redirect table has a id -> id entry. These do not make the storage id in-use.
534
- if (maybeUnusedStorageIds.has(storageId) && localId !== storageId) {
529
+ // Remove any storage IDs that still have local IDs referring to them (excluding the identity mapping).
530
+ for (const [localId, storageId] of this.redirectTable) {
531
+ if (localId !== storageId) {
535
532
  maybeUnusedStorageIds.delete(storageId);
536
533
  }
537
534
  }
538
- // For unused storage ids, delete their id -> id entries from the redirect table.
539
- // This way they'll be absent from the next summary, and the service is free to delete them from storage.
535
+ // Now delete any identity mappings (storage ID -> storage ID) from the redirect table that used to be
536
+ // referenced by a distinct local ID. This way they'll be absent from the next summary, and the service
537
+ // is free to delete them from storage.
538
+ // WARNING: This can potentially delete identity mappings that are still referenced, if storage deduping
539
+ // has let us add a local ID -> storage ID mapping that is later deleted. AB#47337 tracks this issue
540
+ // and possible solutions.
540
541
  for (const storageId of maybeUnusedStorageIds) {
541
542
  this.redirectTable.delete(storageId);
542
543
  }
@@ -545,12 +546,12 @@ class BlobManager {
545
546
  * Verifies that the blob with given id is not deleted, i.e., it has not been garbage collected. If the blob is GC'd,
546
547
  * log an error and throw if necessary.
547
548
  */
548
- verifyBlobNotDeleted(blobId) {
549
- if (!this.isBlobDeleted(getGCNodePathFromBlobId(blobId))) {
549
+ verifyBlobNotDeleted(localId) {
550
+ if (!this.isBlobDeleted(getGCNodePathFromLocalId(localId))) {
550
551
  return;
551
552
  }
552
- const request = { url: blobId };
553
- const error = (0, internal_4.responseToException)((0, internal_4.createResponseError)(404, `Blob was deleted`, request), request);
553
+ const request = { url: localId };
554
+ const error = (0, internal_3.responseToException)((0, internal_3.createResponseError)(404, `Blob was deleted`, request), request);
554
555
  // Only log deleted events. Tombstone events are logged by garbage collector.
555
556
  this.mc.logger.sendErrorEvent({
556
557
  eventName: "GC_Deleted_Blob_Requested",
@@ -558,14 +559,28 @@ class BlobManager {
558
559
  }, error);
559
560
  throw error;
560
561
  }
561
- setRedirectTable(table) {
562
+ /**
563
+ * Called in detached state just prior to attaching, this will update the redirect table by
564
+ * converting the pseudo storage IDs into real storage IDs using the provided detachedStorageTable.
565
+ * The provided table must have exactly the same set of pseudo storage IDs as are found in the redirect table.
566
+ * @param detachedStorageTable - A map of pseudo storage IDs to real storage IDs.
567
+ */
568
+ patchRedirectTable(detachedStorageTable) {
562
569
  (0, internal_2.assert)(this.runtime.attachState === internal_1.AttachState.Detached, 0x252 /* "redirect table can only be set in detached container" */);
563
- (0, internal_2.assert)(this.redirectTable.size === table.size, 0x391 /* Redirect table size must match BlobManager's local ID count */);
564
- for (const [localId, storageId] of table) {
565
- (0, internal_2.assert)(this.redirectTable.has(localId), 0x254 /* "unrecognized id in redirect table" */);
566
- this.setRedirection(localId, storageId);
570
+ // The values of the redirect table are the pseudo storage IDs, which are the keys of the
571
+ // detachedStorageTable. We expect to have a many:1 mapping from local IDs to pseudo
572
+ // storage IDs (many in the case that the storage dedupes the blob).
573
+ (0, internal_2.assert)(new Set(this.redirectTable.values()).size === detachedStorageTable.size, 0x391 /* Redirect table size must match BlobManager's local ID count */);
574
+ // Taking a snapshot of the redirect table entries before iterating, because
575
+ // we will be adding identity mappings to the the redirect table as we iterate
576
+ // and we don't want to include those in the iteration.
577
+ const redirectTableEntries = [...this.redirectTable.entries()];
578
+ for (const [localId, detachedStorageId] of redirectTableEntries) {
579
+ const newStorageId = detachedStorageTable.get(detachedStorageId);
580
+ (0, internal_2.assert)(newStorageId !== undefined, "Couldn't find a matching storage ID");
581
+ this.setRedirection(localId, newStorageId);
567
582
  // set identity (id -> id) entry
568
- this.setRedirection(storageId, storageId);
583
+ this.setRedirection(newStorageId, newStorageId);
569
584
  }
570
585
  }
571
586
  /**
@@ -593,20 +608,20 @@ class BlobManager {
593
608
  * or undefined if no blobs were processed.
594
609
  */
595
610
  async attachAndGetPendingBlobs(stopBlobAttachingSignal) {
596
- throw new internal_5.UsageError("attachAndGetPendingBlobs is no longer supported");
611
+ throw new internal_4.UsageError("attachAndGetPendingBlobs is no longer supported");
597
612
  }
598
613
  }
599
614
  exports.BlobManager = BlobManager;
600
615
  /**
601
- * For a blobId, returns its path in GC's graph. The node path is of the format `/<blobManagerBasePath>/<blobId>`.
616
+ * For a localId, returns its path in GC's graph. The node path is of the format `/<blobManagerBasePath>/<localId>`.
602
617
  * This path must match the path of the blob handle returned by the createBlob API because blobs are marked
603
618
  * referenced by storing these handles in a referenced DDS.
604
619
  */
605
- const getGCNodePathFromBlobId = (blobId) => `/${exports.blobManagerBasePath}/${blobId}`;
620
+ const getGCNodePathFromLocalId = (localId) => `/${exports.blobManagerBasePath}/${localId}`;
606
621
  /**
607
- * For a given GC node path, return the blobId. The node path is of the format `/<basePath>/<blobId>`.
622
+ * For a given GC node path, return the localId. The node path is of the format `/<basePath>/<localId>`.
608
623
  */
609
- const getBlobIdFromGCNodePath = (nodePath) => {
624
+ const getLocalIdFromGCNodePath = (nodePath) => {
610
625
  const pathParts = nodePath.split("/");
611
626
  (0, internal_2.assert)(areBlobPathParts(pathParts), 0x5bd /* Invalid blob node path */);
612
627
  return pathParts[2];