Fix backup worker crash due to aborted backup job

If a backup job is aborted, the "startedBackupWorkers" key can be cleared, thus
triggering the assertion failure.
This commit is contained in:
Jingyu Zhou 2020-03-23 21:11:25 -07:00
parent 243d078596
commit 82a1790776
1 changed files with 4 additions and 0 deletions

View File

@ -148,6 +148,10 @@ struct BackupData {
}
}
if (firstWorker) {
if (!workers.present()) {
TraceEvent("BackupWorkerDetectAbortedJob", self->myId).detail("BackupID", uid);
return Void();
}
ASSERT(workers.present() && workers.get().size() > 0);
std::vector<std::pair<int64_t, int64_t>>& v = workers.get();
v.erase(std::remove_if(v.begin(), v.end(),