[SERVER-50320] Fix cancellation races in initial syncer Created: 14/Aug/20  Updated: 29/Oct/23  Resolved: 16/Sep/20

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

Type: Bug Priority: Major - P3
Reporter: Matthew Russotto Assignee: Matthew Russotto
Resolution: Fixed Votes: 0
Labels: bkp
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-51597 Don't try to cleanly shut down initia... Closed
related to SERVER-44272 Resync data on replSetSyncFrom during... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0, v4.4
Sprint: Repl 2020-09-07, Repl 2020-09-21
Participants:
Linked BF Score: 10

 Description   

Cancelling an initial sync attempt may be missed if the code has run a callback but the callback has not yet acquired the initial syncer mutex. Since the callback is already running it won't be canceled, and the code has no way to know not to schedule the next callback.

This may be a matter of having _checkForShutdownAndConvertStatus_inlock check an overall status, though caution must be taken when a lock may be temporarily released in a callback, and also at least one call of _checkForShutdownAndConvertStatus_inlock occurs (despite the name) outside the lock.



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

Author:

{'name': 'Matthew Russotto', 'email': 'matthew.russotto@mongodb.com', 'username': 'mtrussotto'}

Message: SERVER-50320 Fix cancellation races in initial syncer

(cherry picked from commit 728fc1c52300cd409dd0619ebe669f8d0bd1835a)
Branch: v4.4
https://github.com/mongodb/mongo/commit/1357b2601db6c6358410933a3ad42200732187a2

Comment by Githook User [ 16/Sep/20 ]

Author:

{'name': 'Matthew Russotto', 'email': 'matthew.russotto@mongodb.com', 'username': 'mtrussotto'}

Message: SERVER-50320 Fix cancellation races in initial syncer
Branch: master
https://github.com/mongodb/mongo/commit/728fc1c52300cd409dd0619ebe669f8d0bd1835a

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