From f1c23fc6a0d93d6892a11e9da59c393c4439fcf6 Mon Sep 17 00:00:00 2001 From: tyler-cai-microsoft <90650728+tyler-cai-microsoft@users.noreply.github.com> Date: Wed, 18 Sep 2024 12:55:50 -0700 Subject: [PATCH] [Port 2.1] Hide part of code behind feature flag (#22529) (#22539) Original: https://github.com/microsoft/FluidFramework/pull/22529 Part of a hotfix There is some minimum sequence number shenanigans going on. Not exactly sure, but we want to be able to safely turn off the feature. --- .../runtime/container-runtime/src/containerRuntime.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/runtime/container-runtime/src/containerRuntime.ts b/packages/runtime/container-runtime/src/containerRuntime.ts index 9646cbb02524..e17f377914ab 100644 --- a/packages/runtime/container-runtime/src/containerRuntime.ts +++ b/packages/runtime/container-runtime/src/containerRuntime.ts @@ -1267,6 +1267,7 @@ export class ContainerRuntime private dirtyContainer: boolean; private emitDirtyDocumentEvent = true; private readonly disableAttachReorder: boolean | undefined; + private readonly useDeltaManagerOpsProxy: boolean; private readonly closeSummarizerDelayMs: number; private readonly defaultTelemetrySignalSampleCount = 100; private readonly _perfSignalData: IPerfSignalReport = { @@ -1558,8 +1559,8 @@ export class ContainerRuntime ); let outerDeltaManager: IDeltaManager; - const useDeltaManagerOpsProxy = - this.mc.config.getBoolean("Fluid.ContainerRuntime.DeltaManagerOpsProxy") !== false; + this.useDeltaManagerOpsProxy = + this.mc.config.getBoolean("Fluid.ContainerRuntime.DeltaManagerOpsProxy") === true; // The summarizerDeltaManager Proxy is used to lie to the summarizer to convince it is in the right state as a summarizer client. const summarizerDeltaManagerProxy = new DeltaManagerSummarizerProxy( this.innerDeltaManager, @@ -1568,7 +1569,7 @@ export class ContainerRuntime // The DeltaManagerPendingOpsProxy is used to control the minimum sequence number // It allows us to lie to the layers below so that they can maintain enough local state for rebasing ops. - if (useDeltaManagerOpsProxy) { + if (this.useDeltaManagerOpsProxy) { const pendingOpsDeltaManagerProxy = new DeltaManagerPendingOpsProxy( summarizerDeltaManagerProxy, this.pendingStateManager, @@ -2677,8 +2678,9 @@ export class ContainerRuntime // Intercept to reduce minimum sequence number to the delta manager's minimum sequence number. // Sequence numbers are not guaranteed to follow any sort of order. Re-entrancy is one of those situations if ( + this.useDeltaManagerOpsProxy && this.deltaManager.minimumSequenceNumber < - messageWithContext.message.minimumSequenceNumber + messageWithContext.message.minimumSequenceNumber ) { messageWithContext.message.minimumSequenceNumber = this.deltaManager.minimumSequenceNumber;