-
Notifications
You must be signed in to change notification settings - Fork 917
GODRIVER-3638 Prohibit using failpoints on sharded topologies. #2168
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
GODRIVER-3638 Prohibit using failpoints on sharded topologies. #2168
Conversation
3ab7bb9
to
9aa3b5a
Compare
API Change ReportNo changes found! |
🧪 Performance ResultsCommit SHA: de83205The following benchmark tests for version 689ebf5509236500071bcbf9 had statistically significant changes (i.e., |z-score| > 1.96):
For a comprehensive view of all microbenchmark results for this PR's commit, please check out the Evergreen perf task for this patch. |
9aa3b5a
to
7645c94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a safety mechanism to prevent unreliable failpoint usage on sharded MongoDB topologies by prohibiting SetFailPoint
calls unless explicitly allowed through a new option.
- Adds
AllowFailPointsOnSharded()
option to bypass the failpoint prohibition on sharded topologies - Modifies existing tests to either exclude sharded topologies or explicitly allow failpoints when needed
- Implements runtime validation in
SetFailPoint
to prevent accidental failpoint usage on sharded clusters
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
internal/integration/mtest/options.go | Adds AllowFailPointsOnSharded() method to enable failpoint usage on sharded topologies |
internal/integration/mtest/mongotest.go | Implements failpoint validation logic and stores the allowFailPointsOnSharded flag |
internal/integration/server_selection_prose_test.go | Uses AllowFailPointsOnSharded() for a test that requires failpoints on sharded topology |
internal/integration/retryable_writes_prose_test.go | Excludes sharded topology from one test and allows failpoints for another |
internal/integration/retryable_reads_prose_test.go | Excludes sharded topology from one test and allows failpoints for another |
internal/integration/sdam_prose_test.go | Excludes sharded topology from RTT monitoring test |
internal/integration/csot_prose_test.go | Excludes sharded topology from multiple GridFS timeout tests |
internal/integration/crud_prose_test.go | Excludes sharded topology from bulk write error handling tests |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
7645c94
to
de83205
Compare
GODRIVER-3638
Summary
SetFailPoint
is called whenmtest
is connected to a sharded topology.mtest
optionAllowFailPointsOnSharded
to allow using failpoints on sharded topologies.Background & Motivation
On sharded topologies, failpoints are applied to only a single mongoS. If the driver is connected to multiple mongoS instances, there's a possibility a different mongoS will be selected for a subsequent command. In that case, the failpoint is effectively ignored, leading to a test failure that is extremely difficult to diagnose.
Note that if we implement GODRIVER-3328, we no longer need to prohibit using failpoints on sharded topologies.