[SERVER-64327] Stepdown hook needs to handle stepup race Created: 08/Mar/22  Updated: 29/Oct/23  Resolved: 24/Feb/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Matthew Russotto Assignee: Jiawei Yang
Resolution: Fixed Votes: 0
Labels: repl-shortlist
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Assigned Teams:
Replication
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2023-03-06
Participants:
Linked BF Score: 0

 Description   

It appears the continuous stepdown hook can get in a situation where

1) It steps up a secondary.

2) The secondary becomes primary, but is slow to get all the way to writable primary (e.g. due to catch-up)

3) The hook steps up another secondary

4) Election fails

5) The hook goes to step up the original primary, which is fine (it's already primary).

6) The primary finishes catch-up, and steps down due to the term change.

7) We're now without a primary until election timeout expires. (very bad with high election timeout).

We should also add logging to the hook so all these steps are visible.



 Comments   
Comment by Githook User [ 24/Feb/23 ]

Author:

{'name': 'Jiawei Yang', 'email': 'jiawei.yang@mongodb.com', 'username': 'YoungYang0820'}

Message: SERVER-64327 wait until old primary becomes writable in stepdown hook
Branch: master
https://github.com/mongodb/mongo/commit/a9b44d71b911f6bd5989f13ea278aabd83fab03d

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