@fluidframework/container-runtime 2.0.0-dev-rc.4.0.0.261659 → 2.0.0-dev-rc.5.0.0.265721

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 (322) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/api-report/container-runtime.api.md +60 -29
  3. package/dist/batchTracker.js.map +1 -1
  4. package/dist/blobManager.d.ts +9 -9
  5. package/dist/blobManager.d.ts.map +1 -1
  6. package/dist/blobManager.js +3 -5
  7. package/dist/blobManager.js.map +1 -1
  8. package/dist/channelCollection.d.ts +8 -6
  9. package/dist/channelCollection.d.ts.map +1 -1
  10. package/dist/channelCollection.js +22 -11
  11. package/dist/channelCollection.js.map +1 -1
  12. package/dist/connectionTelemetry.d.ts +1 -1
  13. package/dist/connectionTelemetry.d.ts.map +1 -1
  14. package/dist/connectionTelemetry.js.map +1 -1
  15. package/dist/containerHandleContext.d.ts +2 -1
  16. package/dist/containerHandleContext.d.ts.map +1 -1
  17. package/dist/containerHandleContext.js.map +1 -1
  18. package/dist/containerRuntime.d.ts +14 -24
  19. package/dist/containerRuntime.d.ts.map +1 -1
  20. package/dist/containerRuntime.js +125 -140
  21. package/dist/containerRuntime.js.map +1 -1
  22. package/dist/dataStore.d.ts.map +1 -1
  23. package/dist/dataStore.js.map +1 -1
  24. package/dist/dataStoreContext.d.ts +13 -10
  25. package/dist/dataStoreContext.d.ts.map +1 -1
  26. package/dist/dataStoreContext.js +21 -8
  27. package/dist/dataStoreContext.js.map +1 -1
  28. package/dist/dataStoreContexts.js.map +1 -1
  29. package/dist/dataStoreRegistry.js.map +1 -1
  30. package/dist/{deltaManagerSummarizerProxy.d.ts → deltaManagerProxies.d.ts} +28 -3
  31. package/dist/deltaManagerProxies.d.ts.map +1 -0
  32. package/dist/{deltaManagerSummarizerProxy.js → deltaManagerProxies.js} +38 -2
  33. package/dist/deltaManagerProxies.js.map +1 -0
  34. package/dist/deltaScheduler.d.ts +1 -1
  35. package/dist/deltaScheduler.d.ts.map +1 -1
  36. package/dist/deltaScheduler.js.map +1 -1
  37. package/dist/gc/garbageCollection.d.ts +1 -2
  38. package/dist/gc/garbageCollection.d.ts.map +1 -1
  39. package/dist/gc/garbageCollection.js +1 -1
  40. package/dist/gc/garbageCollection.js.map +1 -1
  41. package/dist/gc/gcConfigs.d.ts.map +1 -1
  42. package/dist/gc/gcConfigs.js +14 -19
  43. package/dist/gc/gcConfigs.js.map +1 -1
  44. package/dist/gc/gcDefinitions.d.ts +4 -22
  45. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  46. package/dist/gc/gcDefinitions.js +3 -3
  47. package/dist/gc/gcDefinitions.js.map +1 -1
  48. package/dist/gc/gcHelpers.d.ts +1 -2
  49. package/dist/gc/gcHelpers.d.ts.map +1 -1
  50. package/dist/gc/gcHelpers.js.map +1 -1
  51. package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -1
  52. package/dist/gc/gcSummaryDefinitions.d.ts +1 -1
  53. package/dist/gc/gcSummaryDefinitions.d.ts.map +1 -1
  54. package/dist/gc/gcSummaryDefinitions.js.map +1 -1
  55. package/dist/gc/gcSummaryStateTracker.d.ts +1 -1
  56. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  57. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  58. package/dist/gc/gcTelemetry.d.ts +1 -1
  59. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  60. package/dist/gc/gcTelemetry.js +2 -2
  61. package/dist/gc/gcTelemetry.js.map +1 -1
  62. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  63. package/dist/gc/index.d.ts +1 -1
  64. package/dist/gc/index.d.ts.map +1 -1
  65. package/dist/gc/index.js +2 -2
  66. package/dist/gc/index.js.map +1 -1
  67. package/dist/index.d.ts +1 -1
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js.map +1 -1
  70. package/dist/legacy.d.ts +6 -1
  71. package/dist/messageTypes.d.ts +5 -2
  72. package/dist/messageTypes.d.ts.map +1 -1
  73. package/dist/messageTypes.js.map +1 -1
  74. package/dist/opLifecycle/batchManager.d.ts +4 -0
  75. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  76. package/dist/opLifecycle/batchManager.js.map +1 -1
  77. package/dist/opLifecycle/opCompressor.js.map +1 -1
  78. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  79. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  80. package/dist/opLifecycle/opSplitter.js.map +1 -1
  81. package/dist/opLifecycle/outbox.d.ts +1 -0
  82. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  83. package/dist/opLifecycle/outbox.js +7 -20
  84. package/dist/opLifecycle/outbox.js.map +1 -1
  85. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  86. package/dist/packageVersion.d.ts +1 -1
  87. package/dist/packageVersion.js +1 -1
  88. package/dist/packageVersion.js.map +1 -1
  89. package/dist/pendingStateManager.d.ts +6 -0
  90. package/dist/pendingStateManager.d.ts.map +1 -1
  91. package/dist/pendingStateManager.js +10 -1
  92. package/dist/pendingStateManager.js.map +1 -1
  93. package/dist/scheduleManager.d.ts +1 -1
  94. package/dist/scheduleManager.d.ts.map +1 -1
  95. package/dist/scheduleManager.js.map +1 -1
  96. package/dist/storageServiceWithAttachBlobs.js.map +1 -1
  97. package/dist/summary/documentSchema.js +2 -2
  98. package/dist/summary/documentSchema.js.map +1 -1
  99. package/dist/summary/index.d.ts +2 -2
  100. package/dist/summary/index.d.ts.map +1 -1
  101. package/dist/summary/index.js.map +1 -1
  102. package/dist/summary/orderedClientElection.d.ts +4 -2
  103. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  104. package/dist/summary/orderedClientElection.js +35 -13
  105. package/dist/summary/orderedClientElection.js.map +1 -1
  106. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  107. package/dist/summary/runningSummarizer.d.ts +0 -5
  108. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  109. package/dist/summary/runningSummarizer.js +28 -113
  110. package/dist/summary/runningSummarizer.js.map +1 -1
  111. package/dist/summary/summarizer.d.ts +1 -1
  112. package/dist/summary/summarizer.d.ts.map +1 -1
  113. package/dist/summary/summarizer.js +4 -1
  114. package/dist/summary/summarizer.js.map +1 -1
  115. package/dist/summary/summarizerClientElection.js.map +1 -1
  116. package/dist/summary/summarizerHeuristics.js.map +1 -1
  117. package/dist/summary/summarizerNode/summarizerNode.d.ts +1 -2
  118. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  119. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  120. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  121. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -2
  122. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  123. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  124. package/dist/summary/summarizerTypes.d.ts +16 -28
  125. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  126. package/dist/summary/summarizerTypes.js.map +1 -1
  127. package/dist/summary/summaryCollection.d.ts +1 -1
  128. package/dist/summary/summaryCollection.d.ts.map +1 -1
  129. package/dist/summary/summaryCollection.js +2 -2
  130. package/dist/summary/summaryCollection.js.map +1 -1
  131. package/dist/summary/summaryFormat.d.ts +26 -6
  132. package/dist/summary/summaryFormat.d.ts.map +1 -1
  133. package/dist/summary/summaryFormat.js.map +1 -1
  134. package/dist/summary/summaryGenerator.d.ts +7 -8
  135. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  136. package/dist/summary/summaryGenerator.js +30 -25
  137. package/dist/summary/summaryGenerator.js.map +1 -1
  138. package/dist/summary/summaryManager.js +5 -5
  139. package/dist/summary/summaryManager.js.map +1 -1
  140. package/dist/throttler.js.map +1 -1
  141. package/lib/batchTracker.js.map +1 -1
  142. package/lib/blobManager.d.ts +9 -9
  143. package/lib/blobManager.d.ts.map +1 -1
  144. package/lib/blobManager.js +4 -6
  145. package/lib/blobManager.js.map +1 -1
  146. package/lib/channelCollection.d.ts +8 -6
  147. package/lib/channelCollection.d.ts.map +1 -1
  148. package/lib/channelCollection.js +23 -12
  149. package/lib/channelCollection.js.map +1 -1
  150. package/lib/connectionTelemetry.d.ts +1 -1
  151. package/lib/connectionTelemetry.d.ts.map +1 -1
  152. package/lib/connectionTelemetry.js.map +1 -1
  153. package/lib/containerHandleContext.d.ts +2 -1
  154. package/lib/containerHandleContext.d.ts.map +1 -1
  155. package/lib/containerHandleContext.js.map +1 -1
  156. package/lib/containerRuntime.d.ts +14 -24
  157. package/lib/containerRuntime.d.ts.map +1 -1
  158. package/lib/containerRuntime.js +125 -140
  159. package/lib/containerRuntime.js.map +1 -1
  160. package/lib/dataStore.d.ts.map +1 -1
  161. package/lib/dataStore.js.map +1 -1
  162. package/lib/dataStoreContext.d.ts +13 -10
  163. package/lib/dataStoreContext.d.ts.map +1 -1
  164. package/lib/dataStoreContext.js +23 -10
  165. package/lib/dataStoreContext.js.map +1 -1
  166. package/lib/dataStoreContexts.js.map +1 -1
  167. package/lib/dataStoreRegistry.js.map +1 -1
  168. package/lib/{deltaManagerSummarizerProxy.d.ts → deltaManagerProxies.d.ts} +28 -3
  169. package/lib/deltaManagerProxies.d.ts.map +1 -0
  170. package/lib/{deltaManagerSummarizerProxy.js → deltaManagerProxies.js} +36 -1
  171. package/lib/deltaManagerProxies.js.map +1 -0
  172. package/lib/deltaScheduler.d.ts +1 -1
  173. package/lib/deltaScheduler.d.ts.map +1 -1
  174. package/lib/deltaScheduler.js.map +1 -1
  175. package/lib/gc/garbageCollection.d.ts +1 -2
  176. package/lib/gc/garbageCollection.d.ts.map +1 -1
  177. package/lib/gc/garbageCollection.js +1 -1
  178. package/lib/gc/garbageCollection.js.map +1 -1
  179. package/lib/gc/gcConfigs.d.ts.map +1 -1
  180. package/lib/gc/gcConfigs.js +15 -20
  181. package/lib/gc/gcConfigs.js.map +1 -1
  182. package/lib/gc/gcDefinitions.d.ts +4 -22
  183. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  184. package/lib/gc/gcDefinitions.js +2 -2
  185. package/lib/gc/gcDefinitions.js.map +1 -1
  186. package/lib/gc/gcHelpers.d.ts +1 -2
  187. package/lib/gc/gcHelpers.d.ts.map +1 -1
  188. package/lib/gc/gcHelpers.js.map +1 -1
  189. package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -1
  190. package/lib/gc/gcSummaryDefinitions.d.ts +1 -1
  191. package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -1
  192. package/lib/gc/gcSummaryDefinitions.js.map +1 -1
  193. package/lib/gc/gcSummaryStateTracker.d.ts +1 -1
  194. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  195. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  196. package/lib/gc/gcTelemetry.d.ts +1 -1
  197. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  198. package/lib/gc/gcTelemetry.js +2 -2
  199. package/lib/gc/gcTelemetry.js.map +1 -1
  200. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  201. package/lib/gc/index.d.ts +1 -1
  202. package/lib/gc/index.d.ts.map +1 -1
  203. package/lib/gc/index.js +1 -1
  204. package/lib/gc/index.js.map +1 -1
  205. package/lib/index.d.ts +1 -1
  206. package/lib/index.d.ts.map +1 -1
  207. package/lib/index.js.map +1 -1
  208. package/lib/legacy.d.ts +6 -1
  209. package/lib/messageTypes.d.ts +5 -2
  210. package/lib/messageTypes.d.ts.map +1 -1
  211. package/lib/messageTypes.js.map +1 -1
  212. package/lib/opLifecycle/batchManager.d.ts +4 -0
  213. package/lib/opLifecycle/batchManager.d.ts.map +1 -1
  214. package/lib/opLifecycle/batchManager.js.map +1 -1
  215. package/lib/opLifecycle/opCompressor.js.map +1 -1
  216. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  217. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  218. package/lib/opLifecycle/opSplitter.js.map +1 -1
  219. package/lib/opLifecycle/outbox.d.ts +1 -0
  220. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  221. package/lib/opLifecycle/outbox.js +7 -20
  222. package/lib/opLifecycle/outbox.js.map +1 -1
  223. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  224. package/lib/packageVersion.d.ts +1 -1
  225. package/lib/packageVersion.js +1 -1
  226. package/lib/packageVersion.js.map +1 -1
  227. package/lib/pendingStateManager.d.ts +6 -0
  228. package/lib/pendingStateManager.d.ts.map +1 -1
  229. package/lib/pendingStateManager.js +10 -1
  230. package/lib/pendingStateManager.js.map +1 -1
  231. package/lib/scheduleManager.d.ts +1 -1
  232. package/lib/scheduleManager.d.ts.map +1 -1
  233. package/lib/scheduleManager.js.map +1 -1
  234. package/lib/storageServiceWithAttachBlobs.js.map +1 -1
  235. package/lib/summary/documentSchema.js +2 -2
  236. package/lib/summary/documentSchema.js.map +1 -1
  237. package/lib/summary/index.d.ts +2 -2
  238. package/lib/summary/index.d.ts.map +1 -1
  239. package/lib/summary/index.js.map +1 -1
  240. package/lib/summary/orderedClientElection.d.ts +4 -2
  241. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  242. package/lib/summary/orderedClientElection.js +35 -13
  243. package/lib/summary/orderedClientElection.js.map +1 -1
  244. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  245. package/lib/summary/runningSummarizer.d.ts +0 -5
  246. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  247. package/lib/summary/runningSummarizer.js +21 -106
  248. package/lib/summary/runningSummarizer.js.map +1 -1
  249. package/lib/summary/summarizer.d.ts +1 -1
  250. package/lib/summary/summarizer.d.ts.map +1 -1
  251. package/lib/summary/summarizer.js +4 -1
  252. package/lib/summary/summarizer.js.map +1 -1
  253. package/lib/summary/summarizerClientElection.js.map +1 -1
  254. package/lib/summary/summarizerHeuristics.js.map +1 -1
  255. package/lib/summary/summarizerNode/summarizerNode.d.ts +1 -2
  256. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  257. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  258. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  259. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -2
  260. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  261. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  262. package/lib/summary/summarizerTypes.d.ts +16 -28
  263. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  264. package/lib/summary/summarizerTypes.js.map +1 -1
  265. package/lib/summary/summaryCollection.d.ts +1 -1
  266. package/lib/summary/summaryCollection.d.ts.map +1 -1
  267. package/lib/summary/summaryCollection.js +2 -2
  268. package/lib/summary/summaryCollection.js.map +1 -1
  269. package/lib/summary/summaryFormat.d.ts +26 -6
  270. package/lib/summary/summaryFormat.d.ts.map +1 -1
  271. package/lib/summary/summaryFormat.js +1 -1
  272. package/lib/summary/summaryFormat.js.map +1 -1
  273. package/lib/summary/summaryGenerator.d.ts +7 -8
  274. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  275. package/lib/summary/summaryGenerator.js +24 -19
  276. package/lib/summary/summaryGenerator.js.map +1 -1
  277. package/lib/summary/summaryManager.js +1 -1
  278. package/lib/summary/summaryManager.js.map +1 -1
  279. package/lib/throttler.js.map +1 -1
  280. package/lib/tsdoc-metadata.json +1 -1
  281. package/package.json +65 -26
  282. package/src/blobManager.ts +14 -13
  283. package/src/channelCollection.ts +34 -20
  284. package/src/connectionTelemetry.ts +1 -1
  285. package/src/containerHandleContext.ts +2 -1
  286. package/src/containerRuntime.ts +161 -170
  287. package/src/dataStore.ts +3 -2
  288. package/src/dataStoreContext.ts +62 -23
  289. package/src/{deltaManagerSummarizerProxy.ts → deltaManagerProxies.ts} +55 -3
  290. package/src/deltaScheduler.ts +1 -1
  291. package/src/gc/garbageCollection.md +0 -8
  292. package/src/gc/garbageCollection.ts +2 -1
  293. package/src/gc/gcConfigs.ts +12 -19
  294. package/src/gc/gcDefinitions.ts +5 -23
  295. package/src/gc/gcHelpers.ts +1 -1
  296. package/src/gc/gcSummaryDefinitions.ts +1 -1
  297. package/src/gc/gcSummaryStateTracker.ts +1 -1
  298. package/src/gc/gcTelemetry.ts +1 -1
  299. package/src/gc/index.ts +1 -1
  300. package/src/index.ts +6 -1
  301. package/src/messageTypes.ts +4 -2
  302. package/src/opLifecycle/batchManager.ts +5 -0
  303. package/src/opLifecycle/outbox.ts +7 -30
  304. package/src/packageVersion.ts +1 -1
  305. package/src/pendingStateManager.ts +11 -1
  306. package/src/scheduleManager.ts +1 -1
  307. package/src/summary/documentSchema.ts +1 -1
  308. package/src/summary/index.ts +5 -1
  309. package/src/summary/orderedClientElection.ts +83 -12
  310. package/src/summary/runningSummarizer.ts +30 -114
  311. package/src/summary/summarizer.ts +5 -2
  312. package/src/summary/summarizerNode/summarizerNode.ts +0 -2
  313. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +1 -3
  314. package/src/summary/summarizerTypes.ts +22 -29
  315. package/src/summary/summaryCollection.ts +1 -1
  316. package/src/summary/summaryFormat.ts +35 -6
  317. package/src/summary/summaryGenerator.ts +50 -27
  318. package/src/summary/summaryManager.ts +1 -1
  319. package/dist/deltaManagerSummarizerProxy.d.ts.map +0 -1
  320. package/dist/deltaManagerSummarizerProxy.js.map +0 -1
  321. package/lib/deltaManagerSummarizerProxy.d.ts.map +0 -1
  322. package/lib/deltaManagerSummarizerProxy.js.map +0 -1
package/src/dataStore.ts CHANGED
@@ -4,7 +4,8 @@
4
4
  */
5
5
 
6
6
  import { AttachState } from "@fluidframework/container-definitions";
7
- import { FluidObject, IFluidHandle } from "@fluidframework/core-interfaces";
7
+ import { FluidObject } from "@fluidframework/core-interfaces";
8
+ import { type IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
8
9
  import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
9
10
  import {
10
11
  AliasResult,
@@ -169,7 +170,7 @@ class DataStore implements IDataStore {
169
170
  /**
170
171
  * {@inheritDoc @fluidframework/runtime-definitions#IDataStore.entryPoint}
171
172
  */
172
- get entryPoint(): IFluidHandle<FluidObject> {
173
+ get entryPoint(): IFluidHandleInternal<FluidObject> {
173
174
  return this.fluidDataStoreChannel.entryPoint;
174
175
  }
175
176
 
@@ -4,19 +4,27 @@
4
4
  */
5
5
 
6
6
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
7
- import { AttachState, IAudience, IDeltaManager } from "@fluidframework/container-definitions";
7
+ import { AttachState, IAudience } from "@fluidframework/container-definitions";
8
+ import { IDeltaManager } from "@fluidframework/container-definitions/internal";
8
9
  import {
9
10
  FluidObject,
10
11
  IDisposable,
11
- IEvent,
12
- IFluidHandle,
13
12
  IRequest,
14
13
  IResponse,
15
14
  ITelemetryBaseProperties,
15
+ type IEvent,
16
16
  } from "@fluidframework/core-interfaces";
17
+ import { type IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
17
18
  import { assert, LazyPromise, unreachableCase } from "@fluidframework/core-utils/internal";
18
- import { IDocumentStorageService } from "@fluidframework/driver-definitions/internal";
19
- import { BlobTreeEntry, readAndParse } from "@fluidframework/driver-utils/internal";
19
+ import {
20
+ IDocumentStorageService,
21
+ type ISnapshot,
22
+ } from "@fluidframework/driver-definitions/internal";
23
+ import {
24
+ BlobTreeEntry,
25
+ isInstanceOfISnapshot,
26
+ readAndParse,
27
+ } from "@fluidframework/driver-utils/internal";
20
28
  import type { IIdCompressor } from "@fluidframework/id-compressor";
21
29
  import {
22
30
  IClientDetails,
@@ -26,13 +34,11 @@ import {
26
34
  ISnapshotTree,
27
35
  ITreeEntry,
28
36
  } from "@fluidframework/protocol-definitions";
37
+ import { IInboundSignalMessage } from "@fluidframework/runtime-definitions";
29
38
  import {
30
- IGarbageCollectionData,
31
- IInboundSignalMessage,
32
39
  ISummaryTreeWithStats,
33
40
  ITelemetryContext,
34
- } from "@fluidframework/runtime-definitions";
35
- import {
41
+ IGarbageCollectionData,
36
42
  CreateChildSummarizerNodeFn,
37
43
  CreateChildSummarizerNodeParam,
38
44
  FluidDataStoreRegistryEntry,
@@ -52,7 +58,11 @@ import {
52
58
  channelsTreeName,
53
59
  gcDataBlobKey,
54
60
  } from "@fluidframework/runtime-definitions/internal";
55
- import { addBlobToSummary } from "@fluidframework/runtime-utils/internal";
61
+ import {
62
+ addBlobToSummary,
63
+ isSnapshotFetchRequiredForLoadingGroupId,
64
+ toFluidHandleInternal,
65
+ } from "@fluidframework/runtime-utils/internal";
56
66
  import {
57
67
  DataCorruptionError,
58
68
  DataProcessingError,
@@ -67,6 +77,7 @@ import {
67
77
 
68
78
  import { detectOutboundRoutesViaDDSKey, sendGCUnexpectedUsageEvent } from "./gc/index.js";
69
79
  import {
80
+ // eslint-disable-next-line import/no-deprecated
70
81
  ReadFluidDataStoreAttributes,
71
82
  WriteFluidDataStoreAttributes,
72
83
  dataStoreAttributesBlobName,
@@ -164,7 +175,7 @@ export interface ILocalDetachedFluidDataStoreContextProps extends ILocalFluidDat
164
175
  * @internal
165
176
  */
166
177
  export interface IRemoteFluidDataStoreContextProps extends IFluidDataStoreContextProps {
167
- readonly snapshotTree: ISnapshotTree | undefined;
178
+ readonly snapshot: ISnapshotTree | ISnapshot | undefined;
168
179
  }
169
180
 
170
181
  // back-compat: To be removed in the future.
@@ -199,8 +210,8 @@ export abstract class FluidDataStoreContext
199
210
  return this.parentContext.clientDetails;
200
211
  }
201
212
 
202
- public get logger() {
203
- return this.parentContext.logger;
213
+ public get baseLogger() {
214
+ return this.parentContext.baseLogger;
204
215
  }
205
216
 
206
217
  public get deltaManager(): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {
@@ -371,7 +382,7 @@ export abstract class FluidDataStoreContext
371
382
  );
372
383
 
373
384
  this.mc = createChildMonitoringContext({
374
- logger: this.logger,
385
+ logger: this.baseLogger,
375
386
  namespace: "FluidDataStoreContext",
376
387
  properties: {
377
388
  all: tagCodeArtifacts({
@@ -722,11 +733,17 @@ export abstract class FluidDataStoreContext
722
733
  * @param srcHandle - The handle of the node that added the reference.
723
734
  * @param outboundHandle - The handle of the outbound node that is referenced.
724
735
  */
725
- public addedGCOutboundReference(srcHandle: IFluidHandle, outboundHandle: IFluidHandle) {
736
+ public addedGCOutboundReference(
737
+ srcHandle: IFluidHandleInternal,
738
+ outboundHandle: IFluidHandleInternal,
739
+ ): void {
726
740
  // By default, skip this call since the ContainerRuntime will detect the outbound route directly.
727
741
  if (this.mc.config.getBoolean(detectOutboundRoutesViaDDSKey) === true) {
728
742
  // Note: The ContainerRuntime code will check this same setting to avoid double counting.
729
- this.parentContext.addedGCOutboundReference?.(srcHandle, outboundHandle);
743
+ this.parentContext.addedGCOutboundReference?.(
744
+ toFluidHandleInternal(srcHandle),
745
+ toFluidHandleInternal(outboundHandle),
746
+ );
730
747
  }
731
748
  }
732
749
 
@@ -1054,7 +1071,7 @@ export abstract class FluidDataStoreContext
1054
1071
  public async uploadBlob(
1055
1072
  blob: ArrayBufferLike,
1056
1073
  signal?: AbortSignal,
1057
- ): Promise<IFluidHandle<ArrayBufferLike>> {
1074
+ ): Promise<IFluidHandleInternal<ArrayBufferLike>> {
1058
1075
  return this.parentContext.uploadBlob(blob, signal);
1059
1076
  }
1060
1077
  }
@@ -1062,23 +1079,28 @@ export abstract class FluidDataStoreContext
1062
1079
  /** @internal */
1063
1080
  export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
1064
1081
  // Tells whether we need to fetch the snapshot before use. This is to support Data Virtualization.
1065
- private snapshotFetchRequired: boolean;
1082
+ private snapshotFetchRequired: boolean | undefined;
1066
1083
  private readonly runtime: IContainerRuntimeBase;
1084
+ private readonly blobContents: Map<string, ArrayBuffer> | undefined;
1067
1085
 
1068
1086
  constructor(props: IRemoteFluidDataStoreContextProps) {
1069
1087
  super(props, true /* existing */, false /* isLocalDataStore */, () => {
1070
1088
  throw new Error("Already attached");
1071
1089
  });
1072
1090
 
1073
- this._baseSnapshot = props.snapshotTree;
1074
- this.snapshotFetchRequired = !!props.snapshotTree?.omitted;
1075
1091
  this.runtime = props.parentContext.containerRuntime;
1076
- if (props.snapshotTree !== undefined) {
1077
- this.summarizerNode.updateBaseSummaryState(props.snapshotTree);
1092
+ if (isInstanceOfISnapshot(props.snapshot)) {
1093
+ this.blobContents = props.snapshot.blobContents;
1094
+ this._baseSnapshot = props.snapshot.snapshotTree;
1095
+ } else {
1096
+ this._baseSnapshot = props.snapshot;
1097
+ }
1098
+ if (this._baseSnapshot !== undefined) {
1099
+ this.summarizerNode.updateBaseSummaryState(this._baseSnapshot);
1078
1100
  }
1079
1101
  }
1080
1102
 
1081
- /*
1103
+ /*
1082
1104
  This API should not be called for RemoteFluidDataStoreContext. But here is one scenario where it's not the case:
1083
1105
  The scenario (hit by stashedOps.spec.ts, "resends attach op" UT is the following (as far as I understand):
1084
1106
  1. data store is being attached in attached container
@@ -1093,6 +1115,21 @@ export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
1093
1115
  private readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {
1094
1116
  // Sequence number of the snapshot.
1095
1117
  let sequenceNumber: number | undefined;
1118
+ // Check whether we need to fetch the snapshot first to load.
1119
+ if (this.snapshotFetchRequired === undefined && this._baseSnapshot?.groupId !== undefined) {
1120
+ assert(
1121
+ this.blobContents !== undefined,
1122
+ 0x97a /* Blob contents should be present to evaluate */,
1123
+ );
1124
+ assert(
1125
+ this._baseSnapshot !== undefined,
1126
+ 0x97b /* snapshotTree should be present to evaluate */,
1127
+ );
1128
+ this.snapshotFetchRequired = isSnapshotFetchRequiredForLoadingGroupId(
1129
+ this._baseSnapshot,
1130
+ this.blobContents,
1131
+ );
1132
+ }
1096
1133
  if (this.snapshotFetchRequired) {
1097
1134
  assert(
1098
1135
  this.loadingGroupId !== undefined,
@@ -1111,6 +1148,7 @@ export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
1111
1148
 
1112
1149
  if (!!tree && tree.blobs[dataStoreAttributesBlobName] !== undefined) {
1113
1150
  // Need to get through snapshot and use that to populate extraBlobs
1151
+ // eslint-disable-next-line import/no-deprecated
1114
1152
  const attributes = await readAndParse<ReadFluidDataStoreAttributes>(
1115
1153
  this.storage,
1116
1154
  tree.blobs[dataStoreAttributesBlobName],
@@ -1287,6 +1325,7 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
1287
1325
 
1288
1326
  private readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {
1289
1327
  let snapshot = this.snapshotTree;
1328
+ // eslint-disable-next-line import/no-deprecated
1290
1329
  let attributes: ReadFluidDataStoreAttributes;
1291
1330
  let isRootDataStore = false;
1292
1331
  if (snapshot !== undefined) {
@@ -11,9 +11,9 @@ import type {
11
11
  IDeltaQueue,
12
12
  IDeltaSender,
13
13
  ReadOnlyInfo,
14
- } from "@fluidframework/container-definitions";
14
+ } from "@fluidframework/container-definitions/internal";
15
15
  import type { IErrorBase } from "@fluidframework/core-interfaces";
16
- import type { IAnyDriverError } from "@fluidframework/driver-definitions";
16
+ import type { IAnyDriverError } from "@fluidframework/driver-definitions/internal";
17
17
  import {
18
18
  IClientConfiguration,
19
19
  IClientDetails,
@@ -23,6 +23,7 @@ import {
23
23
  } from "@fluidframework/protocol-definitions";
24
24
 
25
25
  import { summarizerClientType } from "./summary/index.js";
26
+ import type { PendingStateManager } from "./pendingStateManager.js";
26
27
 
27
28
  /**
28
29
  * Base class for DeltaManager proxy that proxy's access to the real DeltaManager.
@@ -139,7 +140,10 @@ export abstract class BaseDeltaManagerProxy
139
140
  private readonly onSubmitOp = (message: IDocumentMessage): void => {
140
141
  this.emit("submitOp", message);
141
142
  };
142
- private readonly onOp = (message: ISequencedDocumentMessage, processingTime: number): void => {
143
+ protected readonly onOp = (
144
+ message: ISequencedDocumentMessage,
145
+ processingTime: number,
146
+ ): void => {
143
147
  this.emit("op", message, processingTime);
144
148
  };
145
149
  private readonly onPong = (latency: number): void => {
@@ -194,3 +198,51 @@ export class DeltaManagerSummarizerProxy extends BaseDeltaManagerProxy {
194
198
  this.isSummarizerClient = this.deltaManager.clientDetails.type === summarizerClientType;
195
199
  }
196
200
  }
201
+
202
+ export class DeltaManagerPendingOpsProxy extends BaseDeltaManagerProxy {
203
+ public get minimumSequenceNumber(): number {
204
+ const minPendingSeqNum = this.pendingStateManager.minimumPendingMessageSequenceNumber;
205
+ // There is a chance that minPendingSeqNum is greater than minimum sequence number.
206
+ // minPendingSeqNum is based on the pending ops, so it's based on ref seq number.
207
+ // Imagine an op has just be sent while there's another client that has been lagging behind,
208
+ // it will likely have a ref seq number greater than the minimum seq number.
209
+ if (
210
+ minPendingSeqNum !== undefined &&
211
+ minPendingSeqNum < this.deltaManager.minimumSequenceNumber
212
+ ) {
213
+ return minPendingSeqNum;
214
+ }
215
+ return this.deltaManager.minimumSequenceNumber;
216
+ }
217
+
218
+ public get lastMessage() {
219
+ if (this.deltaManager.lastMessage === undefined) {
220
+ return this.deltaManager.lastMessage;
221
+ }
222
+ return {
223
+ ...this.deltaManager.lastMessage,
224
+ minimumSequenceNumber: this.minimumSequenceNumber,
225
+ };
226
+ }
227
+
228
+ protected readonly onOp = (
229
+ message: ISequencedDocumentMessage,
230
+ processingTime: number,
231
+ ): void => {
232
+ const messageIntercept = {
233
+ ...message,
234
+ minimumSequenceNumber: this.minimumSequenceNumber,
235
+ };
236
+ this.emit("op", messageIntercept, processingTime);
237
+ };
238
+
239
+ constructor(
240
+ protected readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
241
+ private readonly pendingStateManager: Pick<
242
+ PendingStateManager,
243
+ "minimumPendingMessageSequenceNumber"
244
+ >,
245
+ ) {
246
+ super(deltaManager);
247
+ }
248
+ }
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { performance } from "@fluid-internal/client-utils";
7
- import { IDeltaManager } from "@fluidframework/container-definitions";
7
+ import { IDeltaManager } from "@fluidframework/container-definitions/internal";
8
8
  import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
9
9
  import { ITelemetryLoggerExt, formatTick } from "@fluidframework/telemetry-utils/internal";
10
10
 
@@ -88,14 +88,6 @@ for apps to override settings easily, e.g. by backing their `IConfigProviderBase
88
88
  In cases where a behavior is controlled by both a Config Setting and GC Option, you may experiment at first using Config Settings
89
89
  and then later update the passed-in GC Options to finalize the configuration in your code.
90
90
 
91
- ### Disabling Mark Phase
92
-
93
- If you wish to disable Mark Phase for newly-created documents, set the `gcAllowed` GC Option to `false`.
94
- Note that this will disable GC permanently (including the sweep phase) for the container during its lifetime.
95
-
96
- Mark Phase can also be disabled just for the session, among other behaviors,
97
- covered in the [Advanced Configuration](./gcEarlyAdoption.md#more-advanced-configurations) docs.
98
-
99
91
  ### Enabling Sweep Phase
100
92
 
101
93
  To enable the Sweep Phase for new documents, you must set the `enableGCSweep` GC Option to true.
@@ -5,11 +5,12 @@
5
5
 
6
6
  import { IRequest } from "@fluidframework/core-interfaces";
7
7
  import { assert, LazyPromise, Timer } from "@fluidframework/core-utils/internal";
8
- import { IGarbageCollectionData, ITelemetryContext } from "@fluidframework/runtime-definitions";
9
8
  import {
10
9
  IGarbageCollectionDetailsBase,
11
10
  ISummarizeResult,
12
11
  gcTreeKey,
12
+ type IGarbageCollectionData,
13
+ type ITelemetryContext,
13
14
  } from "@fluidframework/runtime-definitions/internal";
14
15
  import { createResponseError, responseToException } from "@fluidframework/runtime-utils/internal";
15
16
  import {
@@ -28,7 +28,7 @@ import {
28
28
  gcTestModeKey,
29
29
  maxSnapshotCacheExpiryMs,
30
30
  oneDayMs,
31
- runGCKey,
31
+ runGCTestKey,
32
32
  runSessionExpiryKey,
33
33
  runSweepKey,
34
34
  throwOnTombstoneLoadOverrideKey,
@@ -54,7 +54,7 @@ export function generateGCConfigs(
54
54
  isSummarizerClient: boolean;
55
55
  },
56
56
  ): IGarbageCollectorConfigs {
57
- let gcEnabled: boolean;
57
+ let gcDisabled: boolean = false;
58
58
  let sessionExpiryTimeoutMs: number | undefined;
59
59
  let tombstoneTimeoutMs: number | undefined;
60
60
  let persistedGcFeatureMatrix: GCFeatureMatrix | undefined;
@@ -70,9 +70,9 @@ export function generateGCConfigs(
70
70
  if (createParams.existing) {
71
71
  const metadata = createParams.metadata;
72
72
  gcVersionInBaseSnapshot = getGCVersion(metadata);
73
- // Existing documents which did not have metadata blob or had GC disabled have version as 0. For all
74
- // other existing documents, GC is enabled.
75
- gcEnabled = gcVersionInBaseSnapshot > 0;
73
+ // Existing documents which did not have metadata blob or had GC disabled have GC version as 0. GC will be
74
+ // disabled for these documents.
75
+ gcDisabled = gcVersionInBaseSnapshot === 0;
76
76
  sessionExpiryTimeoutMs = metadata?.sessionExpiryTimeoutMs;
77
77
  const legacyPersistedSweepTimeoutMs = (metadata as IGCMetadata_Deprecated)?.sweepTimeoutMs;
78
78
  tombstoneTimeoutMs =
@@ -86,12 +86,8 @@ export function generateGCConfigs(
86
86
  "Fluid.GarbageCollection.TestOverride.TombstoneTimeoutMs",
87
87
  );
88
88
 
89
- // For new documents, GC is enabled by default. It can be explicitly disabled by setting the gcAllowed
90
- // flag in GC options to false.
91
- gcEnabled = createParams.gcOptions.gcAllowed !== false;
92
-
93
- // Set the Session Expiry if GC is enabled and session expiry flag isn't explicitly set to false.
94
- if (gcEnabled && mc.config.getBoolean(runSessionExpiryKey) !== false) {
89
+ // Set the Session Expiry if session expiry flag isn't explicitly set to false.
90
+ if (mc.config.getBoolean(runSessionExpiryKey) !== false) {
95
91
  sessionExpiryTimeoutMs =
96
92
  createParams.gcOptions.sessionExpiryTimeoutMs ?? defaultSessionExpiryDurationMs;
97
93
  }
@@ -122,15 +118,12 @@ export function generateGCConfigs(
122
118
 
123
119
  /**
124
120
  * Whether GC should run or not. The following conditions have to be met to run sweep:
125
- * 1. GC should be enabled for this container.
126
- * 2. GC should not be disabled via disableGC GC option.
127
- * 3. The current GC version should be greater or equal to the GC version in the base snapshot.
121
+ * 1. GC should not be disabled for this container.
122
+ * 2. The current GC version should be greater or equal to the GC version in the base snapshot.
128
123
  *
129
- * These conditions can be overridden via the RunGC feature flag.
124
+ * These conditions can be overridden via the RunGC feature flag for testing.
130
125
  */
131
- const shouldRunGC =
132
- mc.config.getBoolean(runGCKey) ??
133
- (gcEnabled && !createParams.gcOptions.disableGC && isGCVersionUpToDate);
126
+ const shouldRunGC = mc.config.getBoolean(runGCTestKey) ?? (!gcDisabled && isGCVersionUpToDate);
134
127
 
135
128
  /**
136
129
  * Whether sweep should run or not. This refers to whether Tombstones should fail on load and whether
@@ -195,7 +188,7 @@ export function generateGCConfigs(
195
188
  !createParams.isSummarizerClient;
196
189
 
197
190
  return {
198
- gcEnabled, // For this document
191
+ gcEnabled: !gcDisabled, // For this document
199
192
  sweepEnabled: sweepAllowed, // For this document (based on current GC Generation option)
200
193
  shouldRunGC, // For this session
201
194
  shouldRunSweep, // For this session
@@ -6,8 +6,9 @@
6
6
  import { ICriticalContainerError } from "@fluidframework/container-definitions";
7
7
  import { IRequest } from "@fluidframework/core-interfaces";
8
8
  import { ISnapshotTree } from "@fluidframework/protocol-definitions";
9
- import { IGarbageCollectionData, ITelemetryContext } from "@fluidframework/runtime-definitions";
10
9
  import {
10
+ ITelemetryContext,
11
+ IGarbageCollectionData,
11
12
  IGarbageCollectionDetailsBase,
12
13
  ISummarizeResult,
13
14
  } from "@fluidframework/runtime-definitions/internal";
@@ -59,8 +60,6 @@ export const gcDisableDataStoreSweepOptionName = "disableDataStoreSweep";
59
60
  */
60
61
  export const gcGenerationOptionName = "gcGeneration";
61
62
 
62
- /** Config key to turn GC on / off. */
63
- export const runGCKey = "Fluid.GarbageCollection.RunGC";
64
63
  /** Config key to turn GC sweep on / off. */
65
64
  export const runSweepKey = "Fluid.GarbageCollection.RunSweep";
66
65
  /** Config key to turn GC test mode on / off. */
@@ -82,6 +81,8 @@ export const disableDatastoreSweepKey = "Fluid.GarbageCollection.DisableDataStor
82
81
  export const detectOutboundRoutesViaDDSKey = "Fluid.GarbageCollection.DetectOutboundRoutesViaDDS";
83
82
  /** Config key to disable auto-recovery mechanism that protects Tombstones that are loaded from being swept (use true) */
84
83
  export const disableAutoRecoveryKey = "Fluid.GarbageCollection.DisableAutoRecovery";
84
+ /** Config key to turn GC on / off for testing. */
85
+ export const runGCTestKey = "Fluid.GarbageCollection.Test.RunGC";
85
86
 
86
87
  // One day in milliseconds.
87
88
  export const oneDayMs = 1 * 24 * 60 * 60 * 1000;
@@ -421,24 +422,6 @@ export interface IGarbageCollectorCreateParams {
421
422
  * @alpha
422
423
  */
423
424
  export interface IGCRuntimeOptions {
424
- /**
425
- * Flag that if true, will enable running garbage collection (GC) for a new container.
426
- *
427
- * GC has mark phase and sweep phase. In mark phase, unreferenced objects are identified
428
- * and marked as such in the summary. This option enables the mark phase.
429
- * In sweep phase, unreferenced objects are eventually deleted from the container if they meet certain conditions.
430
- * Sweep phase can be enabled using the "enableGCSweep" option.
431
- *
432
- * Note: This setting is persisted in the container's summary and cannot be changed.
433
- */
434
- gcAllowed?: boolean;
435
-
436
- /**
437
- * Flag that if true, will disable garbage collection for the session.
438
- * Can be used to disable running GC on containers where it is allowed via the gcAllowed option.
439
- */
440
- disableGC?: boolean;
441
-
442
425
  /**
443
426
  * Flag that if true, will enable the full Sweep Phase of garbage collection for this session,
444
427
  * where Tombstoned objects are permanently deleted from the container.
@@ -481,8 +464,7 @@ export interface IGCRuntimeOptions {
481
464
  */
482
465
  export interface IGarbageCollectorConfigs {
483
466
  /**
484
- * Tracks if GC is enabled for this document. This is specified during document creation and doesn't change
485
- * throughout its lifetime.
467
+ * Tracks if GC is enabled for this document. GC may not be enabled for old documents created pre-GC.
486
468
  */
487
469
  readonly gcEnabled: boolean;
488
470
  /**
@@ -5,12 +5,12 @@
5
5
 
6
6
  import { assert } from "@fluidframework/core-utils/internal";
7
7
  import { ISnapshotTree } from "@fluidframework/protocol-definitions";
8
- import { IGarbageCollectionData } from "@fluidframework/runtime-definitions";
9
8
  import {
10
9
  IGarbageCollectionDetailsBase,
11
10
  gcBlobPrefix,
12
11
  gcDeletedBlobKey,
13
12
  gcTombstoneBlobKey,
13
+ IGarbageCollectionData,
14
14
  } from "@fluidframework/runtime-definitions/internal";
15
15
  import type { IConfigProvider } from "@fluidframework/telemetry-utils/internal";
16
16
 
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { IGarbageCollectionData } from "@fluidframework/runtime-definitions";
6
+ import { IGarbageCollectionData } from "@fluidframework/runtime-definitions/internal";
7
7
 
8
8
  /**
9
9
  * The garbage collection data of each node in the reference graph. Each node's GC data is written in the summary
@@ -4,8 +4,8 @@
4
4
  */
5
5
 
6
6
  import { SummaryType } from "@fluidframework/protocol-definitions";
7
- import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
8
7
  import {
8
+ ISummaryTreeWithStats,
9
9
  ISummarizeResult,
10
10
  gcBlobPrefix,
11
11
  gcDeletedBlobKey,
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { IGarbageCollectionData } from "@fluidframework/runtime-definitions";
6
+ import { IGarbageCollectionData } from "@fluidframework/runtime-definitions/internal";
7
7
  import {
8
8
  ITelemetryLoggerExt,
9
9
  MonitoringContext,
package/src/gc/index.ts CHANGED
@@ -30,7 +30,7 @@ export {
30
30
  ISweepPhaseStats,
31
31
  IGCStats,
32
32
  oneDayMs,
33
- runGCKey,
33
+ runGCTestKey,
34
34
  runSessionExpiryKey,
35
35
  runSweepKey,
36
36
  stableGCVersion,
package/src/index.ts CHANGED
@@ -97,7 +97,7 @@ export {
97
97
  ICancellableSummarizerController,
98
98
  SubmitSummaryFailureData,
99
99
  SummaryStage,
100
- IRetriableFailureResult,
100
+ IRetriableFailureError,
101
101
  ISummarizeEventProps,
102
102
  IdCompressorMode,
103
103
  IDocumentSchema,
@@ -107,6 +107,11 @@ export {
107
107
  DocumentsSchemaController,
108
108
  IDocumentSchemaChangeMessage,
109
109
  IDocumentSchemaFeatures,
110
+ ReadFluidDataStoreAttributes,
111
+ IFluidDataStoreAttributes0,
112
+ IFluidDataStoreAttributes1,
113
+ IFluidDataStoreAttributes2,
114
+ OmitAttributesVersions,
110
115
  } from "./summary/index.js";
111
116
  export { IChunkedOp, unpackRuntimeMessage } from "./opLifecycle/index.js";
112
117
  export { ChannelCollection } from "./channelCollection.js";
@@ -175,11 +175,13 @@ export type InboundContainerRuntimeMessage =
175
175
  | UnknownContainerRuntimeMessage
176
176
  | ContainerRuntimeDocumentSchemaMessage;
177
177
 
178
- /** A {@link TypedContainerRuntimeMessage} that has been generated by the container runtime but is not yet being sent to the server. */
178
+ /**
179
+ * A {@link TypedContainerRuntimeMessage} that has been generated by the container runtime but is not yet being sent to the server.
180
+ * These are messages generated by the local runtime, before the outbox's op virtualization step.
181
+ */
179
182
  export type LocalContainerRuntimeMessage =
180
183
  | ContainerRuntimeDataStoreOpMessage
181
184
  | OutboundContainerRuntimeAttachMessage
182
- | ContainerRuntimeChunkedOpMessage
183
185
  | ContainerRuntimeBlobAttachMessage
184
186
  | ContainerRuntimeRejoinMessage
185
187
  | ContainerRuntimeAliasMessage
@@ -10,6 +10,11 @@ import { BatchMessage, IBatch, IBatchCheckpoint } from "./definitions.js";
10
10
  export interface IBatchManagerOptions {
11
11
  readonly hardLimit: number;
12
12
  readonly compressionOptions?: ICompressionRuntimeOptions;
13
+
14
+ /**
15
+ * If true, the outbox is allowed to rebase the batch during flushing.
16
+ */
17
+ readonly canRebase: boolean;
13
18
  }
14
19
 
15
20
  export interface BatchSequenceNumbers {
@@ -112,9 +112,9 @@ export class Outbox {
112
112
  // We need to allow infinite size batches if we enable compression
113
113
  const hardLimit = isCompressionEnabled ? Infinity : this.params.config.maxBatchSizeInBytes;
114
114
 
115
- this.mainBatch = new BatchManager({ hardLimit });
116
- this.blobAttachBatch = new BatchManager({ hardLimit });
117
- this.idAllocationBatch = new BatchManager({ hardLimit });
115
+ this.mainBatch = new BatchManager({ hardLimit, canRebase: true });
116
+ this.blobAttachBatch = new BatchManager({ hardLimit, canRebase: true });
117
+ this.idAllocationBatch = new BatchManager({ hardLimit, canRebase: false });
118
118
  }
119
119
 
120
120
  public get messageCount(): number {
@@ -201,32 +201,7 @@ export class Outbox {
201
201
  public submitIdAllocation(message: BatchMessage) {
202
202
  this.maybeFlushPartialBatch();
203
203
 
204
- if (
205
- !this.idAllocationBatch.push(
206
- message,
207
- this.isContextReentrant(),
208
- this.params.getCurrentSequenceNumbers().clientSequenceNumber,
209
- )
210
- ) {
211
- // BatchManager has two limits - soft limit & hard limit. Soft limit is only engaged
212
- // when queue is not empty.
213
- // Flush queue & retry. Failure on retry would mean - single message is bigger than hard limit
214
- this.flushInternal(this.idAllocationBatch);
215
-
216
- this.addMessageToBatchManager(this.idAllocationBatch, message);
217
- }
218
-
219
- // If compression is enabled, we will always successfully receive
220
- // attach ops and compress then send them at the next JS turn, regardless
221
- // of the overall size of the accumulated ops in the batch.
222
- // However, it is more efficient to flush these ops faster, preferably
223
- // after they reach a size which would benefit from compression.
224
- if (
225
- this.idAllocationBatch.contentSizeInBytes >=
226
- this.params.config.compressionOptions.minimumBatchSizeInBytes
227
- ) {
228
- this.flushInternal(this.idAllocationBatch);
229
- }
204
+ this.addMessageToBatchManager(this.idAllocationBatch, message);
230
205
  }
231
206
 
232
207
  private addMessageToBatchManager(batchManager: BatchManager, message: BatchMessage) {
@@ -270,7 +245,7 @@ export class Outbox {
270
245
  const rawBatch = batchManager.popBatch();
271
246
  const shouldGroup =
272
247
  !disableGroupedBatching && this.params.groupingManager.shouldGroup(rawBatch);
273
- if (rawBatch.hasReentrantOps === true && shouldGroup) {
248
+ if (batchManager.options.canRebase && rawBatch.hasReentrantOps === true && shouldGroup) {
274
249
  assert(!this.rebasing, 0x6fa /* A rebased batch should never have reentrant ops */);
275
250
  // If a batch contains reentrant ops (ops created as a result from processing another op)
276
251
  // it needs to be rebased so that we can ensure consistent reference sequence numbers
@@ -300,6 +275,7 @@ export class Outbox {
300
275
  */
301
276
  private rebase(rawBatch: IBatch, batchManager: BatchManager) {
302
277
  assert(!this.rebasing, 0x6fb /* Reentrancy */);
278
+ assert(batchManager.options.canRebase, "BatchManager does not support rebase");
303
279
 
304
280
  this.rebasing = true;
305
281
  for (const message of rawBatch.content) {
@@ -433,6 +409,7 @@ export class Outbox {
433
409
  const mainBatch: IBatchCheckpoint = this.mainBatch.checkpoint();
434
410
  return {
435
411
  mainBatch,
412
+ idAllocationBatch: this.idAllocationBatch.checkpoint(),
436
413
  blobAttachBatch: this.blobAttachBatch.checkpoint(),
437
414
  };
438
415
  }
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-runtime";
9
- export const pkgVersion = "2.0.0-dev-rc.4.0.0.261659";
9
+ export const pkgVersion = "2.0.0-dev-rc.5.0.0.265721";