Skip to content

Commit

Permalink
Hide part of code behind feature flag (#22529)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tyler-cai-microsoft committed Sep 16, 2024
1 parent c9d3b0c commit 0d787c8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/runtime/container-runtime/src/containerRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,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 = {
Expand Down Expand Up @@ -1583,8 +1584,8 @@ export class ContainerRuntime
);

let outerDeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
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,
Expand All @@ -1593,7 +1594,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,
Expand Down Expand Up @@ -2733,8 +2734,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;
Expand Down

0 comments on commit 0d787c8

Please sign in to comment.