Skip to content

Commit

Permalink
refactor: removed reentrantBatchGroupingEnabled
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioJGMsoft committed Jan 7, 2025
1 parent 34904dd commit 3e2484f
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 31 deletions.
3 changes: 0 additions & 3 deletions packages/runtime/container-runtime/src/containerRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1675,9 +1675,6 @@ export class ContainerRuntime
groupedBatchingEnabled: this.groupedBatchingEnabled,
opCountThreshold:
this.mc.config.getNumber("Fluid.ContainerRuntime.GroupedBatchingOpCount") ?? 2,
reentrantBatchGroupingEnabled:
this.mc.config.getBoolean("Fluid.ContainerRuntime.GroupedBatchingReentrancy") ??
true,
},
this.mc.logger,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export function isGroupedBatch(op: ISequencedDocumentMessage): boolean {
export interface OpGroupingManagerConfig {
readonly groupedBatchingEnabled: boolean;
readonly opCountThreshold: number;
readonly reentrantBatchGroupingEnabled: boolean;
}

export class OpGroupingManager {
Expand Down Expand Up @@ -156,9 +155,8 @@ export class OpGroupingManager {
this.config.groupedBatchingEnabled &&
// The number of ops in the batch must surpass the configured threshold
// or be empty (to allow for empty batches to be grouped)
(batch.messages.length === 0 || batch.messages.length >= this.config.opCountThreshold) &&
// Support for reentrant batches must be explicitly enabled
(this.config.reentrantBatchGroupingEnabled || batch.hasReentrantOps !== true)
(batch.messages.length === 0 || batch.messages.length >= this.config.opCountThreshold)
// Support for reentrant batches will be on by default
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ describe("OpGroupingManager", () => {
{
groupedBatchingEnabled: option.enabled,
opCountThreshold: option.tooSmall === true ? 10 : 2,
reentrantBatchGroupingEnabled: option.reentryEnabled ?? false,
},
mockLogger,
).shouldGroup(createBatch(5, option.reentrant)),
Expand All @@ -90,7 +89,6 @@ describe("OpGroupingManager", () => {
{
groupedBatchingEnabled: false,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: false,
},
mockLogger,
).groupBatch(createBatch(5));
Expand All @@ -102,7 +100,6 @@ describe("OpGroupingManager", () => {
{
groupedBatchingEnabled: true,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: false,
},
mockLogger,
).groupBatch(createBatch(5));
Expand All @@ -123,7 +120,6 @@ describe("OpGroupingManager", () => {
{
groupedBatchingEnabled: true,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: false,
},
mockLogger,
).groupBatch(createBatch(5, false, false, batchId));
Expand All @@ -137,7 +133,6 @@ describe("OpGroupingManager", () => {
{
groupedBatchingEnabled: false,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: false,
},
mockLogger,
).createEmptyGroupedBatch("resubmittingBatchId", 0);
Expand All @@ -150,7 +145,6 @@ describe("OpGroupingManager", () => {
{
groupedBatchingEnabled: true,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: false,
},
mockLogger,
).createEmptyGroupedBatch(batchId, 0);
Expand All @@ -169,7 +163,6 @@ describe("OpGroupingManager", () => {
{
groupedBatchingEnabled: true,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: false,
},
mockLogger,
).shouldGroup({
Expand All @@ -187,7 +180,6 @@ describe("OpGroupingManager", () => {
{
groupedBatchingEnabled: true,
opCountThreshold: 10,
reentrantBatchGroupingEnabled: false,
},
mockLogger,
).groupBatch(createBatch(5));
Expand All @@ -200,7 +192,6 @@ describe("OpGroupingManager", () => {
{
groupedBatchingEnabled: true,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: false,
},
mockLogger,
).groupBatch(createBatch(5, false, true));
Expand All @@ -213,7 +204,6 @@ describe("OpGroupingManager", () => {
{
groupedBatchingEnabled: true,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: false,
},
mockLogger,
).groupBatch(createBatch(5, false, true, "batchId"));
Expand All @@ -227,7 +217,6 @@ describe("OpGroupingManager", () => {
{
groupedBatchingEnabled: true,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: true,
},
mockLogger,
);
Expand Down Expand Up @@ -280,7 +269,6 @@ describe("OpGroupingManager", () => {
{
groupedBatchingEnabled: true,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: true,
},
mockLogger,
);
Expand All @@ -299,7 +287,6 @@ describe("OpGroupingManager", () => {
{
groupedBatchingEnabled: false,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: true,
},
mockLogger,
);
Expand Down Expand Up @@ -344,7 +331,6 @@ describe("OpGroupingManager", () => {
{
groupedBatchingEnabled: false,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: true,
},
mockLogger,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ describe("Outbox", () => {
params.opGroupingConfig ?? {
groupedBatchingEnabled: false,
opCountThreshold: Infinity,
reentrantBatchGroupingEnabled: false,
},
mockLogger,
),
Expand Down Expand Up @@ -326,7 +325,6 @@ describe("Outbox", () => {
opGroupingConfig: {
groupedBatchingEnabled: true,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: true,
},
});
currentSeqNumbers.referenceSequenceNumber = 0;
Expand Down Expand Up @@ -358,7 +356,6 @@ describe("Outbox", () => {
opGroupingConfig: {
groupedBatchingEnabled: true,
opCountThreshold: 3,
reentrantBatchGroupingEnabled: true,
},
});
// Flush 1 - resubmit multi-message batch including ID Allocation
Expand Down Expand Up @@ -1009,7 +1006,6 @@ describe("Outbox", () => {
opGroupingConfig: {
groupedBatchingEnabled: false,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: true,
},
});

Expand All @@ -1032,7 +1028,6 @@ describe("Outbox", () => {
opGroupingConfig: {
groupedBatchingEnabled: true,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: true,
},
});

Expand All @@ -1057,7 +1052,6 @@ describe("Outbox", () => {
opGroupingConfig: {
groupedBatchingEnabled: true,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: true,
},
});

Expand All @@ -1080,7 +1074,6 @@ describe("Outbox", () => {
opGroupingConfig: {
groupedBatchingEnabled: false,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: true,
},
});

Expand All @@ -1103,7 +1096,6 @@ describe("Outbox", () => {
opGroupingConfig: {
groupedBatchingEnabled: true,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: true,
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ describe("RemoteMessageProcessor", () => {
{
groupedBatchingEnabled: true,
opCountThreshold: Infinity,
reentrantBatchGroupingEnabled: false,
},
logger,
),
Expand Down Expand Up @@ -130,7 +129,6 @@ describe("RemoteMessageProcessor", () => {
{
groupedBatchingEnabled: true,
opCountThreshold: 2,
reentrantBatchGroupingEnabled: false,
},
mockLogger,
);
Expand Down

0 comments on commit 3e2484f

Please sign in to comment.