Bug fix: fdbbackup modify on a tag that has never been used before would result in an internal error.

This commit is contained in:
Stephen Atherton 2019-03-05 22:17:37 -08:00
parent 7f37e25c75
commit eed8dc816d
1 changed files with 6 additions and 0 deletions

View File

@ -2120,6 +2120,12 @@ ACTOR Future<Void> modifyBackup(Database db, std::string tagName, BackupModifyOp
tr->setOption(FDBTransactionOptions::LOCK_AWARE);
state Optional<UidAndAbortedFlagT> uidFlag = wait(tag.get(db));
if(!uidFlag.present()) {
fprintf(stderr, "No backup exists on tag '%s'\n", tagName.c_str());
throw backup_error();
}
if(uidFlag.get().second) {
fprintf(stderr, "Cannot modify aborted backup on tag '%s'\n", tagName.c_str());
throw backup_error();