[SERVER-14403] Change w:majority write concern to indicate a majority of voting nodes Created: 01/Jul/14  Updated: 11/Jul/16  Resolved: 21/Oct/14

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 2.7.8

Type: Improvement Priority: Major - P3
Reporter: Andy Schwerin Assignee: Matt Dannenberg
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-15060 Raise maximum number of nodes in a re... Closed
Related
related to SERVER-13070 Including arbiters when calculating r... Closed
is related to SERVER-14308 replace replsets/majority.js with c++... Closed
is related to SERVER-16357 Chunk migration pre-commit write conc... Closed
is related to SERVER-16597 Warn if no voting data bearing members Closed
Tested
tested by SERVER-15764 unit test new majority write behavior... Closed
Participants:

 Description   

In systems with non-voting nodes, confirmed w:majority writes might in some circumstances still roll back. This is because rollback is precluded by ensuring that a majority of voting nodes are aware of the write, but w:majority in a system with a high ratio of non-voting to voting nodes might not ensure this.

Conversely, on clusters with a high non-voting to voting ratio, w:majority is really too strong a requirement for committedness. Only the majority of the voting nodes need to respond, to be safe from rollback.

The work of this ticket is to change the meaning of "w:majority" to indicate acceptance of a write from the majority of voting nodes. No built-in write concern will provide the old functionality.



 Comments   
Comment by Andy Schwerin [ 01/Dec/14 ]

To satisfy a "majority" write concern in a typical cluster configuration, a write must propagate to more than half of the voting nodes. Since writes propagate to data-bearing nodes, but never propagate to arbiters, there is an exception to this rule. If the number of voting nodes that are data bearing is not more than half of the total number of voting nodes, then "majority" write concern is satisfied when a write propagates to all data-bearing, voting nodes. It should be noted that this exception is only safe if the number of arbiters is at most half of the total number of voting nodes, or if all non-voting nodes are also unelectable. This is among the several reasons why systems with more than 1 arbiter are strongly discouraged.

If v is the number of voting nodes, and a is the number of voting nodes that are arbiters, this is summarized as follows:

majority = min(floor(v/2) + 1, v - a)

Comment by Githook User [ 20/Oct/14 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-14403 translate w:'majority' to be internal tag pattern '$majority'
Branch: master
https://github.com/mongodb/mongo/commit/5f6b886405ed19ed5c779709c7f1581c1ed3eaed

Generated at Thu Feb 08 03:34:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.