[SERVER-58780] [v4.4] Ensure that _shouldSetStableTimestamp gets restored to true if replSetInitiate fails Created: 22/Jul/21  Updated: 29/Oct/23  Resolved: 22/Sep/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.2.18, 4.4.10

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

Issue Links:
Backports
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2, v4.0
Sprint: Repl 2021-08-23, Repl 2021-09-06, Repl 2021-09-20, Repl 2021-10-04
Participants:
Case:

 Description   

It's possible for us to enter a state where _shouldSetStableTimestamp inadvertently gets set to false forever. This can only happen if the client incorrectly used replSetInitiate, but the side effects can cause us to never set the stableTimestamp, even if we are a healthy secondary.

This code is specific to eMRC=false, so we can remove the code in 5.0+ but will have to backport a different fix to previous versions.

This case should be reproducible with eMRC=false by:

  • Starting a new node and running replSetInitiate with an invalid config, which would fail processReplSetInitiate after setting _shouldSetStableTimestamp to false.
  • Add this node to an existing cluster. After going through initial sync, we should observe that this new node never advances its stableTS.
  • If we restart the node, we should observe that it enters initial sync again.


 Comments   
Comment by Githook User [ 12/Oct/21 ]

Author:

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

Message: SERVER-58780: Ensure that _shouldSetStableTimestamp restores to true if replSetInitiate fails

(cherry picked from commit 75e59101ebc9d8a4633b270a3fd44d6e2058a1b9)
Branch: v4.2
https://github.com/mongodb/mongo/commit/6427bb01da49015bbac8e6774aea4e90993053ae

Comment by Githook User [ 22/Sep/21 ]

Author:

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

Message: SERVER-58780: Ensure that _shouldSetStableTimestamp restores to true if replSetInitiate fails
Branch: v4.4
https://github.com/mongodb/mongo/commit/75e59101ebc9d8a4633b270a3fd44d6e2058a1b9

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