Skip to content

Commit 6cc3cdd

Browse files
committed
PSMDB-1846 Ensure _inStorageChange reset in corner case
1 parent 23b6500 commit 6cc3cdd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/mongo/db/repl/initial_syncer_fcb.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2305,6 +2305,10 @@ void InitialSyncerFCB::_switchToDownloadedCallback(
23052305
startup_recovery::StartupRecoveryMode::kReplicaSetMember);
23062306
lock.lock();
23072307
if (!status.isOK()) {
2308+
// Corner case: we need to reset _inStorageChange flag here because
2309+
// _restoreStorageLocation will not be called in this case
2310+
_inStorageChange = false;
2311+
_inStorageChangeCondition.notify_all();
23082312
onCompletionGuard->setResultAndCancelRemainingWork_inlock(lock, status);
23092313
return;
23102314
}

0 commit comments

Comments
 (0)