[SERVER-41250] Reset the oldest timestamp if initial sync fails and starts another attempt Created: 20/May/19  Updated: 29/Oct/23  Resolved: 21/Jun/19

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

Type: Bug Priority: Major - P3
Reporter: Samyukta Lanka Assignee: Samyukta Lanka
Resolution: Fixed Votes: 0
Labels: isfz, prepare_initial_sync
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File initialSyncBug.js    
Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Steps To Reproduce:

I have attached the test that the initial sync fuzzer generated to repro this.

Sprint: STM 2019-06-03, Repl 2019-06-17, Repl 2019-07-01
Participants:

 Description   

When starting initial sync, we reset the node's lastAppliedOptime. However, we do not reset the oldest timestamp. This can be a problem if we fail an initial sync attempt, because when we try to write to the oplog, we can trigger this WT assertion that the commit timestamp of a storage transaction should not be before the oldest timestamp. Since the oldest timestamp was not reset after the attempt failed and the first oplog entry to apply during initial sync is a prepare oplog entry, the timestamp to write the oplog entry is incorrectly before the oldest timestamp.



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

Author:

{'name': 'Samy Lanka', 'email': 'samy.lanka@mongodb.com', 'username': 'lankas'}

Message: SERVER-41250 Reset the oldest timestamp if initial sync fails and starts another attempt

(cherry picked from commit ee746fb1672655b1cf6a1efff2b3f48ed8551e20)
Branch: v4.2
https://github.com/mongodb/mongo/commit/bfd06581418e5c74ed2267358a136a31259c3d29

Comment by Githook User [ 21/Jun/19 ]

Author:

{'name': 'Samy Lanka', 'username': 'lankas', 'email': 'samy.lanka@mongodb.com'}

Message: SERVER-41250 Reset the oldest timestamp if initial sync fails and starts another attempt
Branch: master
https://github.com/mongodb/mongo/commit/ee746fb1672655b1cf6a1efff2b3f48ed8551e20

Comment by Judah Schvimer [ 21/May/19 ]

This should be as easy as calling this StorageEngine::setOldestTimestamp() function.

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