[SERVER-81591] Ensure that the secondary being stepped up in stopReplicationAndEnforceNewPrimaryToCatchUp is not stale Created: 29/Sep/23  Updated: 16/Nov/23  Resolved: 23/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0, 7.0.5

Type: Bug Priority: Major - P3
Reporter: Vishnu Kaushik Assignee: Vishnu Kaushik
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
is related to SERVER-59796 Wait for replication before stopping ... Closed
Assigned Teams:
Replication
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.1, v7.0, v6.0, v5.0
Sprint: Repl 2023-10-16, Repl 2023-10-30
Participants:
Linked BF Score: 5

 Description   

In the function stopReplicationAndEnforceNewPrimaryToCatchUp() still has the problem listed in SERVER-59796.

We need to make sure that the secondaries are actually caught up (which may be impossible, since the primary's PrimaryOnlyService may write at any point meaning the secondaries won't be caught up), or we need to make the "candidate secondary", the secondary that is passed in to the function to be made the new primary, ahead of the other secondary so that it wins the election.

One way I can think of performing the latter idea is to stop replication on the other secondaries and not on the candidate secondary. We can then perform a write on the primary and make sure that it has reached the candidate secondary. This will ensure that the candidate secondary is more up-to-date than any other secondary, and then it can win the election.



 Comments   
Comment by Githook User [ 10/Nov/23 ]

Author:

{'name': 'kauboy26', 'email': 'vishnu.kaushik@mongodb.com', 'username': 'kauboy26'}

Message: SERVER-81591 synchronize step up for PrimaryOnlyService in stopReplicationAndEnforceNewPrimaryToCatchUp
Branch: v7.1
https://github.com/mongodb/mongo/commit/f4b1d3c5e7e5e7a51a9fb7d7bd8cd5c796b73137

Comment by Githook User [ 10/Nov/23 ]

Author:

{'name': 'kauboy26', 'email': 'vishnu.kaushik@mongodb.com', 'username': 'kauboy26'}

Message: SERVER-81591 synchronize step up for PrimaryOnlyService in stopReplicationAndEnforceNewPrimaryToCatchUp
Branch: v7.0
https://github.com/mongodb/mongo/commit/7299da37905359366dfd485b1f59dc04574bc3ff

Comment by Githook User [ 20/Oct/23 ]

Author:

{'name': 'kauboy26', 'email': 'vishnu.kaushik@mongodb.com', 'username': 'kauboy26'}

Message: SERVER-81591 synchronize step up for PrimaryOnlyService in stopReplicationAndEnforceNewPrimaryToCatchUp
Branch: master
https://github.com/mongodb/mongo/commit/aa376b22b5d686fcca6cfdbd0f247529d1f9283f

Generated at Thu Feb 08 06:46:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.