Skip to content

Revert "feat(container-runtime): enable batchId tracking by default with kill-switch and perf telemetry (#27216)"#27256

Merged
WillieHabi merged 1 commit into
microsoft:mainfrom
WillieHabi:revert-27216-batchid-tracking
May 7, 2026
Merged

Revert "feat(container-runtime): enable batchId tracking by default with kill-switch and perf telemetry (#27216)"#27256
WillieHabi merged 1 commit into
microsoft:mainfrom
WillieHabi:revert-27216-batchid-tracking

Conversation

@WillieHabi
Copy link
Copy Markdown
Contributor

Description

Reverts #27216 ("feat(container-runtime): enable batchId tracking by default with kill-switch and perf telemetry").

Restores the prior behavior where batchIdTrackingEnabled defaults to false and the Fluid.ContainerRuntime.enableBatchIdTracking opt-in flag continues to control the feature. The Fluid.ContainerRuntime.DisableBatchIdTracking kill-switch added by #27216 is removed along with the default-on rollout.

Reviewer Guidance

The review process is outlined on this wiki page.

…ith kill-switch and perf telemetry (microsoft#27216)"

This reverts commit 085f51b.
Copilot AI review requested due to automatic review settings May 7, 2026 15:00
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (433 lines, 11 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reverts PR #27216 by restoring batchId tracking to be opt-in (default false) and removing the default-on rollout behavior and kill-switch wiring. This updates container runtime behavior back to the previous gating model and adjusts snapshot/test infrastructure accordingly.

Changes:

  • Restore opt-in behavior for batchId tracking (Fluid.ContainerRuntime.enableBatchIdTracking) and remove kill-switch-based default enablement.
  • Simplify snapshot validation and replay-tool snapshot comparison (packageVersion normalization + remove special-casing for .recentBatchInfo).
  • Update runtime and end-to-end tests to reflect the reverted defaults and telemetry expectations.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
packages/tools/replay-tool/src/index.ts Removes export of normalizePackageVersions after reverting snapshot-comparison behavior.
packages/tools/replay-tool/src/helpers.ts Inlines packageVersion normalization into snapshot comparison logic.
packages/test/test-end-to-end-tests/src/test/fewerBatches.spec.ts Removes test-only kill-switch usage now that default behavior is reverted.
packages/test/test-end-to-end-tests/src/test/batching.spec.ts Updates config used during batching tests to align with reverted gating.
packages/test/snapshots/src/validateSnapshots.ts Removes .recentBatchInfo-ignoring comparison path and simplifies snapshot callback.
packages/test/functional-tests/src/test/containerRuntime.spec.ts Updates constructed test ops to reflect reverted runtime expectations.
packages/runtime/container-runtime/src/test/opLifecycle/duplicateBatchDetector.spec.ts Updates expectations for telemetry emitted by DuplicateBatchDetector after revert.
packages/runtime/container-runtime/src/test/containerRuntime.spec.ts Updates batch-id stamping/detection tests to match opt-in behavior.
packages/runtime/container-runtime/src/opLifecycle/duplicateBatchDetector.ts Removes per-window perf counters; retains only recent-batch count telemetry.
packages/runtime/container-runtime/src/containerRuntime.ts Restores opt-in batchId tracking enablement logic and allocates DuplicateBatchDetector conditionally.

Comment on lines +1894 to +1896
this.mc.config.getBoolean("Fluid.Container.enableOfflineFull") ??
this.mc.config.getBoolean("Fluid.ContainerRuntime.enableBatchIdTracking") ??
false;
Comment on lines +1898 to 1902
if (this.batchIdTrackingEnabled && this._flushMode !== FlushMode.TurnBased) {
const error = new UsageError("Offline mode is only supported in turn-based mode");
this.closeFn(error);
throw error;
}

// DuplicateBatchDetector maintains a cache of all batchIds/sequenceNumbers within the
// collab window. Skip allocating it when batchId tracking is off.
// DuplicateBatchDetection is only enabled if Offline Load is enabled
Comment on lines 103 to 111
let testContainerConfig: ITestContainerConfig = {
fluidDataObjectType: DataObjectFactoryType.Test,
registry,
loaderProps: {
configProvider: configProvider({
"Fluid.Container.enableOfflineFull": true,
"Fluid.ContainerRuntime.enableBatchIdTracking": true,
}),
},
};
Comment on lines +484 to +490
for (const enableBatchIdTracking of [true, undefined])
it("Replaying ops should resend in correct order, with batch ID if applicable", async () => {
const { runtime } = await ContainerRuntime.loadRuntime2({
context: getMockContext({
settings: variant.settings,
settings: {
"Fluid.ContainerRuntime.enableBatchIdTracking": enableBatchIdTracking, // batchId only stamped if true
},
containerErrors.push(error);
}
},
it("Can roundrip DuplicateBatchDetector state through summary/snapshot", async () => {
Comment on lines +2396 to +2403
// Duplicate Batch Detection requires OfflineLoad enabled
const settings_enableOfflineLoad = {
"Fluid.ContainerRuntime.enableBatchIdTracking": true,
};
await assert.rejects(
ContainerRuntime.loadRuntime2({
context: context as IContainerContext,
registry: new FluidDataStoreRegistry([]),
existing: false,
runtimeOptions: { flushMode: FlushMode.Immediate },
provideEntryPoint: mockProvideEntryPoint,
}),
(error: Error) => error instanceof UsageError,
);
assert.strictEqual(containerErrors.length, 1);
});

it("Can roundtrip DuplicateBatchDetector state through summary/snapshot", async () => {
// Duplicate Batch Detection is on by default in TurnBased mode.
const { runtime: containerRuntime } = await ContainerRuntime.loadRuntime2({
context: getMockContext() as IContainerContext,
context: getMockContext({
settings: settings_enableOfflineLoad,
}) as IContainerContext,
Comment on lines +89 to +90
* The packageVersion of the snapshot could be different from the reference snapshot. Replace all package
* package versions with X before we compare them.
@WillieHabi WillieHabi merged commit a503f87 into microsoft:main May 7, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants