@fluidframework/container-runtime 2.0.0-internal.1.4.4 → 2.0.0-internal.2.0.1

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 (114) hide show
  1. package/dist/batchManager.d.ts +2 -3
  2. package/dist/batchManager.d.ts.map +1 -1
  3. package/dist/batchManager.js +3 -8
  4. package/dist/batchManager.js.map +1 -1
  5. package/dist/containerRuntime.d.ts +43 -16
  6. package/dist/containerRuntime.d.ts.map +1 -1
  7. package/dist/containerRuntime.js +107 -82
  8. package/dist/containerRuntime.js.map +1 -1
  9. package/dist/dataStoreContext.d.ts +4 -20
  10. package/dist/dataStoreContext.d.ts.map +1 -1
  11. package/dist/dataStoreContext.js +17 -47
  12. package/dist/dataStoreContext.js.map +1 -1
  13. package/dist/dataStores.d.ts +2 -5
  14. package/dist/dataStores.d.ts.map +1 -1
  15. package/dist/dataStores.js +3 -11
  16. package/dist/dataStores.js.map +1 -1
  17. package/dist/garbageCollection.d.ts +1 -10
  18. package/dist/garbageCollection.d.ts.map +1 -1
  19. package/dist/garbageCollection.js +43 -51
  20. package/dist/garbageCollection.js.map +1 -1
  21. package/dist/gcSweepReadyUsageDetection.d.ts.map +1 -1
  22. package/dist/gcSweepReadyUsageDetection.js +3 -12
  23. package/dist/gcSweepReadyUsageDetection.js.map +1 -1
  24. package/dist/index.d.ts +3 -5
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +1 -5
  27. package/dist/index.js.map +1 -1
  28. package/dist/packageVersion.d.ts +1 -1
  29. package/dist/packageVersion.js +1 -1
  30. package/dist/packageVersion.js.map +1 -1
  31. package/dist/pendingStateManager.d.ts +6 -26
  32. package/dist/pendingStateManager.d.ts.map +1 -1
  33. package/dist/pendingStateManager.js +42 -62
  34. package/dist/pendingStateManager.js.map +1 -1
  35. package/dist/scheduleManager.js.map +1 -1
  36. package/dist/summarizer.js +7 -2
  37. package/dist/summarizer.js.map +1 -1
  38. package/dist/summarizerHeuristics.d.ts.map +1 -1
  39. package/dist/summarizerHeuristics.js +0 -3
  40. package/dist/summarizerHeuristics.js.map +1 -1
  41. package/dist/summarizerTypes.d.ts +19 -2
  42. package/dist/summarizerTypes.d.ts.map +1 -1
  43. package/dist/summarizerTypes.js.map +1 -1
  44. package/dist/summaryFormat.d.ts +4 -2
  45. package/dist/summaryFormat.d.ts.map +1 -1
  46. package/dist/summaryFormat.js.map +1 -1
  47. package/dist/summaryManager.d.ts.map +1 -1
  48. package/dist/summaryManager.js +10 -6
  49. package/dist/summaryManager.js.map +1 -1
  50. package/lib/batchManager.d.ts +2 -3
  51. package/lib/batchManager.d.ts.map +1 -1
  52. package/lib/batchManager.js +3 -8
  53. package/lib/batchManager.js.map +1 -1
  54. package/lib/containerRuntime.d.ts +43 -16
  55. package/lib/containerRuntime.d.ts.map +1 -1
  56. package/lib/containerRuntime.js +108 -83
  57. package/lib/containerRuntime.js.map +1 -1
  58. package/lib/dataStoreContext.d.ts +4 -20
  59. package/lib/dataStoreContext.d.ts.map +1 -1
  60. package/lib/dataStoreContext.js +18 -48
  61. package/lib/dataStoreContext.js.map +1 -1
  62. package/lib/dataStores.d.ts +2 -5
  63. package/lib/dataStores.d.ts.map +1 -1
  64. package/lib/dataStores.js +3 -11
  65. package/lib/dataStores.js.map +1 -1
  66. package/lib/garbageCollection.d.ts +1 -10
  67. package/lib/garbageCollection.d.ts.map +1 -1
  68. package/lib/garbageCollection.js +42 -50
  69. package/lib/garbageCollection.js.map +1 -1
  70. package/lib/gcSweepReadyUsageDetection.d.ts.map +1 -1
  71. package/lib/gcSweepReadyUsageDetection.js +3 -12
  72. package/lib/gcSweepReadyUsageDetection.js.map +1 -1
  73. package/lib/index.d.ts +3 -5
  74. package/lib/index.d.ts.map +1 -1
  75. package/lib/index.js +0 -2
  76. package/lib/index.js.map +1 -1
  77. package/lib/packageVersion.d.ts +1 -1
  78. package/lib/packageVersion.js +1 -1
  79. package/lib/packageVersion.js.map +1 -1
  80. package/lib/pendingStateManager.d.ts +6 -26
  81. package/lib/pendingStateManager.d.ts.map +1 -1
  82. package/lib/pendingStateManager.js +42 -62
  83. package/lib/pendingStateManager.js.map +1 -1
  84. package/lib/scheduleManager.js.map +1 -1
  85. package/lib/summarizer.js +7 -2
  86. package/lib/summarizer.js.map +1 -1
  87. package/lib/summarizerHeuristics.d.ts.map +1 -1
  88. package/lib/summarizerHeuristics.js +0 -3
  89. package/lib/summarizerHeuristics.js.map +1 -1
  90. package/lib/summarizerTypes.d.ts +19 -2
  91. package/lib/summarizerTypes.d.ts.map +1 -1
  92. package/lib/summarizerTypes.js.map +1 -1
  93. package/lib/summaryFormat.d.ts +4 -2
  94. package/lib/summaryFormat.d.ts.map +1 -1
  95. package/lib/summaryFormat.js.map +1 -1
  96. package/lib/summaryManager.d.ts.map +1 -1
  97. package/lib/summaryManager.js +10 -6
  98. package/lib/summaryManager.js.map +1 -1
  99. package/package.json +22 -65
  100. package/src/batchManager.ts +7 -11
  101. package/src/containerRuntime.ts +149 -100
  102. package/src/dataStoreContext.ts +20 -62
  103. package/src/dataStores.ts +2 -10
  104. package/src/garbageCollection.ts +45 -55
  105. package/src/gcSweepReadyUsageDetection.ts +2 -10
  106. package/src/index.ts +2 -3
  107. package/src/packageVersion.ts +1 -1
  108. package/src/pendingStateManager.ts +57 -96
  109. package/src/scheduleManager.ts +1 -0
  110. package/src/summarizer.ts +6 -6
  111. package/src/summarizerHeuristics.ts +0 -3
  112. package/src/summarizerTypes.ts +20 -7
  113. package/src/summaryFormat.ts +4 -2
  114. package/src/summaryManager.ts +18 -7
@@ -16,14 +16,13 @@ export declare type BatchMessage = IBatchMessage & {
16
16
  * Helper class that manages partial batch & rollback.
17
17
  */
18
18
  export declare class BatchManager {
19
+ private readonly hardLimit;
19
20
  readonly softLimit?: number | undefined;
20
21
  private pendingBatch;
21
22
  private batchContentSize;
22
- private static readonly hardLimit;
23
23
  get length(): number;
24
24
  get limit(): number;
25
- static get limit(): number;
26
- constructor(softLimit?: number | undefined);
25
+ constructor(hardLimit: number, softLimit?: number | undefined);
27
26
  push(message: BatchMessage): boolean;
28
27
  get empty(): boolean;
29
28
  popBatch(): BatchMessage[];
@@ -1 +1 @@
1
- {"version":3,"file":"batchManager.d.ts","sourceRoot":"","sources":["../src/batchManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;GAEG;AACH,oBAAY,YAAY,GAAG,aAAa,GAAG;IACvC,eAAe,EAAE,OAAO,CAAC;IACzB,mBAAmB,EAAE,uBAAuB,CAAC;IAC7C,uBAAuB,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,qBAAa,YAAY;aAcO,SAAS,CAAC;IAbtC,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,gBAAgB,CAAK;IAM7B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAc;IAE/C,IAAW,MAAM,WAAuC;IACxD,IAAW,KAAK,WAAqC;IACrD,WAAkB,KAAK,WAAqC;gBAEhC,SAAS,CAAC,oBAAQ;IAEvC,IAAI,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO;IA2B3C,IAAW,KAAK,YAA6C;IAEtD,QAAQ;IAOf;;OAEG;IACK,UAAU;sCAGoB,YAAY,KAAK,IAAI;;CAY9D"}
1
+ {"version":3,"file":"batchManager.d.ts","sourceRoot":"","sources":["../src/batchManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;GAEG;AACH,oBAAY,YAAY,GAAG,aAAa,GAAG;IACvC,eAAe,EAAE,OAAO,CAAC;IACzB,mBAAmB,EAAE,uBAAuB,CAAC;IAC7C,uBAAuB,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,qBAAa,YAAY;IAQjB,OAAO,CAAC,QAAQ,CAAC,SAAS;aACV,SAAS,CAAC;IAR9B,OAAO,CAAC,YAAY,CAAsB;IAC1C,OAAO,CAAC,gBAAgB,CAAK;IAE7B,IAAW,MAAM,WAAuC;IACxD,IAAW,KAAK,WAA6B;gBAGxB,SAAS,EAAE,MAAM,EAClB,SAAS,CAAC,oBAAQ;IAG/B,IAAI,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO;IA2B3C,IAAW,KAAK,YAA6C;IAEtD,QAAQ;IAOf;;OAEG;IACI,UAAU;sCAGqB,YAAY,KAAK,IAAI;;CAY9D"}
@@ -9,14 +9,14 @@ exports.BatchManager = void 0;
9
9
  * Helper class that manages partial batch & rollback.
10
10
  */
11
11
  class BatchManager {
12
- constructor(softLimit) {
12
+ constructor(hardLimit, softLimit) {
13
+ this.hardLimit = hardLimit;
13
14
  this.softLimit = softLimit;
14
15
  this.pendingBatch = [];
15
16
  this.batchContentSize = 0;
16
17
  }
17
18
  get length() { return this.pendingBatch.length; }
18
- get limit() { return BatchManager.hardLimit; }
19
- static get limit() { return BatchManager.hardLimit; }
19
+ get limit() { return this.hardLimit; }
20
20
  push(message) {
21
21
  const contentSize = this.batchContentSize + message.contents.length;
22
22
  const opCount = this.pendingBatch.length;
@@ -65,9 +65,4 @@ class BatchManager {
65
65
  }
66
66
  }
67
67
  exports.BatchManager = BatchManager;
68
- // The actual limit is 1Mb (socket.io and Kafka limits)
69
- // We can't estimate it fully, as we
70
- // - do not know what properties relay service will add
71
- // - we do not stringify final op, thus we do not know how much escaping will be added.
72
- BatchManager.hardLimit = 950 * 1024;
73
68
  //# sourceMappingURL=batchManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"batchManager.js","sourceRoot":"","sources":["../src/batchManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAcH;;GAEG;AACH,MAAa,YAAY;IAcrB,YAA4B,S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AC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAC1B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;OAEG;IACK,UAAU;QACd,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;QAC5C,OAAO;YACH,QAAQ,EAAE,CAAC,OAAwC,EAAE,EAAE;gBACnD,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,GAAG,UAAU,GAAG;oBACpD,CAAC,EAAE,CAAC;oBACJ,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;oBACrC,IAAI,CAAC,gBAAgB,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;oBACjD,OAAO,CAAC,OAAO,CAAC,CAAC;iBACpB;gBAED,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,UAAU,CAAC;YAC1C,CAAC;SACJ,CAAC;IACN,CAAC;;AArEL,oCAsEC;AAlEG,uDAAuD;AACvD,oCAAoC;AACpC,uDAAuD;AACvD,uFAAuF;AAC/D,sBAAS,GAAG,GAAG,GAAG,IAAI,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IBatchMessage } from \"@fluidframework/container-definitions\";\nimport { ContainerRuntimeMessage } from \"./containerRuntime\";\n\n/**\n * Message type used by BatchManager\n */\nexport type BatchMessage = IBatchMessage & {\n localOpMetadata: unknown;\n deserializedContent: ContainerRuntimeMessage;\n referenceSequenceNumber: number;\n};\n\n/**\n * Helper class that manages partial batch & rollback.\n */\nexport class BatchManager {\n private pendingBatch: BatchMessage [] = [];\n private batchContentSize = 0;\n\n // The actual limit is 1Mb (socket.io and Kafka limits)\n // We can't estimate it fully, as we\n // - do not know what properties relay service will add\n // - we do not stringify final op, thus we do not know how much escaping will be added.\n private static readonly hardLimit = 950 * 1024;\n\n public get length() { return this.pendingBatch.length; }\n public get limit() { return BatchManager.hardLimit; }\n public static get limit() { return BatchManager.hardLimit; }\n\n constructor(public readonly softLimit?: number) {}\n\n public push(message: BatchMessage): boolean {\n const contentSize = this.batchContentSize + message.contents.length;\n const opCount = this.pendingBatch.length;\n\n // Attempt to estimate batch size, aka socket message size.\n // Each op has pretty large envelope, estimating to be 200 bytes.\n // Also content will be strigified, and that adds a lot of overhead due to a lot of escape characters.\n // Not taking it into account, as compression work should help there - compressed payload will be\n // initially stored as base64, and that requires only 2 extra escape characters.\n const socketMessageSize = contentSize + 200 * opCount;\n\n // If we were provided soft limit, check for exceeding it.\n // But only if we have any ops, as the intention here is to flush existing ops (on exceeding this limit)\n // and start over. That's not an option if we have no ops.\n if (this.softLimit !== undefined && this.length > 0 && socketMessageSize >= this.softLimit) {\n return false;\n }\n\n if (socketMessageSize >= this.limit) {\n return false;\n }\n\n this.batchContentSize = contentSize;\n this.pendingBatch.push(message);\n return true;\n }\n\n public get empty() { return this.pendingBatch.length === 0; }\n\n public popBatch() {\n const batch = this.pendingBatch;\n this.pendingBatch = [];\n this.batchContentSize = 0;\n return batch;\n }\n\n /**\n * Capture the pending state at this point\n */\n public checkpoint() {\n const startPoint = this.pendingBatch.length;\n return {\n rollback: (process: (message: BatchMessage) => void) => {\n for (let i = this.pendingBatch.length; i > startPoint;) {\n i--;\n const message = this.pendingBatch[i];\n this.batchContentSize -= message.contents.length;\n process(message);\n }\n\n this.pendingBatch.length = startPoint;\n },\n };\n }\n}\n"]}
1
+ {"version":3,"file":"batchManager.js","sourceRoot":"","sources":["../src/batchManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAcH;;GAEG;AACH,MAAa,YAAY;IAOrB,YACqB,SAAiB,EAClB,SAAkB;QADjB,cAAS,GAAT,SAAS,CAAQ;QAClB,cAAS,GAAT,SAAS,CAAS;QAR9B,iBAAY,GAAmB,EAAE,CAAC;QAClC,qBAAgB,GAAG,CAAC,CAAC;I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AAM,CAAC;QAC5C,OAAO;YACH,QAAQ,EAAE,CAAC,OAAwC,EAAE,EAAE;gBACnD,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,GAAG,UAAU,GAAG;oBACpD,CAAC,EAAE,CAAC;oBACJ,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;oBACrC,IAAI,CAAC,gBAAgB,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;oBACjD,OAAO,CAAC,OAAO,CAAC,CAAC;iBACpB;gBAED,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,UAAU,CAAC;YAC1C,CAAC;SACJ,CAAC;IACN,CAAC;CACJ;AAlED,oCAkEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IBatchMessage } from \"@fluidframework/container-definitions\";\nimport { ContainerRuntimeMessage } from \"./containerRuntime\";\n\n/**\n * Message type used by BatchManager\n */\nexport type BatchMessage = IBatchMessage & {\n localOpMetadata: unknown;\n deserializedContent: ContainerRuntimeMessage;\n referenceSequenceNumber: number;\n};\n\n/**\n * Helper class that manages partial batch & rollback.\n */\nexport class BatchManager {\n private pendingBatch: BatchMessage[] = [];\n private batchContentSize = 0;\n\n public get length() { return this.pendingBatch.length; }\n public get limit() { return this.hardLimit; }\n\n constructor(\n private readonly hardLimit: number,\n public readonly softLimit?: number,\n ) { }\n\n public push(message: BatchMessage): boolean {\n const contentSize = this.batchContentSize + message.contents.length;\n const opCount = this.pendingBatch.length;\n\n // Attempt to estimate batch size, aka socket message size.\n // Each op has pretty large envelope, estimating to be 200 bytes.\n // Also content will be strigified, and that adds a lot of overhead due to a lot of escape characters.\n // Not taking it into account, as compression work should help there - compressed payload will be\n // initially stored as base64, and that requires only 2 extra escape characters.\n const socketMessageSize = contentSize + 200 * opCount;\n\n // If we were provided soft limit, check for exceeding it.\n // But only if we have any ops, as the intention here is to flush existing ops (on exceeding this limit)\n // and start over. That's not an option if we have no ops.\n if (this.softLimit !== undefined && this.length > 0 && socketMessageSize >= this.softLimit) {\n return false;\n }\n\n if (socketMessageSize >= this.limit) {\n return false;\n }\n\n this.batchContentSize = contentSize;\n this.pendingBatch.push(message);\n return true;\n }\n\n public get empty() { return this.pendingBatch.length === 0; }\n\n public popBatch() {\n const batch = this.pendingBatch;\n this.pendingBatch = [];\n this.batchContentSize = 0;\n return batch;\n }\n\n /**\n * Capture the pending state at this point\n */\n public checkpoint() {\n const startPoint = this.pendingBatch.length;\n return {\n rollback: (process: (message: BatchMessage) => void) => {\n for (let i = this.pendingBatch.length; i > startPoint;) {\n i--;\n const message = this.pendingBatch[i];\n this.batchContentSize -= message.contents.length;\n process(message);\n }\n\n this.pendingBatch.length = startPoint;\n },\n };\n }\n}\n"]}
@@ -11,7 +11,7 @@ import { IDocumentStorageService } from "@fluidframework/driver-definitions";
11
11
  import { IClientDetails, IDocumentMessage, IQuorumClients, ISequencedDocumentMessage, ISignalMessage, ISummaryTree, MessageType } from "@fluidframework/protocol-definitions";
12
12
  import { FlushMode, IFluidDataStoreContextDetached, IFluidDataStoreRegistry, IGarbageCollectionData, NamedFluidDataStoreRegistryEntries, ISummaryTreeWithStats, IDataStore, ITelemetryContext } from "@fluidframework/runtime-definitions";
13
13
  import { BatchMessage } from "./batchManager";
14
- import { SubmitSummaryResult, ISubmitSummaryOptions, ISummarizer, ISummarizerInternalsProvider, ISummarizerOptions, ISummarizerRuntime } from "./summarizerTypes";
14
+ import { SubmitSummaryResult, ISubmitSummaryOptions, ISummarizer, ISummarizerInternalsProvider, ISummarizerOptions, ISummarizerRuntime, IRefreshSummaryAckOptions } from "./summarizerTypes";
15
15
  import { GCNodeType, IGarbageCollectionRuntime, IGCStats } from "./garbageCollection";
16
16
  export declare enum ContainerMessageType {
17
17
  FluidDataStoreOp = "component",
@@ -55,11 +55,6 @@ export interface ISummaryBaseConfiguration {
55
55
  }
56
56
  export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfiguration {
57
57
  state: "enabled";
58
- /**
59
- * @deprecated Please move all implementations to {@link ISummaryConfigurationHeuristics.minIdleTime} and
60
- * {@link ISummaryConfigurationHeuristics.maxIdleTime} instead.
61
- */
62
- idleTime?: number;
63
58
  /**
64
59
  * Defines the maximum allowed time, since the last received Ack, before running the summary
65
60
  * with reason maxTime.
@@ -197,6 +192,17 @@ export interface ISummaryRuntimeOptions {
197
192
  * */
198
193
  summarizerOptions?: Readonly<Partial<ISummarizerOptions>>;
199
194
  }
195
+ /**
196
+ * Options for op compression.
197
+ * @experimental - Not ready for use
198
+ */
199
+ export interface ICompressionRuntimeOptions {
200
+ /**
201
+ * The minimum size the content payload must exceed before it is compressed.
202
+ * Compression is disabled if undefined.
203
+ */
204
+ readonly minimumSize?: number;
205
+ }
200
206
  /**
201
207
  * Options for container runtime.
202
208
  */
@@ -223,6 +229,22 @@ export interface IContainerRuntimeOptions {
223
229
  * Save enough runtime state to be able to serialize upon request and load to the same state in a new container.
224
230
  */
225
231
  readonly enableOfflineLoad?: boolean;
232
+ /**
233
+ * Enables the runtime to compress ops.
234
+ * @experimental Not ready for use.
235
+ */
236
+ readonly compressionOptions?: ICompressionRuntimeOptions;
237
+ /**
238
+ * If specified, when in FlushMode.TurnBased, if the size of the ops between JS turns exceeds this value,
239
+ * an error will be thrown and the container will close.
240
+ *
241
+ * If unspecified, the limit is 950 * 1024.
242
+ *
243
+ * 'Infinity' will disable any limit.
244
+ *
245
+ * @experimental This config should be driven by the connection with the service and will be moved in the future.
246
+ */
247
+ readonly maxBatchSizeInBytes?: number;
226
248
  }
227
249
  /**
228
250
  * The summary tree returned by the root node. It adds state relevant to the root of the tree.
@@ -264,7 +286,7 @@ export declare function isRuntimeMessage(message: ISequencedDocumentMessage): bo
264
286
  /**
265
287
  * Unpacks runtime messages
266
288
  *
267
- * @remarks This API makes no promises regarding backward-compatability. This is internal API.
289
+ * @remarks This API makes no promises regarding backward-compatibility. This is internal API.
268
290
  * @param message - message (as it observed in storage / service)
269
291
  * @returns unpacked runtime message
270
292
  *
@@ -334,12 +356,13 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
334
356
  private readonly maxConsecutiveReconnects;
335
357
  private readonly defaultMaxConsecutiveReconnects;
336
358
  private _orderSequentiallyCalls;
337
- private _flushMode;
338
- private flushTrigger;
359
+ private readonly _flushMode;
360
+ private flushMicroTaskExists;
339
361
  private _connected;
340
362
  private readonly savedOps;
341
363
  private baseSnapshotBlobs?;
342
364
  private consecutiveReconnects;
365
+ private compressedOpCount;
343
366
  /**
344
367
  * Used to delay transition to "connected" state while we upload
345
368
  * attachment blobs that were added while disconnected
@@ -423,17 +446,23 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
423
446
  processSignal(message: ISignalMessage, local: boolean): void;
424
447
  getRootDataStore(id: string, wait?: boolean): Promise<IFluidRouter>;
425
448
  private getRootDataStoreChannel;
426
- setFlushMode(mode: FlushMode): void;
427
- flush(): void;
449
+ /**
450
+ * Flush the pending ops manually.
451
+ * This method is expected to be called at the end of a batch.
452
+ */
453
+ private flush;
428
454
  protected flushBatch(batch: BatchMessage[]): void;
429
455
  orderSequentially(callback: () => void): void;
430
- private trackOrderSequentiallyCalls;
431
456
  createDataStore(pkg: string | string[]): Promise<IDataStore>;
432
457
  createDetachedRootDataStore(pkg: Readonly<string[]>, rootDataStoreId: string): IFluidDataStoreContextDetached;
433
458
  createDetachedDataStore(pkg: Readonly<string[]>): IFluidDataStoreContextDetached;
434
459
  _createDataStoreWithProps(pkg: string | string[], props?: any, id?: string): Promise<IDataStore>;
435
460
  private _createDataStore;
436
461
  private canSendOps;
462
+ /**
463
+ * Are we in the middle of batching ops together?
464
+ */
465
+ private currentlyBatching;
437
466
  getQuorum(): IQuorumClients;
438
467
  getAudience(): IAudience;
439
468
  /**
@@ -496,10 +525,8 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
496
525
  * Implementation of IGarbageCollectionRuntime::updateUsedRoutes.
497
526
  * After GC has run, called to notify this container's nodes of routes that are used in it.
498
527
  * @param usedRoutes - The routes that are used in all nodes in this Container.
499
- * @param gcTimestamp - The time when GC was run that generated these used routes. If any node node becomes
500
- * unreferenced as part of this GC run, this should be used to update the time when it happens.
501
528
  */
502
- updateUsedRoutes(usedRoutes: string[], gcTimestamp?: number): void;
529
+ updateUsedRoutes(usedRoutes: string[]): void;
503
530
  /**
504
531
  * When running GC in test mode, this is called to delete objects whose routes are unused. This enables testing
505
532
  * scenarios with accessing deleted content.
@@ -576,7 +603,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
576
603
  private reSubmit;
577
604
  private rollback;
578
605
  /** Implementation of ISummarizerInternalsProvider.refreshLatestSummaryAck */
579
- refreshLatestSummaryAck(proposalHandle: string | undefined, ackHandle: string, summaryRefSeq: number, summaryLogger: ITelemetryLogger): Promise<void>;
606
+ refreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;
580
607
  /**
581
608
  * Fetches the latest snapshot from storage and uses it to refresh SummarizerNode's
582
609
  * internal state as it should be considered the latest summary ack.
@@ -1 +1 @@
1
- {"version":3,"file":"containerRuntime.d.ts","sourceRoot":"","sources":["../src/containerRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAgD,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACpH,OAAO,EACH,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,SAAS,EACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EAEb,QAAQ,EACR,uBAAuB,EACvB,WAAW,EACX,cAAc,EAEd,6BAA6B,EAEhC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,iBAAiB,EACjB,uBAAuB,EAC1B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAGH,iBAAiB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EAAE,qBAAqB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA0OxF,OAAO,CAAC,2BAA2B;IAoBnC,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,wBAAwB;IAoBzB,iBAAiB,CACpB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,GAAG,EACb,eAAe,GAAE,OAAmB,GAAG,IAAI;IAQxC,sBAAsB,CAAC,QAAQ,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;IAS/D,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IAKtF,OAAO,CAAC,MAAM;IAkGd,OAAO,CAAC,oBAAoB;IAgB5B;;;OAGG;IACH,OAAO,CAAC,eAAe;IAMvB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;IA6BhB,OAAO,CAAC,QAAQ;IAgBhB,6EAA6E;IAChE,uBAAuB,CAAC,OAAO,EAAE,yBAAyB;IA6BvE;;;;;OAKG;YACW,iCAAiC;YA2BjC,wBAAwB;IA8B/B,eAAe,CAAC,QAAQ,EAAE,6BAA6B;IAMjD,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IASvC,oBAAoB,IAAI,OAAO;IAmCtC,SAAgB,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAajE;IAEF,SAAgB,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAa/D;IAEF;;;SAGK;IACL,OAAO,CAAC,uBAAuB;YA0BjB,eAAe;IAiB7B,OAAO,CAAC,qCAAqC;CAQhD"}
@@ -12,6 +12,7 @@ const runtime_definitions_1 = require("@fluidframework/runtime-definitions");
12
12
  const runtime_utils_1 = require("@fluidframework/runtime-utils");
13
13
  const garbage_collector_1 = require("@fluidframework/garbage-collector");
14
14
  const uuid_1 = require("uuid");
15
+ const lz4js_1 = require("lz4js");
15
16
  const containerHandleContext_1 = require("./containerHandleContext");
16
17
  const dataStoreRegistry_1 = require("./dataStoreRegistry");
17
18
  const summarizer_1 = require("./summarizer");
@@ -79,6 +80,11 @@ var RuntimeHeaders;
79
80
  })(RuntimeHeaders = exports.RuntimeHeaders || (exports.RuntimeHeaders = {}));
80
81
  const maxConsecutiveReconnectsKey = "Fluid.ContainerRuntime.MaxConsecutiveReconnects";
81
82
  const defaultFlushMode = runtime_definitions_1.FlushMode.TurnBased;
83
+ // The actual limit is 1Mb (socket.io and Kafka limits)
84
+ // We can't estimate it fully, as we
85
+ // - do not know what properties relay service will add
86
+ // - we do not stringify final op, thus we do not know how much escaping will be added.
87
+ const defaultMaxBatchSizeInBytes = 950 * 1024;
82
88
  /**
83
89
  * @deprecated - use ContainerRuntimeMessage instead
84
90
  */
@@ -96,22 +102,28 @@ var RuntimeMessage;
96
102
  * @deprecated - please use version in driver-utils
97
103
  */
98
104
  function isRuntimeMessage(message) {
99
- if (Object.values(RuntimeMessage).includes(message.type)) {
100
- return true;
101
- }
102
- return false;
105
+ return Object.values(RuntimeMessage).includes(message.type);
103
106
  }
104
107
  exports.isRuntimeMessage = isRuntimeMessage;
105
108
  /**
106
109
  * Unpacks runtime messages
107
110
  *
108
- * @remarks This API makes no promises regarding backward-compatability. This is internal API.
111
+ * @remarks This API makes no promises regarding backward-compatibility. This is internal API.
109
112
  * @param message - message (as it observed in storage / service)
110
113
  * @returns unpacked runtime message
111
114
  *
112
115
  * @internal
113
116
  */
114
117
  function unpackRuntimeMessage(message) {
118
+ var _a;
119
+ if ((_a = message.metadata) === null || _a === void 0 ? void 0 : _a.compressed) {
120
+ const contents = common_utils_1.IsoBuffer.from(message.contents.contents, "base64");
121
+ const decompressedMessage = (0, lz4js_1.decompress)(contents);
122
+ const intoString = new TextDecoder().decode(decompressedMessage);
123
+ const asObj = JSON.parse(intoString);
124
+ message.contents.contents = asObj;
125
+ message.metadata.compressed = false;
126
+ }
115
127
  if (message.type === protocol_definitions_1.MessageType.Operation) {
116
128
  // legacy op format?
117
129
  if (message.contents.address !== undefined && message.contents.type === undefined) {
@@ -162,7 +174,7 @@ exports.getDeviceSpec = getDeviceSpec;
162
174
  */
163
175
  class ContainerRuntime extends common_utils_1.TypedEventEmitter {
164
176
  constructor(context, registry, metadata, electedSummarizerData, chunks, dataStoreAliasMap, runtimeOptions, containerScope, logger, existing, blobManagerSnapshot, _storage, requestHandler, summaryConfiguration) {
165
- var _a, _b, _c, _d;
177
+ var _a, _b, _c, _d, _e, _f;
166
178
  if (summaryConfiguration === void 0) { summaryConfiguration = Object.assign(Object.assign({}, exports.DefaultSummaryConfiguration), (_a = runtimeOptions.summaryOptions) === null || _a === void 0 ? void 0 : _a.summaryConfigOverrides); }
167
179
  super();
168
180
  this.context = context;
@@ -175,9 +187,10 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
175
187
  this.summaryConfiguration = summaryConfiguration;
176
188
  this.defaultMaxConsecutiveReconnects = 7;
177
189
  this._orderSequentiallyCalls = 0;
178
- this.flushTrigger = false;
190
+ this.flushMicroTaskExists = false;
179
191
  this.savedOps = [];
180
192
  this.consecutiveReconnects = 0;
193
+ this.compressedOpCount = 0;
181
194
  this._disposed = false;
182
195
  this.emitDirtyDocumentEvent = true;
183
196
  this.defaultTelemetrySignalSampleCount = 100;
@@ -187,12 +200,6 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
187
200
  signalTimestamp: 0,
188
201
  trackingSignalSequenceNumber: undefined,
189
202
  };
190
- // Provide lower soft limit - we want to have some number of ops to get efficiency in compression & bandwidth usage,
191
- // but at the same time we want to send these ops sooner, to reduce overall latency of processing a batch.
192
- // So there is some ballance here, that depends on compression algorithm and its efficiency working with smaller
193
- // payloads. That number represents final (compressed) bits (once compression is implemented).
194
- this.pendingAttachBatch = new batchManager_1.BatchManager(64 * 1024);
195
- this.pendingBatch = new batchManager_1.BatchManager();
196
203
  this.summarizeOnDemand = (...args) => {
197
204
  if (this.clientDetails.type === summarizerClientElection_1.summarizerClientType) {
198
205
  return this.summarizer.summarizeOnDemand(...args);
@@ -237,8 +244,22 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
237
244
  this.maxConsecutiveReconnects =
238
245
  (_b = this.mc.config.getNumber(maxConsecutiveReconnectsKey)) !== null && _b !== void 0 ? _b : this.defaultMaxConsecutiveReconnects;
239
246
  this._flushMode = runtimeOptions.flushMode;
247
+ // Provide lower soft limit - we want to have some number of ops to get efficiency in compression
248
+ // & bandwidth usage, but at the same time we want to send these ops sooner, to reduce overall
249
+ // latency of processing a batch.
250
+ // So there is some ballance here, that depends on compression algorithm and its efficiency working with smaller
251
+ // payloads. That number represents final (compressed) bits (once compression is implemented).
252
+ this.pendingAttachBatch = new batchManager_1.BatchManager(runtimeOptions.maxBatchSizeInBytes, 64 * 1024);
253
+ this.pendingBatch = new batchManager_1.BatchManager(runtimeOptions.maxBatchSizeInBytes);
240
254
  const pendingRuntimeState = context.pendingLocalState;
241
255
  const baseSnapshot = (_c = pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.baseSnapshot) !== null && _c !== void 0 ? _c : context.baseSnapshot;
256
+ const maxSnapshotCacheDurationMs = (_e = (_d = this._storage) === null || _d === void 0 ? void 0 : _d.policies) === null || _e === void 0 ? void 0 : _e.maximumCacheDurationMs;
257
+ if (maxSnapshotCacheDurationMs !== undefined && maxSnapshotCacheDurationMs > 5 * 24 * 60 * 60 * 1000) {
258
+ // This is a runtime enforcement of what's already explicit in the policy's type itself,
259
+ // which dictates the value is either undefined or exactly 5 days in ms.
260
+ // As long as the actual value is less than 5 days, the assumptions GC makes here are valid.
261
+ throw new container_utils_1.UsageError("Driver's maximumCacheDurationMs policy cannot exceed 5 days");
262
+ }
242
263
  this.garbageCollector = garbageCollection_1.GarbageCollector.create({
243
264
  runtime: this,
244
265
  gcOptions: this.runtimeOptions.gcOptions,
@@ -271,9 +292,9 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
271
292
  gcDisabled: !this.garbageCollector.shouldRunGC,
272
293
  });
273
294
  if (baseSnapshot) {
274
- this.summarizerNode.loadBaseSummaryWithoutDifferential(baseSnapshot);
295
+ this.summarizerNode.updateBaseSummaryState(baseSnapshot);
275
296
  }
276
- this.dataStores = new dataStores_1.DataStores((0, dataStores_1.getSummaryForDatastores)(baseSnapshot, metadata), this, (attachMsg) => this.submit(ContainerMessageType.Attach, attachMsg), (id, createParam) => (summarizeInternal, getGCDataFn, getBaseGCDetailsFn) => this.summarizerNode.createChild(summarizeInternal, id, createParam, undefined, getGCDataFn, getBaseGCDetailsFn), (id) => this.summarizerNode.deleteChild(id), this.mc.logger, async () => this.garbageCollector.getBaseGCDetails(), (path, timestampMs, packagePath) => this.garbageCollector.nodeUpdated(path, "Changed", timestampMs, packagePath), new Map(dataStoreAliasMap), this.garbageCollector.writeDataAtRoot);
297
+ this.dataStores = new dataStores_1.DataStores((0, dataStores_1.getSummaryForDatastores)(baseSnapshot, metadata), this, (attachMsg) => this.submit(ContainerMessageType.Attach, attachMsg), (id, createParam) => (summarizeInternal, getGCDataFn, getBaseGCDetailsFn) => this.summarizerNode.createChild(summarizeInternal, id, createParam, undefined, getGCDataFn, getBaseGCDetailsFn), (id) => this.summarizerNode.deleteChild(id), this.mc.logger, async () => this.garbageCollector.getBaseGCDetails(), (path, timestampMs, packagePath) => this.garbageCollector.nodeUpdated(path, "Changed", timestampMs, packagePath), new Map(dataStoreAliasMap));
277
298
  this.blobManager = new blobManager_1.BlobManager(this.handleContext, blobManagerSnapshot, () => this.storage, (blobId, localId) => {
278
299
  if (!this.disposed) {
279
300
  this.submit(ContainerMessageType.BlobAttach, undefined, undefined, { blobId, localId });
@@ -287,10 +308,10 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
287
308
  close: this.closeFn,
288
309
  connected: () => this.connected,
289
310
  flush: this.flush.bind(this),
290
- flushMode: () => this.flushMode,
291
311
  reSubmit: this.reSubmit.bind(this),
292
- setFlushMode: (mode) => this.setFlushMode(mode),
293
- }, this._flushMode, pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.pending);
312
+ rollback: this.rollback.bind(this),
313
+ orderSequentially: this.orderSequentially.bind(this),
314
+ }, pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.pending);
294
315
  this.context.quorum.on("removeMember", (clientId) => {
295
316
  this.clearPartialChunks(clientId);
296
317
  });
@@ -314,7 +335,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
314
335
  // if summaries are enabled and we are not the summarizer client.
315
336
  const defaultAction = () => {
316
337
  if (this.summaryCollection.opsSinceLastAck > this.maxOpsSinceLastSummary) {
317
- this.logger.sendErrorEvent({ eventName: "SummaryStatus:Behind" });
338
+ this.logger.sendTelemetryEvent({ eventName: "SummaryStatus:Behind" });
318
339
  // unregister default to no log on every op after falling behind
319
340
  // and register summary ack handler to re-register this handler
320
341
  // after successful summary
@@ -370,7 +391,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
370
391
  };
371
392
  // summaryNumber was renamed from summaryCount. For older docs that haven't been opened for a long time,
372
393
  // the count is reset to 0.
373
- loadSummaryNumber = (_d = metadata === null || metadata === void 0 ? void 0 : metadata.summaryNumber) !== null && _d !== void 0 ? _d : 0;
394
+ loadSummaryNumber = (_f = metadata === null || metadata === void 0 ? void 0 : metadata.summaryNumber) !== null && _f !== void 0 ? _f : 0;
374
395
  }
375
396
  else {
376
397
  this.createContainerMetadata = {
@@ -405,7 +426,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
405
426
  runtimeVersion: packageVersion_1.pkgVersion,
406
427
  },
407
428
  });
408
- const { summaryOptions = {}, gcOptions = {}, loadSequenceNumberVerification = "close", flushMode = defaultFlushMode, enableOfflineLoad = false, } = runtimeOptions;
429
+ const { summaryOptions = {}, gcOptions = {}, loadSequenceNumberVerification = "close", flushMode = defaultFlushMode, enableOfflineLoad = false, compressionOptions = {}, maxBatchSizeInBytes = defaultMaxBatchSizeInBytes, } = runtimeOptions;
409
430
  const pendingRuntimeState = context.pendingLocalState;
410
431
  const baseSnapshot = (_b = pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.baseSnapshot) !== null && _b !== void 0 ? _b : context.baseSnapshot;
411
432
  const storage = !pendingRuntimeState ?
@@ -460,6 +481,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
460
481
  loadSequenceNumberVerification,
461
482
  flushMode,
462
483
  enableOfflineLoad,
484
+ compressionOptions,
485
+ maxBatchSizeInBytes,
463
486
  }, containerScope, logger, loadExisting, blobManagerSnapshot, storage, requestHandler);
464
487
  if (pendingRuntimeState) {
465
488
  await runtime.processSavedOps(pendingRuntimeState);
@@ -733,11 +756,9 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
733
756
  if (Object.keys(blobManagerSummary.summary.tree).length > 0) {
734
757
  (0, runtime_utils_1.addTreeToSummary)(summaryTree, summaryFormat_1.blobsTreeName, blobManagerSummary);
735
758
  }
736
- if (this.garbageCollector.writeDataAtRoot) {
737
- const gcSummary = this.garbageCollector.summarize(fullTree, trackState, telemetryContext);
738
- if (gcSummary !== undefined) {
739
- (0, runtime_utils_1.addSummarizeResultToSummary)(summaryTree, garbageCollection_1.gcTreeKey, gcSummary);
740
- }
759
+ const gcSummary = this.garbageCollector.summarize(fullTree, trackState, telemetryContext);
760
+ if (gcSummary !== undefined) {
761
+ (0, runtime_utils_1.addSummarizeResultToSummary)(summaryTree, garbageCollection_1.gcTreeKey, gcSummary);
741
762
  }
742
763
  }
743
764
  // Track how many times the container tries to reconnect with pending messages.
@@ -1014,23 +1035,10 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
1014
1035
  (0, common_utils_1.assert)(await context.isRoot(), 0x12b /* "did not get root data store" */);
1015
1036
  return context.realize();
1016
1037
  }
1017
- setFlushMode(mode) {
1018
- if (mode === this._flushMode) {
1019
- return;
1020
- }
1021
- this.mc.logger.sendTelemetryEvent({
1022
- eventName: "FlushMode Updated",
1023
- old: this._flushMode,
1024
- new: mode,
1025
- });
1026
- // Flush any pending batches if switching to immediate
1027
- if (mode === runtime_definitions_1.FlushMode.Immediate) {
1028
- this.flush();
1029
- }
1030
- this._flushMode = mode;
1031
- // Let the PendingStateManager know that FlushMode has been updated.
1032
- this.pendingStateManager.onFlushModeUpdated(mode);
1033
- }
1038
+ /**
1039
+ * Flush the pending ops manually.
1040
+ * This method is expected to be called at the end of a batch.
1041
+ */
1034
1042
  flush() {
1035
1043
  (0, common_utils_1.assert)(this._orderSequentiallyCalls === 0, 0x24c /* "Cannot call `flush()` from `orderSequentially`'s callback" */);
1036
1044
  this.flushBatch(this.pendingAttachBatch.popBatch());
@@ -1059,7 +1067,33 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
1059
1067
  if (this.context.submitBatchFn !== undefined) {
1060
1068
  const batchToSend = [];
1061
1069
  for (const message of batch) {
1062
- batchToSend.push({ contents: message.contents, metadata: message.metadata });
1070
+ let contents = message.contents;
1071
+ let metadata = message.metadata;
1072
+ if (this.runtimeOptions.compressionOptions.minimumSize &&
1073
+ this.runtimeOptions.compressionOptions.minimumSize < message.contents.length) {
1074
+ this.compressedOpCount++;
1075
+ const copiedMessage = Object.assign({}, message.deserializedContent);
1076
+ const compressionStart = Date.now();
1077
+ const contentsAsBuffer = new TextEncoder().encode(JSON.stringify(copiedMessage.contents));
1078
+ const compressedContents = (0, lz4js_1.compress)(contentsAsBuffer);
1079
+ const compressedContent = common_utils_1.IsoBuffer.from(compressedContents).toString("base64");
1080
+ const duration = Date.now() - compressionStart;
1081
+ if (this.compressedOpCount % 100) {
1082
+ this.mc.logger.sendPerformanceEvent({
1083
+ eventName: "compressedOp",
1084
+ duration,
1085
+ sizeBeforeCompression: message.contents.length,
1086
+ sizeAfterCompression: compressedContent.length,
1087
+ });
1088
+ }
1089
+ copiedMessage.contents = compressedContent;
1090
+ const stringifiedContents = JSON.stringify(copiedMessage);
1091
+ if (stringifiedContents.length < message.contents.length) {
1092
+ contents = JSON.stringify(copiedMessage);
1093
+ metadata = Object.assign(Object.assign({}, message.metadata), { compressed: true });
1094
+ }
1095
+ }
1096
+ batchToSend.push({ contents, metadata });
1063
1097
  }
1064
1098
  // returns clientSequenceNumber of last message in a batch
1065
1099
  clientSequenceNumber = this.context.submitBatchFn(batchToSend);
@@ -1086,26 +1120,6 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
1086
1120
  this.pendingStateManager.onFlush();
1087
1121
  }
1088
1122
  orderSequentially(callback) {
1089
- // If flush mode is already TurnBased we are either
1090
- // nested in another orderSequentially, or
1091
- // the app is flushing manually, in which
1092
- // case this invocation doesn't own
1093
- // flushing.
1094
- if (this.flushMode === runtime_definitions_1.FlushMode.TurnBased) {
1095
- this.trackOrderSequentiallyCalls(callback);
1096
- return;
1097
- }
1098
- const savedFlushMode = this.flushMode;
1099
- this.setFlushMode(runtime_definitions_1.FlushMode.TurnBased);
1100
- try {
1101
- this.trackOrderSequentiallyCalls(callback);
1102
- this.flush();
1103
- }
1104
- finally {
1105
- this.setFlushMode(savedFlushMode);
1106
- }
1107
- }
1108
- trackOrderSequentiallyCalls(callback) {
1109
1123
  let checkpoint;
1110
1124
  if (this.mc.config.getBoolean("Fluid.ContainerRuntime.EnableRollback")) {
1111
1125
  // Note: we are not touching this.pendingAttachBatch here, for two reasons:
@@ -1140,6 +1154,9 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
1140
1154
  finally {
1141
1155
  this._orderSequentiallyCalls--;
1142
1156
  }
1157
+ if (this.flushMode === runtime_definitions_1.FlushMode.Immediate && this._orderSequentiallyCalls === 0) {
1158
+ this.flush();
1159
+ }
1143
1160
  }
1144
1161
  async createDataStore(pkg) {
1145
1162
  const internalId = (0, uuid_1.v4)();
@@ -1166,6 +1183,12 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
1166
1183
  canSendOps() {
1167
1184
  return this.connected && !this.deltaManager.readOnlyInfo.readonly;
1168
1185
  }
1186
+ /**
1187
+ * Are we in the middle of batching ops together?
1188
+ */
1189
+ currentlyBatching() {
1190
+ return this.flushMode === runtime_definitions_1.FlushMode.TurnBased || this._orderSequentiallyCalls !== 0;
1191
+ }
1169
1192
  getQuorum() {
1170
1193
  return this.context.quorum;
1171
1194
  }
@@ -1316,10 +1339,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
1316
1339
  * Implementation of IGarbageCollectionRuntime::updateUsedRoutes.
1317
1340
  * After GC has run, called to notify this container's nodes of routes that are used in it.
1318
1341
  * @param usedRoutes - The routes that are used in all nodes in this Container.
1319
- * @param gcTimestamp - The time when GC was run that generated these used routes. If any node node becomes
1320
- * unreferenced as part of this GC run, this should be used to update the time when it happens.
1321
1342
  */
1322
- updateUsedRoutes(usedRoutes, gcTimestamp) {
1343
+ updateUsedRoutes(usedRoutes) {
1323
1344
  // Update our summarizer node's used routes. Updating used routes in summarizer node before
1324
1345
  // summarizing is required and asserted by the the summarizer node. We are the root and are
1325
1346
  // always referenced, so the used routes is only self-route (empty string).
@@ -1330,7 +1351,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
1330
1351
  dataStoreUsedRoutes.push(route);
1331
1352
  }
1332
1353
  }
1333
- return this.dataStores.updateUsedRoutes(dataStoreUsedRoutes, gcTimestamp);
1354
+ return this.dataStores.updateUsedRoutes(dataStoreUsedRoutes);
1334
1355
  }
1335
1356
  /**
1336
1357
  * When running GC in test mode, this is called to delete objects whose routes are unused. This enables testing
@@ -1716,8 +1737,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
1716
1737
  // issue than sending.
1717
1738
  // Please note that this does not change file format, so it can be disabled in the future if this
1718
1739
  // optimization no longer makes sense (for example, batch compression may make it less appealing).
1719
- if (type === ContainerMessageType.Attach &&
1720
- this.mc.config.getBoolean("Fluid.ContainerRuntime.disableAttachOpReorder") !== true) {
1740
+ if (this.currentlyBatching() && type === ContainerMessageType.Attach &&
1741
+ this.mc.config.getBoolean("Fluid.ContainerRuntime.enableAttachOpReorder") === true) {
1721
1742
  if (!this.pendingAttachBatch.push(message)) {
1722
1743
  // BatchManager has two limits - soft limit & hard limit. Soft limit is only engaged
1723
1744
  // when queue is not empty.
@@ -1742,18 +1763,18 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
1742
1763
  limit: this.pendingBatch.limit,
1743
1764
  });
1744
1765
  }
1745
- }
1746
- if (this._flushMode !== runtime_definitions_1.FlushMode.TurnBased) {
1747
- this.flush();
1748
- }
1749
- else if (!this.flushTrigger) {
1750
- this.flushTrigger = true;
1751
- // Queue a microtask to detect the end of the turn and force a flush.
1752
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
1753
- Promise.resolve().then(() => {
1754
- this.flushTrigger = false;
1766
+ if (!this.currentlyBatching()) {
1755
1767
  this.flush();
1756
- });
1768
+ }
1769
+ else if (!this.flushMicroTaskExists) {
1770
+ this.flushMicroTaskExists = true;
1771
+ // Queue a microtask to detect the end of the turn and force a flush.
1772
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
1773
+ Promise.resolve().then(() => {
1774
+ this.flushMicroTaskExists = false;
1775
+ this.flush();
1776
+ });
1777
+ }
1757
1778
  }
1758
1779
  }
1759
1780
  catch (error) {
@@ -1824,7 +1845,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
1824
1845
  }
1825
1846
  }
1826
1847
  /** Implementation of ISummarizerInternalsProvider.refreshLatestSummaryAck */
1827
- async refreshLatestSummaryAck(proposalHandle, ackHandle, summaryRefSeq, summaryLogger) {
1848
+ async refreshLatestSummaryAck(options) {
1849
+ const { proposalHandle, ackHandle, summaryRefSeq, summaryLogger } = options;
1828
1850
  const readAndParseBlob = async (id) => (0, driver_utils_1.readAndParse)(this.storage, id);
1829
1851
  // The call to fetch the snapshot is very expensive and not always needed.
1830
1852
  // It should only be done by the summarizerNode, if required.
@@ -1897,6 +1919,9 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
1897
1919
  // getPendingLocalState() is only exposed through Container.closeAndGetPendingLocalState(), so it's safe
1898
1920
  // to close current batch.
1899
1921
  this.flush();
1922
+ if (this._orderSequentiallyCalls !== 0) {
1923
+ throw new container_utils_1.UsageError("can't get state during orderSequentially");
1924
+ }
1900
1925
  const previousPendingState = this.context.pendingLocalState;
1901
1926
  if (previousPendingState) {
1902
1927
  return {