TOOLS-4237 Convert oplog_rollover_test.js to a Go test#1022
Draft
autarch wants to merge 1 commit into
Draft
Conversation
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
20d4315 to
fa45839
Compare
2c4b1c4 to
d601936
Compare
fa45839 to
9a13c00
Compare
d601936 to
0f08f00
Compare
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.
0f08f00 to
a84239f
Compare
9a13c00 to
1d8cda5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This adds a new
PauseUntilResumedfailpoint that blocks the paused code until it's told to continue, instead of sleeping for a fixedduration. This is used in the mongodump
Dumpmethod alongside the existingPauseBeforeDumpingfailpoint.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.