Skip to content

Commit

Permalink
SERVER-83955 Fix wrong warning messages in ReplSetGetStatus command (…
Browse files Browse the repository at this point in the history
…#17731)

GitOrigin-RevId: ccd5461
  • Loading branch information
huayu-ouyang authored and MongoDB Bot committed Dec 21, 2023
1 parent 6b14834 commit f1e96fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
17 changes: 9 additions & 8 deletions src/mongo/db/repl/repl_set_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,17 @@ class CmdReplSetTest : public ReplSetCommand {
result.append("lastStableRecoveryTimestamp", ts.value());
}
} else {
LOGV2_WARNING(6100700,
"Failed to get last stable recovery timestamp due to {error}. "
"Note this is expected if shutdown is in progress.",
"error"_attr = "lock acquire timeout"_sd);
LOGV2_WARNING(
6100700,
"Failed to get last stable recovery timestamp due to lock acquire timeout. "
"Note this is expected if shutdown is in progress.");
}
} catch (const ExceptionForCat<ErrorCategory::CancellationError>& ex) {
LOGV2_WARNING(6100701,
"Failed to get last stable recovery timestamp due to {error}. Note "
"this is expected if shutdown is in progress.",
"error"_attr = redact(ex));
LOGV2_WARNING(
6100701,
"Failed to get last stable recovery timestamp due to cancellation error. Note "
"this is expected if shutdown is in progress.",
"error"_attr = redact(ex));
}
return true;
} else if (cmdObj.hasElement("restartHeartbeats")) {
Expand Down
14 changes: 7 additions & 7 deletions src/mongo/db/repl/replication_coordinator_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3317,15 +3317,15 @@ Status ReplicationCoordinatorImpl::processReplSetGetStatus(
lastStableRecoveryTimestamp = _storage->getLastStableRecoveryTimestamp(_service);
} else {
LOGV2_WARNING(6100702,
"Failed to get last stable recovery timestamp due to {error}. Note this "
"is expected if shutdown is in progress.",
"error"_attr = "lock acquire timeout"_sd);
"Failed to get last stable recovery timestamp due to lock acquire "
"timeout. Note this is expected if shutdown is in progress.");
}
} catch (const ExceptionForCat<ErrorCategory::CancellationError>& ex) {
LOGV2_WARNING(6100703,
"Failed to get last stable recovery timestamp due to {error}. Note this is "
"expected if shutdown is in progress.",
"error"_attr = redact(ex));
LOGV2_WARNING(
6100703,
"Failed to get last stable recovery timestamp due to cancellation error. Note this is "
"expected if shutdown is in progress.",
"error"_attr = redact(ex));
}

stdx::lock_guard<Latch> lk(_mutex);
Expand Down

0 comments on commit f1e96fa

Please sign in to comment.