[SERVER-46354] Abstract away 'votes' and 'newlyAdded' fields so it is impossible to mis-count votes Created: 24/Feb/20 Updated: 27/Oct/23 Resolved: 10/Jun/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Judah Schvimer | Assignee: | Vesselina Ratcheva (Inactive) |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Sprint: | Repl 2020-05-18, Repl 2020-06-15 |
| Participants: |
| Description |
|
Otherwise it would be easy to incorrectly calculate the majority number of the replica set by not considering the ‘newlyAdded’ field. |
| Comments |
| Comment by Vesselina Ratcheva (Inactive) [ 10/Jun/20 ] |
|
I concluded that no changes are needed here, as In order to find out if an individual node is voting or not, we use either either the isVoter or the getNumVotes (one uses the other, and the only real difference is that one returns a bool and the other an int). For purposes like write concern satisfiability, we use tags. There was a point where we weren't updating the tags along with changes to newlyAdded ( The MemberConfig class also has a getNewlyAdded() method, but it is not used outside of it. I went through and enumerated/audited all places that I could think of that need some sort of voter check or count. All of them are using the above methods (or derivatives). ReplSetConfig:
repl_set_config_checks.cpp:
QuorumChecker:
VoteRequester:
TopologyCoordinator: (too many to enumerate, so I'm summarizing some of those)
ReplicationCoordinator:
|