[SERVER-47125] Require ReplSetMetadata.isPrimary, remove OplogQueryMetadata.primaryIndex Created: 25/Mar/20  Updated: 29/Oct/23  Resolved: 23/Apr/20

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

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: safe-reconfig-related
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Gantt End to End
has to be finished together with SERVER-47157 Require ReplSetMetadata.configTerm Closed
Problem/Incident
causes SERVER-50876 Coverity analysis defect 115609: Unin... Closed
Related
related to SERVER-47511 Prevent comparison of member indexes ... Backlog
is related to SERVER-47097 Add isPrimary to ReplSetMetadata and ... Closed
Backwards Compatibility: Minor Change
Sprint: Repl 2020-04-20, Repl 2020-05-04
Participants:

 Description   

The ReplSetMetadata.isPrimary field was introduced in 4.4, with logic to handle conversations with 4.2 nodes that lack the field. In 4.6 we can assume the field is present and remove this logic. I plan to store isPrimary as boost::optional<bool> in 4.4, it can be a bool in 4.6. Remove compatibility logic from ReplSetMetadata::readFromMetadata.

Remove from src/mongo/db/repl/README.md the claim that ReplSetHeartbeatResponse contains "The node the receiving node thinks is primary"? Check whether that claim is only about ReplSetMetadata.

The OplogQueryMetadata.primaryIndex field is meaningless, since we don't know what version of the replica set config the index is valid for, see SERVER-47097. Remove it.

Do not backport this ticket.



 Comments   
Comment by Githook User [ 23/Apr/20 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-47125 Don't trust OplogQueryMetadata.primaryIndex
Branch: master
https://github.com/mongodb/mongo/commit/33adeafe0448512e460b372baf621c8f94d5eb09

Comment by Githook User [ 15/Apr/20 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-47125 Remove ReplSetMetadata.primaryIndex, require isPrimary
Branch: master
https://github.com/mongodb/mongo/commit/60937495e5cd6c8d3186a16a46a27e521fc15a74

Comment by A. Jesse Jiryu Davis [ 06/Apr/20 ]

Blocked on 4.4.0-rc0, I think, so that multiversion tests will work with this change.

Generated at Thu Feb 08 05:13:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.