[SERVER-77523] Use failpoint scopedIf in collection_cloner_test.cpp and tenant_collection_cloner_test.cpp Created: 26/May/23 Updated: 30/May/23 Resolved: 30/May/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Billy Donahue | Assignee: | Backlog - Replication Team |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Replication
|
| Participants: |
| Description |
|
This bug was found during a review of surrounding code. https://github.com/10gen/mongo/pull/13172/files/71cbb9540fa619f3aa07fdb7025274b0cc6fa920#r1206153406 I see there are many places using a particular style of FailPoint loop in these tests, which is, I believe, slow and not quite technically correct, and could be more compact. A typical instance looks like this.
Because there's a nested while loop inside, the executed lambda, we would be better off using scopedIf for these. Suggestion with several different improvements together.
The idea is that a checking a failpoint and taking action on it is a kind of transaction with the failpoint, during which it cannot toggle and cause an ABA problem. This pattern is repeated several times in these two test fies and would be a good candidate for refactor into a helper function. |