[SERVER-41479] replSetStepUp on primary should return errors if the node is stepping down Created: 03/Jun/19  Updated: 29/Oct/23  Resolved: 06/Jun/19

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.2.0-rc1, 4.3.1

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

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Sprint: Repl 2019-06-17
Participants:
Linked BF Score: 12

 Description   

Currently, if we run replSetStepUp againstĀ a primary, it won't start an election due to this check. And the replSetStepUp command returns success because the node is already primary.

However, this could race with stepdown. If the node is in the process of stepping down but hasn't yet changed its state, replSetStepUp still returns success because the node is still in primary state. We should make replSetStepUp behave like isMaster and take isSteppingDown() into account.



 Comments   
Comment by Githook User [ 06/Jun/19 ]

Author:

{'name': 'Lingzhi Deng', 'email': 'lingzhi.deng@mongodb.com', 'username': 'ldennis'}

Message: SERVER-41479: replSetStepUp on primary should return errors if the node is stepping down

(cherry picked from commit fbb3e0b7299d0b14ebff5641b3a6c672c18ad96d)
Branch: v4.2
https://github.com/mongodb/mongo/commit/9013cc245b2638583ac10e647670d5baed4a5e90

Comment by Githook User [ 06/Jun/19 ]

Author:

{'name': 'Lingzhi Deng', 'email': 'lingzhi.deng@mongodb.com', 'username': 'ldennis'}

Message: SERVER-41479: replSetStepUp on primary should return errors if the node is stepping down
Branch: master
https://github.com/mongodb/mongo/commit/fbb3e0b7299d0b14ebff5641b3a6c672c18ad96d

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