[SERVER-29153] Make sure replica set nodes agree on which node is primary before doing writes in ShardingTest initialization Created: 12/May/17 Updated: 30/Oct/23 Resolved: 03/Apr/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 4.2.6, 3.6.18, 4.4.0-rc0, 4.0.18, 4.7.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Dianna Hohensee (Inactive) | Assignee: | Jack Mulrow |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | sharding-wfbf-day | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Backport Requested: |
v4.4, v4.2, v4.0, v3.6
|
||||||||
| Sprint: | Sharding 2020-04-20 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 12 | ||||||||
| Description |
|
This can occur during Replica Set primary election:
Followed by
roughly 10 seconds later. ShardingTest initialization does writes here and here that can fail if the config or shard steps down respectively. awaitNodesAgreeOnPrimary() seems appropriate to call before doing necessary config server writes. The shard writes (in the link above) does not appear to actually be necessary. It looks like the write followed by awaitReplication() was just a hack to wait for the replica set to finish setting up (https://github.com/mongodb/mongo/commit/69207258a19b68fbbbc1377f61b00a9124d78c90#diff-bcff736df8cd6507ce081e800d9d1dd0R168). In which case, we can just remove the write, which is outdated and not longer useful, and replace awaitSecondaryNodes with awaitNodesAgreeOnPrimary(), which is a lot more obvious of the intent and has the same effect. |
| Comments |
| Comment by Githook User [ 06/Apr/20 ] |
|
Author: {'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}Message: (cherry picked from commit 85a915d3b49c0cd0b106f40df55a68a2f6779de1) |
| Comment by Githook User [ 06/Apr/20 ] |
|
Author: {'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}Message: (cherry picked from commit 85a915d3b49c0cd0b106f40df55a68a2f6779de1) |
| Comment by Githook User [ 06/Apr/20 ] |
|
Author: {'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}Message: (cherry picked from commit 85a915d3b49c0cd0b106f40df55a68a2f6779de1) |
| Comment by Githook User [ 06/Apr/20 ] |
|
Author: {'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}Message: (cherry picked from commit 85a915d3b49c0cd0b106f40df55a68a2f6779de1) |
| Comment by Githook User [ 03/Apr/20 ] |
|
Author: {'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}Message: |