From 04ea94444094415aba7017085b0942f8b3b0a1e3 Mon Sep 17 00:00:00 2001 From: Alex Panov <8239356+alpaix@users.noreply.github.com> Date: Wed, 17 Aug 2022 17:06:48 -0700 Subject: [PATCH 1/4] Add e2e test to demo use of flush mode --- .../src/test/messageSize.spec.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/test/test-end-to-end-tests/src/test/messageSize.spec.ts b/packages/test/test-end-to-end-tests/src/test/messageSize.spec.ts index 2c07a9a13472..411282d9ab18 100644 --- a/packages/test/test-end-to-end-tests/src/test/messageSize.spec.ts +++ b/packages/test/test-end-to-end-tests/src/test/messageSize.spec.ts @@ -17,6 +17,7 @@ import { describeNoCompat, itExpects } from "@fluidframework/test-version-utils" import { IContainer, IErrorBase } from "@fluidframework/container-definitions"; import { ConfigTypes, IConfigProviderBase } from "@fluidframework/telemetry-utils"; import { GenericError } from "@fluidframework/container-utils"; +import { FlushMode } from "@fluidframework/runtime-definitions"; describeNoCompat("Message size", (getTestObjectProvider) => { const mapId = "mapId"; @@ -139,4 +140,14 @@ describeNoCompat("Message size", (getTestObjectProvider) => { assertMapValues(dataObject2map, messageCount, largeString); }); + + it("Batched small ops pass when batch is larger than max op size", async () => { + await setupContainers({ ...testContainerConfig, runtimeOptions: { flushMode: FlushMode.Immediate } }, {}); + const largeString = generateStringOfSize(500000); + const messageCount = 10; + setMapKeys(dataObject1map, messageCount, largeString); + await provider.ensureSynchronized(); + + assertMapValues(dataObject2map, messageCount, largeString); + }); }); From 8e55d8676cae704c9e910d26013e2467ea44a65d Mon Sep 17 00:00:00 2001 From: Alex Panov <8239356+alpaix@users.noreply.github.com> Date: Thu, 18 Aug 2022 10:13:16 -0700 Subject: [PATCH 2/4] override flush mode for azure clients --- packages/framework/fluid-static/src/rootDataObject.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/framework/fluid-static/src/rootDataObject.ts b/packages/framework/fluid-static/src/rootDataObject.ts index 48cf884c1009..e573a1a28161 100644 --- a/packages/framework/fluid-static/src/rootDataObject.ts +++ b/packages/framework/fluid-static/src/rootDataObject.ts @@ -10,6 +10,7 @@ import { } from "@fluidframework/aqueduct"; import { IContainerRuntime } from "@fluidframework/container-runtime-definitions"; import { IFluidLoadable } from "@fluidframework/core-interfaces"; +import { FlushMode } from "@fluidframework/runtime-definitions"; import { requestFluidObject } from "@fluidframework/runtime-utils"; import { ContainerSchema, @@ -156,7 +157,9 @@ export class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFacto {}, registryEntries, ); - super([rootDataObjectFactory.registryEntry], undefined, [defaultRouteRequestHandler(rootDataStoreId)]); + super([rootDataObjectFactory.registryEntry], undefined, [defaultRouteRequestHandler(rootDataStoreId)], + { flushMode: FlushMode.Immediate }, + ); this.rootDataObjectFactory = rootDataObjectFactory; this.initialObjects = schema.initialObjects; } From 190d86d0d42dd52361c24313bcdb7bd3ff2579e0 Mon Sep 17 00:00:00 2001 From: Alex Panov <8239356+alpaix@users.noreply.github.com> Date: Thu, 18 Aug 2022 16:08:40 -0700 Subject: [PATCH 3/4] disable new test for local driver --- packages/framework/fluid-static/src/rootDataObject.ts | 2 ++ .../test/test-end-to-end-tests/src/test/messageSize.spec.ts | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/framework/fluid-static/src/rootDataObject.ts b/packages/framework/fluid-static/src/rootDataObject.ts index e573a1a28161..80147fd3c77a 100644 --- a/packages/framework/fluid-static/src/rootDataObject.ts +++ b/packages/framework/fluid-static/src/rootDataObject.ts @@ -158,6 +158,8 @@ export class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFacto registryEntries, ); super([rootDataObjectFactory.registryEntry], undefined, [defaultRouteRequestHandler(rootDataStoreId)], + // temporary workaround to disable message batching until the message batch size issue is resolved + // resolution progress is tracked by the Feature 465 work item in AzDO { flushMode: FlushMode.Immediate }, ); this.rootDataObjectFactory = rootDataObjectFactory; diff --git a/packages/test/test-end-to-end-tests/src/test/messageSize.spec.ts b/packages/test/test-end-to-end-tests/src/test/messageSize.spec.ts index 411282d9ab18..5a84734a7bfc 100644 --- a/packages/test/test-end-to-end-tests/src/test/messageSize.spec.ts +++ b/packages/test/test-end-to-end-tests/src/test/messageSize.spec.ts @@ -141,7 +141,11 @@ describeNoCompat("Message size", (getTestObjectProvider) => { assertMapValues(dataObject2map, messageCount, largeString); }); - it("Batched small ops pass when batch is larger than max op size", async () => { + it("Batched small ops pass when batch is larger than max op size", async function() { + // flush mode is not applicable for the local driver + if (provider.driver.type === "local") { + this.skip(); + } await setupContainers({ ...testContainerConfig, runtimeOptions: { flushMode: FlushMode.Immediate } }, {}); const largeString = generateStringOfSize(500000); const messageCount = 10; From a88f06b9cc4395c9d81f64f8dfa769fc259c9551 Mon Sep 17 00:00:00 2001 From: Alex Panov <8239356+alpaix@users.noreply.github.com> Date: Thu, 18 Aug 2022 16:45:55 -0700 Subject: [PATCH 4/4] PR feedback --- packages/framework/fluid-static/src/rootDataObject.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/framework/fluid-static/src/rootDataObject.ts b/packages/framework/fluid-static/src/rootDataObject.ts index 80147fd3c77a..2edaa0cc38b2 100644 --- a/packages/framework/fluid-static/src/rootDataObject.ts +++ b/packages/framework/fluid-static/src/rootDataObject.ts @@ -157,7 +157,10 @@ export class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFacto {}, registryEntries, ); - super([rootDataObjectFactory.registryEntry], undefined, [defaultRouteRequestHandler(rootDataStoreId)], + super( + [rootDataObjectFactory.registryEntry], + undefined, + [defaultRouteRequestHandler(rootDataStoreId)], // temporary workaround to disable message batching until the message batch size issue is resolved // resolution progress is tracked by the Feature 465 work item in AzDO { flushMode: FlushMode.Immediate },