[SERVER-24222] Update current known primary from command metadata Created: 19/May/16 Updated: 25/Jan/17 Resolved: 01/Jun/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 3.3.8 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Judah Schvimer | Assignee: | Siyuan Zhou |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Sprint: | Repl 15 (06/03/16) | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 0 | ||||||||||||
| Description |
|
When we process the metadata from commands such as finds from the fetcher, the current primary index is included, however we don't do anything with the index once we get it. This information would fix the race between heartbeats updating metadata and the fetcher checking the validity of its sync source. |
| Comments |
| Comment by Githook User [ 01/Jun/16 ] |
|
Author: {u'username': u'visualzhou', u'name': u'Siyuan Zhou', u'email': u'siyuan.zhou@mongodb.com'}Message: This reverts commit ed3f25ced04931525db8e2f11f8bdef7bf49992a. Fixed replication legacy test suite. |
| Comment by Githook User [ 31/May/16 ] |
|
Author: {u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}Message: Revert " This reverts commit 3dd8ba46bf2ce350b5e80b1b2b016a10007beb7b. |
| Comment by Githook User [ 27/May/16 ] |
|
Author: {u'username': u'visualzhou', u'name': u'Siyuan Zhou', u'email': u'siyuan.zhou@mongodb.com'}Message: |
| Comment by Siyuan Zhou [ 20/May/16 ] |
|
milkie, if we use latest metadata when deciding whether to change sync source, the logic that actually chooses sync source still uses stale _hbdata. Shall we consolidate the global view of the replset and use that for both? |
| Comment by Siyuan Zhou [ 19/May/16 ] |
|
The problem is in shouldChangeSyncSource(), where the fetcher response is more up-to-date than the heartbeat. When the upstream becomes the new primary, the upstream doesn't have a sync source, but the election winner announcement, a heartbeat, hasn't arrive yet. The easiest fix is to check is the heartbeat's term is up-to-date and only make decision when the heartbeat's term equals mine. judah.schvimer, milkie, correct me if I misunderstood. In the long term, I hope we can merge _hbdata into _slaveInfo. They duplicate the same information currently. |