[SERVER-55001] Node entering rollback during stopSet() in step_down_during_draining.js Created: 05/Mar/21  Updated: 29/Oct/23  Resolved: 09/Mar/21

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

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:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2021-03-08, Repl 2021-03-22
Participants:
Linked BF Score: 25

 Description   

The primary and secondary (which was the former primary) have diverging oplogs. This is because we have set the primary catchup timeout to 0 seconds, and we immediately step up the new primary and it writes a no-op start-of-term entry. As a result, the secondary goes into rollback.

There are two possible solutions:

1. (Prevent rollback) Wait until the 20020's start-of-term oplog entry has been fetched by all nodes, by pausing here. For example, adding a "sleep(3000);" prevented rollback. Of course, adding a sleep there wouldn't be a stable solution, but maybe we could add some kind of synchronization there so that all nodes have fetched 20020's entry. That way, when 20021 steps up, it will write its own start-of-term entry after 20020's entry, and the two oplogs will not diverge.

2. (Work with possibility of rollback) Change step 9 to be "w: 3", here. After this line, 20020 and 20022 should have completed rollback if they rolled back, and the three nodes should be in sync.



 Comments   
Comment by Githook User [ 09/Mar/21 ]

Author:

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

Message: SERVER-55001 Allow rollback to complete before calling stopSet()
Branch: master
https://github.com/mongodb/mongo/commit/d09c95567beeb791e934a5ccece41984360bae9f

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