Merge pull request #2205 from jzhou77/backup-fix

Fix format string with more portable code
This commit is contained in:
Meng Xu 2019-10-02 20:03:35 -07:00 committed by GitHub
commit 7599dd0093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -2186,7 +2186,7 @@ ACTOR Future<Void> runFastRestoreAgent(Database db, std::string tagName, std::st
std::string removePrefix) {
try {
state FileBackupAgent backupAgent;
state int64_t restoreVersion = -1;
state Version restoreVersion = invalidVersion;
if (ranges.size() > 1) {
fprintf(stderr, "Currently only a single restore range is supported!\n");
@ -2228,20 +2228,20 @@ ACTOR Future<Void> runFastRestoreAgent(Database db, std::string tagName, std::st
state Optional<RestorableFileSet> rset = wait(bc->getRestoreSet(restoreVersion));
if (!rset.present()) {
fprintf(stderr, "Insufficient data to restore to version %lld\n", restoreVersion);
fprintf(stderr, "Insufficient data to restore to version %" PRId64 "\n", restoreVersion);
throw restore_invalid_version();
}
// Display the restore information, if requested
if (verbose) {
printf("[DRY RUN] Restoring backup to version: %lld\n", (long long)restoreVersion);
printf("[DRY RUN] Restoring backup to version: %" PRId64 "\n", restoreVersion);
printf("%s\n", description.toString().c_str());
}
}
if (waitForDone && verbose) {
// If restore completed then report version restored
printf("Restored to version %lld%s\n", (long long)restoreVersion, (performRestore) ? "" : " (DRY RUN)");
printf("Restored to version %" PRId64 "%s\n", restoreVersion, (performRestore) ? "" : " (DRY RUN)");
}
} catch (Error& e) {
if (e.code() == error_code_actor_cancelled) throw;