[SERVER-29949] InitialSyncerResetsOptimesOnNewAttempt unit test should set optime before starting initial syncer Created: 30/Jun/17  Updated: 30/Oct/23  Resolved: 14/Jul/17

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 3.4.15, 3.5.11

Type: Bug Priority: Minor - P4
Reporter: William Schultz (Inactive) Assignee: William Schultz (Inactive)
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:
v3.4
Participants:
Linked BF Score: 0

 Description   

This unit test has a slight race condition. It calls _setMyLastOptime after calling InitialSyncer::startup(). InitialSyncer::startup() schedules _startInitialSyncAttempt to be run immediately, and if that function gets run before _setMyLastOptime is called in the unit test, the assertion will fail. This can be fixed by setting the optime before the InitialSyncer is started.



 Comments   
Comment by Githook User [ 24/Apr/18 ]

Author:

{'email': 'william.schultz@mongodb.com', 'username': 'will62794', 'name': 'William Schultz'}

Message: SERVER-29949 Fix race condition in InitialSyncerResetsOptimes unit test

(cherry picked from commit e0b06a9da3c0c6071f4e636f3c3ba3e8851c5db0)
Branch: v3.4
https://github.com/mongodb/mongo/commit/5390e6754a7184a97025f8a600160b9ce4ee5698

Comment by Githook User [ 14/Jul/17 ]

Author:

{u'username': u'will62794', u'name': u'William Schultz', u'email': u'william.schultz@mongodb.com'}

Message: SERVER-29949 Fix race condition in InitialSyncerResetsOptimes unit test
Branch: master
https://github.com/mongodb/mongo/commit/e0b06a9da3c0c6071f4e636f3c3ba3e8851c5db0

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