-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Environment:
*Location*: https://docs.mongodb.com/v3.2/reference/method/rs.add/#behavior
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
*Referrer*: https://www.google.com/url?q=https%3A%2F%2Fdocs.mongodb.com%2Fv3.2%2Freference%2Fmethod%2Frs.add%2F%23behavior&sa=D&sntz=1&usg=AFQjCNHGRQXfmuSsIISK6zV-kLVO9DZcpg
*Screen Resolution*: 1440 x 900
*Location*: https://docs.mongodb.com/v3.2/reference/method/rs.add/#behavior *User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36 *Referrer*: https://www.google.com/url?q=https%3A%2F%2Fdocs.mongodb.com%2Fv3.2%2Freference%2Fmethod%2Frs.add%2F%23behavior&sa=D&sntz=1&usg=AFQjCNHGRQXfmuSsIISK6zV-kLVO9DZcpg *Screen Resolution*: 1440 x 900
The "Behavior" section says:
rs.add() can, in some cases, trigger an election for primary which will disconnect the shell. In such cases, the mongo shell displays an error even if the operation succeeds.
It is unclear what event could trigger an election, but a quick JIRA search seem to indicate that rs.add() that leads to reconfig with different priorities will trigger an election, while a pure additive action (e.g. adding a new member with default priority) will not trigger an election.
It may be helpful to include a summary of that situation into the docs to make the Behavior section more definitive and clearer.