The MongoDB replica tests pause replication for certain before they write #372

Merged
claude merged 2 commits from feature/352-mongo-replica-pause into develop 2026-11-12 00:56:46 -05:00
Owner

The MongoDB replica-set test host now confirms that both secondaries hold a batch before a pause returns, so a write a test makes right after the pause cannot become visible on a replica. Test-host code only; no product change.

  • Cause: MongoDbReplicaSetEngineHost.PauseReplicationAsync set the pauseBatchApplicationBeforeCompletion fail point and returned. A batch already in flight can still finish and carry the next write. The set also allowed chained replication, so one secondary could sync from the other, paused one.
  • Fix: the pause records each secondary's fail-point count, writes a probe document on the primary and waits server-side (waitForFailPoint, 30 s limit) until each secondary has entered the fail point again. The set starts with chainingAllowed: false, so both secondaries read the primary's oplog directly. The tests are unchanged.
  • Not reproduced: the exact failure the issue names (an in-flight batch applying the write) could not be forced. The chaining problem was seen: about 3 of 24 runs of an intermediate version timed out waiting for a secondary that synced from the other one.

Verified:

  • RewriteCache_RightAfterAnApiSaveWhileReplicationIsPaused_AnswersFromThePrimary passed 10/10 in the coder's runs and 5/5 in the verifier's, in the CI container.
  • Every MongoDbReplica* test passed 21/21, in both runs.
  • The build has 0 warnings and csharpier is clean.
  • The verifier accepted the first commit. The second commit adds one sentence to the pause method's remarks (resume before pausing again) and was not re-verified.

Closes #352

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

The MongoDB replica-set test host now confirms that both secondaries hold a batch before a pause returns, so a write a test makes right after the pause cannot become visible on a replica. Test-host code only; no product change. - **Cause:** `MongoDbReplicaSetEngineHost.PauseReplicationAsync` set the `pauseBatchApplicationBeforeCompletion` fail point and returned. A batch already in flight can still finish and carry the next write. The set also allowed chained replication, so one secondary could sync from the other, paused one. - **Fix:** the pause records each secondary's fail-point count, writes a probe document on the primary and waits server-side (`waitForFailPoint`, 30 s limit) until each secondary has entered the fail point again. The set starts with `chainingAllowed: false`, so both secondaries read the primary's oplog directly. The tests are unchanged. - **Not reproduced:** the exact failure the issue names (an in-flight batch applying the write) could not be forced. The chaining problem was seen: about 3 of 24 runs of an intermediate version timed out waiting for a secondary that synced from the other one. **Verified:** - `RewriteCache_RightAfterAnApiSaveWhileReplicationIsPaused_AnswersFromThePrimary` passed 10/10 in the coder's runs and 5/5 in the verifier's, in the CI container. - Every `MongoDbReplica*` test passed 21/21, in both runs. - The build has 0 warnings and csharpier is clean. - The verifier accepted the first commit. The second commit adds one sentence to the pause method's remarks (resume before pausing again) and was not re-verified. Closes #352 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Closes #352

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The MongoDB replica test host says a pause must be resumed before the next pause
All checks were successful
Build / Pack and Push NuGet Packages (dhcp) (push) Successful in -2m3s
Build / Pack and Push NuGet Packages (dns-core) (push) Successful in -2m0s
Build / Stage Draft Release (pull_request) Successful in -2m33s
Build / Pack and Push NuGet Packages (common) (pull_request) Successful in -2m23s
Build / Pack and Push NuGet Packages (dns-server) (push) Successful in -1m57s
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Successful in -2m8s
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Successful in -1m58s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Successful in -1m53s
Build / Build Binary (linux-amd64) (push) Successful in -1m6s
Build / Build Binary (linux-arm64) (push) Successful in -1m5s
Build / Build Binary (macos-arm64) (push) Successful in -40s
Build / Build Binary (macos-amd64) (push) Successful in -35s
Build / Build Binary (windows-amd64) (push) Successful in -30s
Build / Smoke Test the Windows Binary (push) Successful in 15s
Build / Build Binary (linux-amd64) (pull_request) Successful in -19s
Build / Build Binary (linux-arm64) (pull_request) Successful in -20s
Build / Build Binary (macos-amd64) (pull_request) Successful in -1m7s
Build / Build Binary (macos-arm64) (pull_request) Successful in -33s
Build / Build Binary (windows-amd64) (pull_request) Successful in -36s
Build / Smoke Test the Windows Binary (pull_request) Successful in 15s
Build / Build Arch Linux Packages (push) Successful in -2m6s
Build / Build and Push Image (push) Successful in -2m13s
Build / Build Arch Linux Packages (pull_request) Successful in -2m19s
Build / Build and Test Deb and RPM Packages (push) Successful in 4s
Build / Build and Push Image (pull_request) Successful in -1m55s
Build / Build and Test Deb and RPM Packages (pull_request) Successful in 2s
Build / Publish Release (push) Successful in -2m30s
Build / Pipeline (push) Successful in 0s
Build / Publish Release (pull_request) Successful in -2m32s
Build / Pipeline (pull_request) Successful in 0s
f1b82882ca
Refs #352

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit 72904c2105 into develop 2026-11-12 00:56:46 -05:00
claude deleted branch feature/352-mongo-replica-pause 2026-11-12 00:56:46 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil!372
No description provided.