[SERVER-27490] Stop consulting storage engine isDurable flag in ReplicationCoordinatorImpl and simplify ReplCoordTestFixture Created: 21/Dec/16 Updated: 05/Apr/17 Resolved: 07/Jan/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 3.5.2 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Andy Schwerin | Assignee: | Andy Schwerin |
| 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: | Sharding 2017-01-02 | ||||||||
| Participants: | |||||||||
| Description |
|
ReplicationCoordinatorImpl consults the storage engine's isDurable flag for two purposes:
In the first case, it is unnecessary to choose which optime to apply based on the isDurable flag. It is always safe and correct to present the applied optime, because if the node presenting it wins election, it will attempt to commit that applied optime. That means that voters may safely vote for that node. In the second case, using the value of the local node's storage engine's isDurable flag to adjust the meaning of w:majority is out of spec. Whether w:majority writes wait for journaling is a function only of the writeConcernMajorityJournalDefault flag when a write concern omits the "j" field. Further, the ReplCoordTestFixture and ReplicationCoordinatorImpl test-only constructor are more complex than necessary, and offer unused flexibility. This task also removes the unused behaviors and narrows the presented interface in order to make future enhancement easier. |
| Comments |
| Comment by Githook User [ 07/Jan/17 ] |
|
Author: {u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}Message: ... and simplify ReplCoordTestFixture ReplicationCoordinatorImpl consults the storage engine's isDurable flag for two purposes: 1. To choose whether to present the durable or applied optime when standing for 2. To decide how to interpret w:majority without an explicit j field when In the first case, it is unnecessary to choose which optime to apply based on In the second case, using the value of the local node's storage engine's This patch removes the unnecessary consultation of the isDurable flag, and |