Skip to content

Commit

Permalink
Empty check before calling openContainer on it (#10044)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-huliu authored Apr 25, 2023
1 parent 5047cc9 commit 08fffd3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions fdbserver/Status.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2485,13 +2485,15 @@ ACTOR static Future<JsonBuilderObject> blobGranulesStatusFetcher(
// Mutation log backup
state std::string mlogsUrl = wait(getMutationLogUrl());
statusObj["mutation_log_location"] = mlogsUrl;
state Reference<IBackupContainer> bc = IBackupContainer::openContainer(mlogsUrl, {}, {});
BackupDescription desc = wait(timeoutError(bc->describeBackup(), 2.0));
if (desc.contiguousLogEnd.present()) {
statusObj["mutation_log_end_version"] = desc.contiguousLogEnd.get();
}
if (desc.minLogBegin.present()) {
statusObj["mutation_log_begin_version"] = desc.minLogBegin.get();
if (mlogsUrl != "") {
state Reference<IBackupContainer> bc = IBackupContainer::openContainer(mlogsUrl, {}, {});
BackupDescription desc = wait(timeoutError(bc->describeBackup(), 2.0));
if (desc.contiguousLogEnd.present()) {
statusObj["mutation_log_end_version"] = desc.contiguousLogEnd.get();
}
if (desc.minLogBegin.present()) {
statusObj["mutation_log_begin_version"] = desc.minLogBegin.get();
}
}
} catch (Error& e) {
if (e.code() == error_code_actor_cancelled)
Expand Down

0 comments on commit 08fffd3

Please sign in to comment.