Bug fix in backup file termination, errors during sync() were being logged but then not thrown. This can cause a backup to appear to have a log or keyrange file in it but the temp file pointed to by the log/keyrange symbolic link was not successfully uploaded.

This commit is contained in:
Stephen Atherton 2017-11-01 01:16:16 -07:00
parent 87321f5017
commit acf747c41f
1 changed files with 3 additions and 15 deletions

View File

@ -852,22 +852,10 @@ namespace fileBackup {
} catch( Error &e ) {
if(e.code() == error_code_actor_cancelled)
throw;
TraceEvent("FBA_TruncateCloseFileSyncError").error(e);
state Transaction tr(cx);
loop {
try {
tr.setOption(FDBTransactionOptions::LOCK_AWARE);
Tuple t;
t.append(std::numeric_limits<Version>::max());
t.append(StringRef());
tr.set(t.pack().withPrefix(keyErrors), format("WARNING: Cannot sync file `%s' in container '%s'", fileName.c_str(), backupContainer.c_str()));
Void _ = wait( tr.commit() );
break;
} catch( Error &e ) {
Void _ = wait( tr.onError(e));
}
}
state Error err = e;
Void _ = wait(logError(cx, keyErrors, format("WARNING: Cannot sync file `%s' in container '%s' because of error '%s'", fileName.c_str(), backupContainer.c_str(), err.what())));
throw err;
}
file = Reference<IAsyncFile>();
return Void();