@fluidframework/container-runtime 2.0.0-internal.7.0.1 → 2.0.0-internal.7.0.3
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.
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +6 -2
- package/dist/containerRuntime.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +4 -1
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +7 -2
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +8 -3
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +20 -8
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/index.d.ts +1 -1
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +3 -1
- package/dist/gc/index.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts +10 -2
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +23 -3
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +0 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +2 -1
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +6 -2
- package/lib/containerRuntime.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +5 -2
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +7 -2
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +7 -2
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +21 -9
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/index.d.ts +1 -1
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +1 -1
- package/lib/gc/index.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts +10 -2
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +23 -3
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +0 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +2 -1
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +15 -15
- package/src/containerRuntime.ts +11 -2
- package/src/gc/gcConfigs.ts +8 -2
- package/src/gc/gcDefinitions.ts +10 -2
- package/src/gc/gcTelemetry.ts +28 -17
- package/src/gc/index.ts +2 -0
- package/src/opLifecycle/opGroupingManager.ts +34 -2
- package/src/opLifecycle/outbox.ts +4 -2
- package/src/packageVersion.ts +1 -1
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils";
|
|
7
7
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
8
|
+
import { createChildLogger } from "@fluidframework/telemetry-utils";
|
|
9
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
8
10
|
import { ContainerMessageType } from "../messageTypes";
|
|
9
11
|
import { IBatch } from "./definitions";
|
|
10
12
|
|
|
@@ -26,16 +28,35 @@ function isGroupContents(opContents: any): opContents is IGroupedBatchMessageCon
|
|
|
26
28
|
return opContents?.type === OpGroupingManager.groupedBatchOp;
|
|
27
29
|
}
|
|
28
30
|
|
|
31
|
+
export interface OpGroupingManagerConfig {
|
|
32
|
+
readonly groupedBatchingEnabled: boolean;
|
|
33
|
+
readonly opCountThreshold: number;
|
|
34
|
+
readonly reentrantBatchGroupingEnabled: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
29
37
|
export class OpGroupingManager {
|
|
30
38
|
static readonly groupedBatchOp = "groupedBatch";
|
|
39
|
+
private readonly logger;
|
|
31
40
|
|
|
32
|
-
constructor(private readonly
|
|
41
|
+
constructor(private readonly config: OpGroupingManagerConfig, logger: ITelemetryBaseLogger) {
|
|
42
|
+
this.logger = createChildLogger({ logger, namespace: "OpGroupingManager" });
|
|
43
|
+
}
|
|
33
44
|
|
|
34
45
|
public groupBatch(batch: IBatch): IBatch {
|
|
35
|
-
if (
|
|
46
|
+
if (!this.shouldGroup(batch)) {
|
|
36
47
|
return batch;
|
|
37
48
|
}
|
|
38
49
|
|
|
50
|
+
if (batch.content.length >= 1000) {
|
|
51
|
+
this.logger.sendTelemetryEvent({
|
|
52
|
+
eventName: "GroupLargeBatch",
|
|
53
|
+
length: batch.content.length,
|
|
54
|
+
threshold: this.config.opCountThreshold,
|
|
55
|
+
reentrant: batch.hasReentrantOps,
|
|
56
|
+
referenceSequenceNumber: batch.content[0].referenceSequenceNumber,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
39
60
|
for (const message of batch.content) {
|
|
40
61
|
if (message.metadata) {
|
|
41
62
|
const keys = Object.keys(message.metadata);
|
|
@@ -86,4 +107,15 @@ export class OpGroupingManager {
|
|
|
86
107
|
compression: subMessage.compression,
|
|
87
108
|
}));
|
|
88
109
|
}
|
|
110
|
+
|
|
111
|
+
public shouldGroup(batch: IBatch): boolean {
|
|
112
|
+
return (
|
|
113
|
+
// Grouped batching must be enabled
|
|
114
|
+
this.config.groupedBatchingEnabled &&
|
|
115
|
+
// The number of ops in the batch must surpass the configured threshold
|
|
116
|
+
batch.content.length >= this.config.opCountThreshold &&
|
|
117
|
+
// Support for reentrant batches must be explicitly enabled
|
|
118
|
+
(this.config.reentrantBatchGroupingEnabled || batch.hasReentrantOps !== true)
|
|
119
|
+
);
|
|
120
|
+
}
|
|
89
121
|
}
|
|
@@ -30,7 +30,6 @@ export interface IOutboxConfig {
|
|
|
30
30
|
// The maximum size of a batch that we can send over the wire.
|
|
31
31
|
readonly maxBatchSizeInBytes: number;
|
|
32
32
|
readonly disablePartialFlush: boolean;
|
|
33
|
-
readonly enableGroupedBatching: boolean;
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
export interface IOutboxParameters {
|
|
@@ -267,7 +266,10 @@ export class Outbox {
|
|
|
267
266
|
}
|
|
268
267
|
|
|
269
268
|
const rawBatch = batchManager.popBatch();
|
|
270
|
-
if (
|
|
269
|
+
if (
|
|
270
|
+
rawBatch.hasReentrantOps === true &&
|
|
271
|
+
this.params.groupingManager.shouldGroup(rawBatch)
|
|
272
|
+
) {
|
|
271
273
|
assert(!this.rebasing, 0x6fa /* A rebased batch should never have reentrant ops */);
|
|
272
274
|
// If a batch contains reentrant ops (ops created as a result from processing another op)
|
|
273
275
|
// it needs to be rebased so that we can ensure consistent reference sequence numbers
|
package/src/packageVersion.ts
CHANGED