[DRIVERS-228] Use electionId to detect stale primaries. Created: 05/May/15 Updated: 15/Apr/19 Resolved: 04/Oct/16 |
|
| Status: | Closed |
| Project: | Drivers |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Barrie Segal | Assignee: | Barrie Segal |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Driver Compliance: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Drivers should remember greatest electionId seen, and disbelieve primaries with electionIds that aren't greater. electionId (in isMaster response) will be backported to 2.6.x. Justification: only one election per 30 secs, servers must have clocks synced within 30 sec and run 3.0+ (or the 2.6.x mongod with the backport) for read-your-writes consistency with w: "majority" and primary reads. Set false primaries to state "Unknown", will be re-checked by next periodic monitoring Justification: will step down and roll back soon, remains a primary with obsolete electionId until then |
| Comments |
| Comment by Bernie Hackett [ 11/May/15 ] | ||||||||||||||||
|
See the spec changes in this commit for a full explanation: https://github.com/mongodb/specifications/commit/becdb2e18e1bd67c5bdaadb04f719d5cd1a03867 | ||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 06/May/15 ] | ||||||||||||||||
|
Updated YAML tests are now tagged "server-discovery-tests-2015-05-11": In the new tests, server descriptions include an "electionId" field; its format is an extended-JSON ObjectId:
Or if the server doesn't report one:
|