Skip to content

TOOLS-4237 Convert oplog_rollover_test.js to a Go test#1022

Draft
autarch wants to merge 1 commit into
TOOLS-4237-failpoint-struct-interfacefrom
TOOLS-4237-oplog-rollover-go-test
Draft

TOOLS-4237 Convert oplog_rollover_test.js to a Go test#1022
autarch wants to merge 1 commit into
TOOLS-4237-failpoint-struct-interfacefrom
TOOLS-4237-oplog-rollover-go-test

Conversation

@autarch

@autarch autarch commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

This adds a new PauseUntilResumed failpoint that blocks the paused code until it's told to continue, instead of sleeping for a fixed
duration. This is used in the mongodump Dump method alongside the existing PauseBeforeDumping failpoint.

This lets us replace jstests/dump/oplog_rollover_test.js, which is racey and buggy, with deterministic Go code. Previously, we tried to make the oplog rollover within a 15-second pause window. If we couldn't cause a rollover in that time, the test fails. With this new failpoint, we can force mongodump to wait until we are sure we've caused a rollover.

autarch commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@autarch autarch force-pushed the TOOLS-4237-oplog-rollover-go-test branch from 20d4315 to fa45839 Compare July 9, 2026 16:08
@autarch autarch force-pushed the TOOLS-4237-failpoint-struct-interface branch from 2c4b1c4 to d601936 Compare July 9, 2026 16:08
@autarch autarch force-pushed the TOOLS-4237-oplog-rollover-go-test branch from fa45839 to 9a13c00 Compare July 9, 2026 16:17
@autarch autarch force-pushed the TOOLS-4237-failpoint-struct-interface branch from d601936 to 0f08f00 Compare July 9, 2026 16:17
Add a PauseUntilResumed failpoint that blocks the paused code until
externally released, instead of sleeping for a fixed duration, using
the Manager/Failpoint types from the previous commit. Wire it into
mongodump's Dump() alongside the existing PauseBeforeDumping.

Use it to replace jstests/dump/oplog_rollover_test.js with
TestOplogRollover in mongodump/oplog_dump_test.go. The JS test raced a
fixed 15-second sleep against a fixed amount of write load meant to
overflow a deliberately tiny (2MB) oplog, and needed five rounds of
"make this less racy" fixes over the years. That approach isn't
available against the Go integration tests' shared replica set anyway
(its oplog can't be resized below 990MB), and forcing genuine eviction
against it turned out to depend on WiredTiger checkpoint/oldest-timestamp
scheduling in ways that were empirically unpredictable even when
forcing checkpoints and using majority write concern.

Instead, the new test pauses mongodump after it captures its real
starting oplog timestamp, overwrites that timestamp with one guaranteed
not to exist in the oplog, and resumes. mongodump then runs its real
overflow-detection logic (checkOplogTimestampExists) deterministically,
without writing any data or depending on timing.
@autarch autarch force-pushed the TOOLS-4237-failpoint-struct-interface branch from 0f08f00 to a84239f Compare July 9, 2026 18:53
@autarch autarch force-pushed the TOOLS-4237-oplog-rollover-go-test branch from 9a13c00 to 1d8cda5 Compare July 9, 2026 18:53
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.

1 participant