Skip to content

Commit

Permalink
[Port 2.0] Hide part of code behind feature flag (#22529) (#22537)
Browse files Browse the repository at this point in the history
Original: #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.
  • Loading branch information
tyler-cai-microsoft authored Sep 18, 2024
1 parent 8b98697 commit 2015c59
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 @@ -1251,6 +1251,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 @@ -1542,8 +1543,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 @@ -1552,7 +1553,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 @@ -2633,8 +2634,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 2015c59

Please sign in to comment.