mirror of
https://github.com/apple/foundationdb.git
synced 2025-06-03 03:41:53 +08:00
Merge pull request #3875 from sfc-gh-tclinkenbeard/add-incremental-backup-retry
Added retry loop for getReadVersion in IncrementalBackupWorkload
This commit is contained in:
commit
c79f88cf04
@ -71,8 +71,16 @@ struct IncrementalBackupWorkload : TestWorkload {
|
||||
if (self->waitForBackup) {
|
||||
state Reference<IBackupContainer> backupContainer;
|
||||
state UID backupUID;
|
||||
state Reference<ReadYourWritesTransaction> tr(new ReadYourWritesTransaction(cx));
|
||||
state Version v = wait(tr->getReadVersion());
|
||||
state Version v;
|
||||
state Transaction tr(cx);
|
||||
loop {
|
||||
try {
|
||||
wait(store(v, tr.getReadVersion()));
|
||||
break;
|
||||
} catch (Error& e) {
|
||||
wait(tr.onError(e));
|
||||
}
|
||||
}
|
||||
// Wait for backup container to be created and avoid race condition
|
||||
TraceEvent("IBackupWaitContainer");
|
||||
loop {
|
||||
@ -170,4 +178,4 @@ struct IncrementalBackupWorkload : TestWorkload {
|
||||
virtual void getMetrics(vector<PerfMetric>& m) {}
|
||||
};
|
||||
|
||||
WorkloadFactory<IncrementalBackupWorkload> IncrementalBackupWorkloadFactory("IncrementalBackup");
|
||||
WorkloadFactory<IncrementalBackupWorkload> IncrementalBackupWorkloadFactory("IncrementalBackup");
|
||||
|
Loading…
x
Reference in New Issue
Block a user