@fluidframework/container-runtime 2.0.0-dev.7.4.0.217212 → 2.0.0-dev.7.4.0.221926

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 (233) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/api-extractor.json +0 -3
  3. package/api-report/container-runtime.api.md +77 -73
  4. package/dist/blobManager.d.ts +4 -4
  5. package/dist/blobManager.d.ts.map +1 -1
  6. package/dist/blobManager.js.map +1 -1
  7. package/dist/container-runtime-alpha.d.ts +1361 -132
  8. package/dist/container-runtime-beta.d.ts +40 -2
  9. package/dist/container-runtime-public.d.ts +40 -2
  10. package/dist/container-runtime-untrimmed.d.ts +106 -93
  11. package/dist/containerRuntime.d.ts +19 -17
  12. package/dist/containerRuntime.d.ts.map +1 -1
  13. package/dist/containerRuntime.js +44 -24
  14. package/dist/containerRuntime.js.map +1 -1
  15. package/dist/dataStores.d.ts +10 -15
  16. package/dist/dataStores.d.ts.map +1 -1
  17. package/dist/dataStores.js +63 -36
  18. package/dist/dataStores.js.map +1 -1
  19. package/dist/gc/garbageCollection.d.ts +29 -10
  20. package/dist/gc/garbageCollection.d.ts.map +1 -1
  21. package/dist/gc/garbageCollection.js +149 -67
  22. package/dist/gc/garbageCollection.js.map +1 -1
  23. package/dist/gc/gcConfigs.d.ts.map +1 -1
  24. package/dist/gc/gcConfigs.js +34 -37
  25. package/dist/gc/gcConfigs.js.map +1 -1
  26. package/dist/gc/gcDefinitions.d.ts +97 -44
  27. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  28. package/dist/gc/gcDefinitions.js +26 -16
  29. package/dist/gc/gcDefinitions.js.map +1 -1
  30. package/dist/gc/gcHelpers.d.ts +18 -25
  31. package/dist/gc/gcHelpers.d.ts.map +1 -1
  32. package/dist/gc/gcHelpers.js +29 -45
  33. package/dist/gc/gcHelpers.js.map +1 -1
  34. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  35. package/dist/gc/gcTelemetry.js +14 -3
  36. package/dist/gc/gcTelemetry.js.map +1 -1
  37. package/dist/gc/gcUnreferencedStateTracker.d.ts +11 -5
  38. package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  39. package/dist/gc/gcUnreferencedStateTracker.js +43 -19
  40. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  41. package/dist/gc/index.d.ts +1 -1
  42. package/dist/gc/index.d.ts.map +1 -1
  43. package/dist/gc/index.js +4 -4
  44. package/dist/gc/index.js.map +1 -1
  45. package/dist/index.d.ts +13 -1
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +16 -5
  48. package/dist/index.js.map +1 -1
  49. package/dist/messageTypes.d.ts +13 -5
  50. package/dist/messageTypes.d.ts.map +1 -1
  51. package/dist/messageTypes.js +5 -0
  52. package/dist/messageTypes.js.map +1 -1
  53. package/dist/packageVersion.d.ts +1 -1
  54. package/dist/packageVersion.js +1 -1
  55. package/dist/packageVersion.js.map +1 -1
  56. package/dist/pendingStateManager.d.ts +1 -0
  57. package/dist/pendingStateManager.d.ts.map +1 -1
  58. package/dist/pendingStateManager.js +1 -0
  59. package/dist/pendingStateManager.js.map +1 -1
  60. package/dist/summary/orderedClientElection.d.ts +1 -1
  61. package/dist/summary/orderedClientElection.js.map +1 -1
  62. package/dist/summary/summarizerTypes.d.ts +28 -28
  63. package/dist/summary/summarizerTypes.js.map +1 -1
  64. package/dist/summary/summaryCollection.d.ts +3 -3
  65. package/dist/summary/summaryCollection.js.map +1 -1
  66. package/dist/summary/summaryFormat.d.ts +3 -3
  67. package/dist/summary/summaryFormat.js.map +1 -1
  68. package/lib/blobManager.d.ts +4 -4
  69. package/lib/blobManager.d.ts.map +1 -1
  70. package/lib/blobManager.js.map +1 -1
  71. package/lib/container-runtime-alpha.d.ts +1361 -132
  72. package/lib/container-runtime-beta.d.ts +40 -2
  73. package/lib/container-runtime-public.d.ts +40 -2
  74. package/lib/container-runtime-untrimmed.d.ts +106 -93
  75. package/lib/containerRuntime.d.ts +19 -17
  76. package/lib/containerRuntime.d.ts.map +1 -1
  77. package/lib/containerRuntime.js +46 -26
  78. package/lib/containerRuntime.js.map +1 -1
  79. package/lib/dataStores.d.ts +10 -15
  80. package/lib/dataStores.d.ts.map +1 -1
  81. package/lib/dataStores.js +65 -38
  82. package/lib/dataStores.js.map +1 -1
  83. package/lib/gc/garbageCollection.d.ts +29 -10
  84. package/lib/gc/garbageCollection.d.ts.map +1 -1
  85. package/lib/gc/garbageCollection.js +151 -69
  86. package/lib/gc/garbageCollection.js.map +1 -1
  87. package/lib/gc/gcConfigs.d.ts.map +1 -1
  88. package/lib/gc/gcConfigs.js +37 -40
  89. package/lib/gc/gcConfigs.js.map +1 -1
  90. package/lib/gc/gcDefinitions.d.ts +97 -44
  91. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  92. package/lib/gc/gcDefinitions.js +25 -15
  93. package/lib/gc/gcDefinitions.js.map +1 -1
  94. package/lib/gc/gcHelpers.d.ts +18 -25
  95. package/lib/gc/gcHelpers.d.ts.map +1 -1
  96. package/lib/gc/gcHelpers.js +27 -43
  97. package/lib/gc/gcHelpers.js.map +1 -1
  98. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  99. package/lib/gc/gcTelemetry.js +14 -3
  100. package/lib/gc/gcTelemetry.js.map +1 -1
  101. package/lib/gc/gcUnreferencedStateTracker.d.ts +11 -5
  102. package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  103. package/lib/gc/gcUnreferencedStateTracker.js +43 -19
  104. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  105. package/lib/gc/index.d.ts +1 -1
  106. package/lib/gc/index.d.ts.map +1 -1
  107. package/lib/gc/index.js +1 -1
  108. package/lib/gc/index.js.map +1 -1
  109. package/lib/index.d.ts +13 -1
  110. package/lib/index.d.ts.map +1 -1
  111. package/lib/index.js +15 -1
  112. package/lib/index.js.map +1 -1
  113. package/lib/messageTypes.d.ts +13 -5
  114. package/lib/messageTypes.d.ts.map +1 -1
  115. package/lib/messageTypes.js +5 -0
  116. package/lib/messageTypes.js.map +1 -1
  117. package/lib/packageVersion.d.ts +1 -1
  118. package/lib/packageVersion.js +1 -1
  119. package/lib/packageVersion.js.map +1 -1
  120. package/lib/pendingStateManager.d.ts +1 -0
  121. package/lib/pendingStateManager.d.ts.map +1 -1
  122. package/lib/pendingStateManager.js +1 -0
  123. package/lib/pendingStateManager.js.map +1 -1
  124. package/lib/summary/orderedClientElection.d.ts +1 -1
  125. package/lib/summary/orderedClientElection.js.map +1 -1
  126. package/lib/summary/summarizerTypes.d.ts +28 -28
  127. package/lib/summary/summarizerTypes.js.map +1 -1
  128. package/lib/summary/summaryCollection.d.ts +3 -3
  129. package/lib/summary/summaryCollection.js.map +1 -1
  130. package/lib/summary/summaryFormat.d.ts +3 -3
  131. package/lib/summary/summaryFormat.js.map +1 -1
  132. package/package.json +18 -15
  133. package/src/blobManager.ts +5 -5
  134. package/src/containerRuntime.ts +66 -40
  135. package/src/dataStores.ts +118 -59
  136. package/src/gc/garbageCollection.md +14 -15
  137. package/src/gc/garbageCollection.ts +182 -75
  138. package/src/gc/gcConfigs.ts +50 -52
  139. package/src/gc/gcDefinitions.ts +112 -50
  140. package/src/gc/gcHelpers.ts +31 -52
  141. package/src/gc/gcTelemetry.ts +16 -4
  142. package/src/gc/gcUnreferencedStateTracker.ts +61 -22
  143. package/src/gc/index.ts +4 -3
  144. package/src/index.ts +17 -1
  145. package/src/messageTypes.ts +16 -2
  146. package/src/packageVersion.ts +1 -1
  147. package/src/pendingStateManager.ts +1 -0
  148. package/src/summary/orderedClientElection.ts +1 -1
  149. package/src/summary/summarizerTypes.ts +28 -28
  150. package/src/summary/summaryCollection.ts +3 -3
  151. package/src/summary/summaryFormat.ts +3 -3
  152. package/dist/id-compressor/appendOnlySortedMap.d.ts +0 -124
  153. package/dist/id-compressor/appendOnlySortedMap.d.ts.map +0 -1
  154. package/dist/id-compressor/appendOnlySortedMap.js +0 -318
  155. package/dist/id-compressor/appendOnlySortedMap.js.map +0 -1
  156. package/dist/id-compressor/finalSpace.d.ts +0 -29
  157. package/dist/id-compressor/finalSpace.d.ts.map +0 -1
  158. package/dist/id-compressor/finalSpace.js +0 -62
  159. package/dist/id-compressor/finalSpace.js.map +0 -1
  160. package/dist/id-compressor/idCompressor.d.ts +0 -54
  161. package/dist/id-compressor/idCompressor.d.ts.map +0 -1
  162. package/dist/id-compressor/idCompressor.js +0 -495
  163. package/dist/id-compressor/idCompressor.js.map +0 -1
  164. package/dist/id-compressor/identifiers.d.ts +0 -32
  165. package/dist/id-compressor/identifiers.d.ts.map +0 -1
  166. package/dist/id-compressor/identifiers.js +0 -15
  167. package/dist/id-compressor/identifiers.js.map +0 -1
  168. package/dist/id-compressor/index.d.ts +0 -13
  169. package/dist/id-compressor/index.d.ts.map +0 -1
  170. package/dist/id-compressor/index.js +0 -32
  171. package/dist/id-compressor/index.js.map +0 -1
  172. package/dist/id-compressor/persistanceUtilities.d.ts +0 -22
  173. package/dist/id-compressor/persistanceUtilities.d.ts.map +0 -1
  174. package/dist/id-compressor/persistanceUtilities.js +0 -43
  175. package/dist/id-compressor/persistanceUtilities.js.map +0 -1
  176. package/dist/id-compressor/sessionSpaceNormalizer.d.ts +0 -46
  177. package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +0 -1
  178. package/dist/id-compressor/sessionSpaceNormalizer.js +0 -80
  179. package/dist/id-compressor/sessionSpaceNormalizer.js.map +0 -1
  180. package/dist/id-compressor/sessions.d.ts +0 -115
  181. package/dist/id-compressor/sessions.d.ts.map +0 -1
  182. package/dist/id-compressor/sessions.js +0 -305
  183. package/dist/id-compressor/sessions.js.map +0 -1
  184. package/dist/id-compressor/utilities.d.ts +0 -52
  185. package/dist/id-compressor/utilities.d.ts.map +0 -1
  186. package/dist/id-compressor/utilities.js +0 -169
  187. package/dist/id-compressor/utilities.js.map +0 -1
  188. package/lib/id-compressor/appendOnlySortedMap.d.ts +0 -124
  189. package/lib/id-compressor/appendOnlySortedMap.d.ts.map +0 -1
  190. package/lib/id-compressor/appendOnlySortedMap.js +0 -314
  191. package/lib/id-compressor/appendOnlySortedMap.js.map +0 -1
  192. package/lib/id-compressor/finalSpace.d.ts +0 -29
  193. package/lib/id-compressor/finalSpace.d.ts.map +0 -1
  194. package/lib/id-compressor/finalSpace.js +0 -58
  195. package/lib/id-compressor/finalSpace.js.map +0 -1
  196. package/lib/id-compressor/idCompressor.d.ts +0 -54
  197. package/lib/id-compressor/idCompressor.d.ts.map +0 -1
  198. package/lib/id-compressor/idCompressor.js +0 -491
  199. package/lib/id-compressor/idCompressor.js.map +0 -1
  200. package/lib/id-compressor/identifiers.d.ts +0 -32
  201. package/lib/id-compressor/identifiers.d.ts.map +0 -1
  202. package/lib/id-compressor/identifiers.js +0 -11
  203. package/lib/id-compressor/identifiers.js.map +0 -1
  204. package/lib/id-compressor/index.d.ts +0 -13
  205. package/lib/id-compressor/index.d.ts.map +0 -1
  206. package/lib/id-compressor/index.js +0 -13
  207. package/lib/id-compressor/index.js.map +0 -1
  208. package/lib/id-compressor/persistanceUtilities.d.ts +0 -22
  209. package/lib/id-compressor/persistanceUtilities.d.ts.map +0 -1
  210. package/lib/id-compressor/persistanceUtilities.js +0 -34
  211. package/lib/id-compressor/persistanceUtilities.js.map +0 -1
  212. package/lib/id-compressor/sessionSpaceNormalizer.d.ts +0 -46
  213. package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +0 -1
  214. package/lib/id-compressor/sessionSpaceNormalizer.js +0 -76
  215. package/lib/id-compressor/sessionSpaceNormalizer.js.map +0 -1
  216. package/lib/id-compressor/sessions.d.ts +0 -115
  217. package/lib/id-compressor/sessions.d.ts.map +0 -1
  218. package/lib/id-compressor/sessions.js +0 -290
  219. package/lib/id-compressor/sessions.js.map +0 -1
  220. package/lib/id-compressor/utilities.d.ts +0 -52
  221. package/lib/id-compressor/utilities.d.ts.map +0 -1
  222. package/lib/id-compressor/utilities.js +0 -151
  223. package/lib/id-compressor/utilities.js.map +0 -1
  224. package/src/id-compressor/README.md +0 -69
  225. package/src/id-compressor/appendOnlySortedMap.ts +0 -366
  226. package/src/id-compressor/finalSpace.ts +0 -67
  227. package/src/id-compressor/idCompressor.ts +0 -630
  228. package/src/id-compressor/identifiers.ts +0 -42
  229. package/src/id-compressor/index.ts +0 -26
  230. package/src/id-compressor/persistanceUtilities.ts +0 -58
  231. package/src/id-compressor/sessionSpaceNormalizer.ts +0 -83
  232. package/src/id-compressor/sessions.ts +0 -405
  233. package/src/id-compressor/utilities.ts +0 -190
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-runtime",
3
- "version": "2.0.0-dev.7.4.0.217212",
3
+ "version": "2.0.0-dev.7.4.0.221926",
4
4
  "description": "Fluid container runtime",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -35,18 +35,19 @@
35
35
  "temp-directory": "nyc/.nyc_output"
36
36
  },
37
37
  "dependencies": {
38
- "@fluid-internal/client-utils": "2.0.0-dev.7.4.0.217212",
39
- "@fluidframework/container-definitions": "2.0.0-dev.7.4.0.217212",
40
- "@fluidframework/container-runtime-definitions": "2.0.0-dev.7.4.0.217212",
41
- "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.217212",
42
- "@fluidframework/core-utils": "2.0.0-dev.7.4.0.217212",
43
- "@fluidframework/datastore": "2.0.0-dev.7.4.0.217212",
44
- "@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.217212",
45
- "@fluidframework/driver-utils": "2.0.0-dev.7.4.0.217212",
38
+ "@fluid-internal/client-utils": "2.0.0-dev.7.4.0.221926",
39
+ "@fluidframework/container-definitions": "2.0.0-dev.7.4.0.221926",
40
+ "@fluidframework/container-runtime-definitions": "2.0.0-dev.7.4.0.221926",
41
+ "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.221926",
42
+ "@fluidframework/core-utils": "2.0.0-dev.7.4.0.221926",
43
+ "@fluidframework/datastore": "2.0.0-dev.7.4.0.221926",
44
+ "@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.221926",
45
+ "@fluidframework/driver-utils": "2.0.0-dev.7.4.0.221926",
46
+ "@fluidframework/id-compressor": "2.0.0-dev.7.4.0.221926",
46
47
  "@fluidframework/protocol-definitions": "^3.0.0",
47
- "@fluidframework/runtime-definitions": "2.0.0-dev.7.4.0.217212",
48
- "@fluidframework/runtime-utils": "2.0.0-dev.7.4.0.217212",
49
- "@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.217212",
48
+ "@fluidframework/runtime-definitions": "2.0.0-dev.7.4.0.221926",
49
+ "@fluidframework/runtime-utils": "2.0.0-dev.7.4.0.221926",
50
+ "@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.221926",
50
51
  "double-ended-queue": "^2.1.0-0",
51
52
  "events": "^3.1.0",
52
53
  "lz4js": "^0.2.0",
@@ -54,15 +55,16 @@
54
55
  "uuid": "^9.0.0"
55
56
  },
56
57
  "devDependencies": {
57
- "@fluid-private/stochastic-test-utils": "2.0.0-dev.7.4.0.217212",
58
+ "@arethetypeswrong/cli": "^0.13.3",
59
+ "@fluid-private/stochastic-test-utils": "2.0.0-dev.7.4.0.221926",
58
60
  "@fluid-tools/benchmark": "^0.48.0",
59
61
  "@fluid-tools/build-cli": "^0.28.0",
60
62
  "@fluidframework/build-common": "^2.0.3",
61
63
  "@fluidframework/build-tools": "^0.28.0",
62
64
  "@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@2.0.0-internal.7.2.0",
63
65
  "@fluidframework/eslint-config-fluid": "^3.1.0",
64
- "@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.217212",
65
- "@fluidframework/test-runtime-utils": "2.0.0-dev.7.4.0.217212",
66
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.221926",
67
+ "@fluidframework/test-runtime-utils": "2.0.0-dev.7.4.0.221926",
66
68
  "@microsoft/api-extractor": "^7.38.3",
67
69
  "@types/double-ended-queue": "^2.1.0",
68
70
  "@types/events": "^3.0.0",
@@ -115,6 +117,7 @@
115
117
  "build:esnext": "tsc --project ./tsconfig.esnext.json",
116
118
  "build:genver": "gen-version",
117
119
  "build:test": "tsc --project ./src/test/tsconfig.json",
120
+ "check:are-the-types-wrong": "attw --pack",
118
121
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
119
122
  "ci:build:docs": "api-extractor run",
120
123
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
@@ -85,7 +85,7 @@ export class BlobHandle implements IFluidHandle<ArrayBufferLike> {
85
85
 
86
86
  /**
87
87
  * Information from a snapshot needed to load BlobManager
88
- * @internal
88
+ * @alpha
89
89
  */
90
90
  export interface IBlobManagerLoadInfo {
91
91
  ids?: string[];
@@ -729,7 +729,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
729
729
  * This is called to update blobs whose routes are unused. The unused blobs are deleted.
730
730
  * @param unusedRoutes - The routes of the blob nodes that are unused. These routes will be based off of local ids.
731
731
  */
732
- public updateUnusedRoutes(unusedRoutes: string[]): void {
732
+ public updateUnusedRoutes(unusedRoutes: readonly string[]): void {
733
733
  this.deleteBlobsFromRedirectTable(unusedRoutes);
734
734
  }
735
735
 
@@ -739,7 +739,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
739
739
  * be based off of local ids.
740
740
  * @returns The routes of blobs that were deleted.
741
741
  */
742
- public deleteSweepReadyNodes(sweepReadyBlobRoutes: string[]): string[] {
742
+ public deleteSweepReadyNodes(sweepReadyBlobRoutes: readonly string[]): readonly string[] {
743
743
  // If sweep for attachment blobs is not enabled, return empty list indicating nothing is deleted.
744
744
  if (this.mc.config.getBoolean(disableAttachmentBlobSweepKey) === true) {
745
745
  return [];
@@ -760,7 +760,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
760
760
  * Note that this does not delete the blobs from storage service immediately. Deleting the blobs from redirect table
761
761
  * will remove them the next summary. The service would them delete them some time in the future.
762
762
  */
763
- private deleteBlobsFromRedirectTable(blobRoutes: string[]) {
763
+ private deleteBlobsFromRedirectTable(blobRoutes: readonly string[]) {
764
764
  if (blobRoutes.length === 0) {
765
765
  return;
766
766
  }
@@ -805,7 +805,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
805
805
  * accessing deleted content without actually deleting content from summaries.
806
806
  * @param tombstonedRoutes - The routes of blob nodes that are tombstones.
807
807
  */
808
- public updateTombstonedRoutes(tombstonedRoutes: string[]) {
808
+ public updateTombstonedRoutes(tombstonedRoutes: readonly string[]) {
809
809
  const tombstonedBlobsSet: Set<string> = new Set();
810
810
  // The routes or blob node paths are in the same format as returned in getGCData -
811
811
  // `/<BlobManager.basePath>/<blobId>`.
@@ -47,6 +47,7 @@ import {
47
47
  wrapError,
48
48
  ITelemetryLoggerExt,
49
49
  UsageError,
50
+ LoggingError,
50
51
  } from "@fluidframework/telemetry-utils";
51
52
  import {
52
53
  DriverHeader,
@@ -87,12 +88,14 @@ import {
87
88
  channelsTreeName,
88
89
  IDataStore,
89
90
  ITelemetryContext,
91
+ } from "@fluidframework/runtime-definitions";
92
+ import type {
90
93
  SerializedIdCompressorWithNoSession,
91
94
  IIdCompressor,
92
95
  IIdCompressorCore,
93
96
  IdCreationRange,
94
97
  SerializedIdCompressorWithOngoingSession,
95
- } from "@fluidframework/runtime-definitions";
98
+ } from "@fluidframework/id-compressor";
96
99
  import {
97
100
  addBlobToSummary,
98
101
  addSummarizeResultToSummary,
@@ -163,7 +166,7 @@ import { formExponentialFn, Throttler } from "./throttler";
163
166
  import {
164
167
  GarbageCollector,
165
168
  GCNodeType,
166
- gcTombstoneGenerationOptionName,
169
+ gcGenerationOptionName,
167
170
  IGarbageCollector,
168
171
  IGCRuntimeOptions,
169
172
  IGCStats,
@@ -194,6 +197,7 @@ import {
194
197
  type LocalContainerRuntimeMessage,
195
198
  type OutboundContainerRuntimeMessage,
196
199
  type UnknownContainerRuntimeMessage,
200
+ ContainerRuntimeGCMessage,
197
201
  } from "./messageTypes";
198
202
 
199
203
  /**
@@ -213,7 +217,7 @@ function compatBehaviorAllowsMessageType(
213
217
  }
214
218
 
215
219
  /**
216
- * @internal
220
+ * @alpha
217
221
  */
218
222
  export interface ISummaryBaseConfiguration {
219
223
  /**
@@ -235,7 +239,7 @@ export interface ISummaryBaseConfiguration {
235
239
  }
236
240
 
237
241
  /**
238
- * @internal
242
+ * @alpha
239
243
  */
240
244
  export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfiguration {
241
245
  state: "enabled";
@@ -298,21 +302,21 @@ export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfigurati
298
302
  }
299
303
 
300
304
  /**
301
- * @internal
305
+ * @alpha
302
306
  */
303
307
  export interface ISummaryConfigurationDisableSummarizer {
304
308
  state: "disabled";
305
309
  }
306
310
 
307
311
  /**
308
- * @internal
312
+ * @alpha
309
313
  */
310
314
  export interface ISummaryConfigurationDisableHeuristics extends ISummaryBaseConfiguration {
311
315
  state: "disableHeuristics";
312
316
  }
313
317
 
314
318
  /**
315
- * @internal
319
+ * @alpha
316
320
  */
317
321
  export type ISummaryConfiguration =
318
322
  | ISummaryConfigurationDisableSummarizer
@@ -349,7 +353,7 @@ export const DefaultSummaryConfiguration: ISummaryConfiguration = {
349
353
  };
350
354
 
351
355
  /**
352
- * @internal
356
+ * @alpha
353
357
  */
354
358
  export interface ISummaryRuntimeOptions {
355
359
  /** Override summary configurations set by the server. */
@@ -366,7 +370,7 @@ export interface ISummaryRuntimeOptions {
366
370
 
367
371
  /**
368
372
  * Options for op compression.
369
- * @internal
373
+ * @alpha
370
374
  */
371
375
  export interface ICompressionRuntimeOptions {
372
376
  /**
@@ -384,7 +388,7 @@ export interface ICompressionRuntimeOptions {
384
388
 
385
389
  /**
386
390
  * Options for container runtime.
387
- * @internal
391
+ * @alpha
388
392
  */
389
393
  export interface IContainerRuntimeOptions {
390
394
  readonly summaryOptions?: ISummaryRuntimeOptions;
@@ -516,7 +520,7 @@ export const defaultRuntimeHeaderData: Required<RuntimeHeaderData> = {
516
520
 
517
521
  /**
518
522
  * Available compression algorithms for op compression.
519
- * @internal
523
+ * @alpha
520
524
  */
521
525
  export enum CompressionAlgorithms {
522
526
  lz4 = "lz4",
@@ -718,7 +722,7 @@ export async function TEST_requestSummarizer(loader: ILoader, url: string): Prom
718
722
  /**
719
723
  * Represents the runtime of the container. Contains helper functions/state of the container.
720
724
  * It will define the store level mappings.
721
- * @internal
725
+ * @alpha
722
726
  */
723
727
  export class ContainerRuntime
724
728
  extends TypedEventEmitter<IContainerRuntimeEvents & ISummarizerEvents>
@@ -909,16 +913,18 @@ export class ContainerRuntime
909
913
  metadata?.idCompressorEnabled ?? runtimeOptions.enableRuntimeIdCompressor ?? false;
910
914
  let idCompressor: (IIdCompressor & IIdCompressorCore) | undefined;
911
915
  if (idCompressorEnabled) {
912
- const { IdCompressor, createSessionId } = await import("./id-compressor");
916
+ const { createIdCompressor, deserializeIdCompressor, createSessionId } = await import(
917
+ "@fluidframework/id-compressor"
918
+ );
913
919
 
914
920
  const pendingLocalState = context.pendingLocalState as IPendingRuntimeState;
915
921
 
916
922
  if (pendingLocalState?.pendingIdCompressorState !== undefined) {
917
- idCompressor = IdCompressor.deserialize(pendingLocalState.pendingIdCompressorState);
923
+ idCompressor = deserializeIdCompressor(pendingLocalState.pendingIdCompressorState);
918
924
  } else if (serializedIdCompressor !== undefined) {
919
- idCompressor = IdCompressor.deserialize(serializedIdCompressor, createSessionId());
925
+ idCompressor = deserializeIdCompressor(serializedIdCompressor, createSessionId());
920
926
  } else {
921
- idCompressor = IdCompressor.create(logger);
927
+ idCompressor = createIdCompressor(logger);
922
928
  }
923
929
  }
924
930
 
@@ -1341,8 +1347,7 @@ export class ContainerRuntime
1341
1347
  eventName: "GCFeatureMatrix",
1342
1348
  metadataValue: JSON.stringify(metadata?.gcFeatureMatrix),
1343
1349
  inputs: JSON.stringify({
1344
- gcOptions_gcTombstoneGeneration:
1345
- this.runtimeOptions.gcOptions[gcTombstoneGenerationOptionName],
1350
+ gcOptions_gcGeneration: this.runtimeOptions.gcOptions[gcGenerationOptionName],
1346
1351
  }),
1347
1352
  });
1348
1353
 
@@ -1447,6 +1452,7 @@ export class ContainerRuntime
1447
1452
  // GC runs in summarizer client and needs access to the real (non-proxy) active information. The proxy
1448
1453
  // delta manager would always return false for summarizer client.
1449
1454
  activeConnection: () => this.innerDeltaManager.active,
1455
+ submitMessage: (message: ContainerRuntimeGCMessage) => this.submit(message),
1450
1456
  });
1451
1457
 
1452
1458
  const loadedFromSequenceNumber = this.deltaManager.initialSequenceNumber;
@@ -2082,6 +2088,9 @@ export class ContainerRuntime
2082
2088
  throw new Error("chunkedOp not expected here");
2083
2089
  case ContainerMessageType.Rejoin:
2084
2090
  throw new Error("rejoin not expected here");
2091
+ case ContainerMessageType.GC:
2092
+ // GC op is only sent in summarizer which should never have stashed ops.
2093
+ throw new LoggingError("GC op not expected to be stashed in summarizer");
2085
2094
  default: {
2086
2095
  // This should be extremely rare for stashed ops.
2087
2096
  // It would require a newer runtime stashing ops and then an older one applying them,
@@ -2335,6 +2344,9 @@ export class ContainerRuntime
2335
2344
  this.idCompressor.finalizeCreationRange(messageWithContext.message.contents);
2336
2345
  }
2337
2346
  break;
2347
+ case ContainerMessageType.GC:
2348
+ this.garbageCollector.processMessage(messageWithContext.message, local);
2349
+ break;
2338
2350
  case ContainerMessageType.ChunkedOp:
2339
2351
  case ContainerMessageType.Rejoin:
2340
2352
  break;
@@ -2632,18 +2644,28 @@ export class ContainerRuntime
2632
2644
  }
2633
2645
 
2634
2646
  private isContainerMessageDirtyable({ type, contents }: OutboundContainerRuntimeMessage) {
2635
- // For legacy purposes, exclude the old built-in AgentScheduler from dirty consideration as a special-case.
2636
- // Ultimately we should have no special-cases from the ContainerRuntime's perspective.
2637
- if (type === ContainerMessageType.Attach) {
2638
- const attachMessage = contents as InboundAttachMessage;
2639
- if (attachMessage.id === agentSchedulerId) {
2640
- return false;
2647
+ // Certain container runtime messages should not mark the container dirty such as the old built-in
2648
+ // AgentScheduler and Garbage collector messages.
2649
+ switch (type) {
2650
+ case ContainerMessageType.Attach: {
2651
+ const attachMessage = contents as InboundAttachMessage;
2652
+ if (attachMessage.id === agentSchedulerId) {
2653
+ return false;
2654
+ }
2655
+ break;
2641
2656
  }
2642
- } else if (type === ContainerMessageType.FluidDataStoreOp) {
2643
- const envelope = contents;
2644
- if (envelope.address === agentSchedulerId) {
2657
+ case ContainerMessageType.FluidDataStoreOp: {
2658
+ const envelope = contents;
2659
+ if (envelope.address === agentSchedulerId) {
2660
+ return false;
2661
+ }
2662
+ break;
2663
+ }
2664
+ case ContainerMessageType.GC: {
2645
2665
  return false;
2646
2666
  }
2667
+ default:
2668
+ break;
2647
2669
  }
2648
2670
  return true;
2649
2671
  }
@@ -2874,7 +2896,7 @@ export class ContainerRuntime
2874
2896
  * @param usedRoutes - The routes that are used in all nodes in this Container.
2875
2897
  * @see IGarbageCollectionRuntime.updateUsedRoutes
2876
2898
  */
2877
- public updateUsedRoutes(usedRoutes: string[]) {
2899
+ public updateUsedRoutes(usedRoutes: readonly string[]) {
2878
2900
  // Update our summarizer node's used routes. Updating used routes in summarizer node before
2879
2901
  // summarizing is required and asserted by the the summarizer node. We are the root and are
2880
2902
  // always referenced, so the used routes is only self-route (empty string).
@@ -2888,7 +2910,7 @@ export class ContainerRuntime
2888
2910
  * This is called to update objects whose routes are unused.
2889
2911
  * @param unusedRoutes - Data store and attachment blob routes that are unused in this Container.
2890
2912
  */
2891
- public updateUnusedRoutes(unusedRoutes: string[]) {
2913
+ public updateUnusedRoutes(unusedRoutes: readonly string[]) {
2892
2914
  const { blobManagerRoutes, dataStoreRoutes } =
2893
2915
  this.getDataStoreAndBlobManagerRoutes(unusedRoutes);
2894
2916
  this.blobManager.updateUnusedRoutes(blobManagerRoutes);
@@ -2898,7 +2920,7 @@ export class ContainerRuntime
2898
2920
  /**
2899
2921
  * @deprecated Replaced by deleteSweepReadyNodes.
2900
2922
  */
2901
- public deleteUnusedNodes(unusedRoutes: string[]): string[] {
2923
+ public deleteUnusedNodes(unusedRoutes: readonly string[]): string[] {
2902
2924
  throw new Error("deleteUnusedRoutes should not be called");
2903
2925
  }
2904
2926
 
@@ -2907,7 +2929,7 @@ export class ContainerRuntime
2907
2929
  * @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.
2908
2930
  * @returns The routes of nodes that were deleted.
2909
2931
  */
2910
- public deleteSweepReadyNodes(sweepReadyRoutes: string[]): string[] {
2932
+ public deleteSweepReadyNodes(sweepReadyRoutes: readonly string[]): readonly string[] {
2911
2933
  const { dataStoreRoutes, blobManagerRoutes } =
2912
2934
  this.getDataStoreAndBlobManagerRoutes(sweepReadyRoutes);
2913
2935
 
@@ -2919,7 +2941,7 @@ export class ContainerRuntime
2919
2941
  * This is called to update objects that are tombstones.
2920
2942
  * @param tombstonedRoutes - Data store and attachment blob routes that are tombstones in this Container.
2921
2943
  */
2922
- public updateTombstonedRoutes(tombstonedRoutes: string[]) {
2944
+ public updateTombstonedRoutes(tombstonedRoutes: readonly string[]) {
2923
2945
  const { blobManagerRoutes, dataStoreRoutes } =
2924
2946
  this.getDataStoreAndBlobManagerRoutes(tombstonedRoutes);
2925
2947
  this.blobManager.updateTombstonedRoutes(blobManagerRoutes);
@@ -2979,7 +3001,7 @@ export class ContainerRuntime
2979
3001
  * @returns Two route lists - One that contains routes for blob manager and another one that contains routes
2980
3002
  * for data stores.
2981
3003
  */
2982
- private getDataStoreAndBlobManagerRoutes(routes: string[]) {
3004
+ private getDataStoreAndBlobManagerRoutes(routes: readonly string[]) {
2983
3005
  const blobManagerRoutes: string[] = [];
2984
3006
  const dataStoreRoutes: string[] = [];
2985
3007
  for (const route of routes) {
@@ -3056,10 +3078,10 @@ export class ContainerRuntime
3056
3078
  );
3057
3079
  }
3058
3080
 
3059
- // If there are pending (unacked ops), the summary will not be eventual consistent and it may even be
3060
- // incorrect. So, wait for the container to be saved with a timeout. If the container is not saved
3061
- // within the timeout, check if it should be failed or can continue.
3062
- if (this.validateSummaryBeforeUpload && this.hasPendingMessages()) {
3081
+ // If the container is dirty, i.e., there are pending unacked ops, the summary will not be eventual consistent
3082
+ // and it may even be incorrect. So, wait for the container to be saved with a timeout. If the container is not
3083
+ // saved within the timeout, check if it should be failed or can continue.
3084
+ if (this.validateSummaryBeforeUpload && this.isDirty) {
3063
3085
  const countBefore = this.pendingMessagesCount;
3064
3086
  // The timeout for waiting for pending ops can be overridden via configurations.
3065
3087
  const pendingOpsTimeout =
@@ -3081,7 +3103,7 @@ export class ContainerRuntime
3081
3103
  // happens, whether we attempted to wait for these ops to be acked and what was the result.
3082
3104
  summaryNumberLogger.sendTelemetryEvent({
3083
3105
  eventName: "PendingOpsWhileSummarizing",
3084
- saved: this.hasPendingMessages() ? false : true,
3106
+ saved: !this.isDirty,
3085
3107
  timeout: pendingOpsTimeout,
3086
3108
  countBefore,
3087
3109
  countAfter: this.pendingMessagesCount,
@@ -3360,7 +3382,7 @@ export class ContainerRuntime
3360
3382
  }
3361
3383
 
3362
3384
  /**
3363
- * This helper is called during summarization. If there are pending ops, it will return a failed summarize result
3385
+ * This helper is called during summarization. If the container is dirty, it will return a failed summarize result
3364
3386
  * (IBaseSummarizeResult) unless this is the final summarize attempt and SkipFailingIncorrectSummary option is set.
3365
3387
  * @param logger - The logger to be used for sending telemetry.
3366
3388
  * @param referenceSequenceNumber - The reference sequence number of the summary attempt.
@@ -3376,7 +3398,7 @@ export class ContainerRuntime
3376
3398
  finalAttempt: boolean,
3377
3399
  beforeSummaryGeneration: boolean,
3378
3400
  ): Promise<IBaseSummarizeResult | undefined> {
3379
- if (!this.hasPendingMessages()) {
3401
+ if (!this.isDirty) {
3380
3402
  return;
3381
3403
  }
3382
3404
 
@@ -3724,6 +3746,7 @@ export class ContainerRuntime
3724
3746
  /**
3725
3747
  * Finds the right store and asks it to resubmit the message. This typically happens when we
3726
3748
  * reconnect and there are pending messages.
3749
+ * ! Note: successfully resubmitting an op that has been successfully sequenced is not possible due to checks in the ConnectionStateHandler (Loader layer)
3727
3750
  * @param message - The original LocalContainerRuntimeMessage.
3728
3751
  * @param localOpMetadata - The local metadata associated with the original message.
3729
3752
  */
@@ -3752,6 +3775,9 @@ export class ContainerRuntime
3752
3775
  case ContainerMessageType.Rejoin:
3753
3776
  this.submit(message);
3754
3777
  break;
3778
+ case ContainerMessageType.GC:
3779
+ // GC op is only sent in summarizer which should never reconnect.
3780
+ throw new LoggingError("GC op not expected to be resubmitted in summarizer");
3755
3781
  default: {
3756
3782
  // This case should be very rare - it would imply an op was stashed from a
3757
3783
  // future version of runtime code and now is being applied on an older version