Skip to content

Commit

Permalink
[Port 2.1] Hide part of code behind feature flag (#22529) (#22539)
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 1571e0c commit f1c23fc
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 @@ -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 = {
Expand Down Expand Up @@ -1558,8 +1559,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 @@ -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,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f1c23fc

Please sign in to comment.