summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/sync_source_resolver.cpp
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2020-02-26 15:39:55 +0000
committerevergreen <evergreen@mongodb.com>2020-02-26 15:39:55 +0000
commitce4f6d6f6e0be8478e1f2f6f728dcc89f4b1e271 (patch)
treeab403b1b448488a2e9881551fdae0eae4ad157da /src/mongo/db/repl/sync_source_resolver.cpp
parentdbc00195a18a3aecbcb7b254c3de2056fe25aa24 (diff)
downloadmongo-ce4f6d6f6e0be8478e1f2f6f728dcc89f4b1e271.tar.gz
SERVER-46074 Improve log attributes for repl directory and bridge.cpp
Diffstat (limited to 'src/mongo/db/repl/sync_source_resolver.cpp')
-rw-r--r--src/mongo/db/repl/sync_source_resolver.cpp63
1 files changed, 30 insertions, 33 deletions
diff --git a/src/mongo/db/repl/sync_source_resolver.cpp b/src/mongo/db/repl/sync_source_resolver.cpp
index baba3e08744..a7e289e3996 100644
--- a/src/mongo/db/repl/sync_source_resolver.cpp
+++ b/src/mongo/db/repl/sync_source_resolver.cpp
@@ -226,8 +226,8 @@ Status SyncSourceResolver::_scheduleFetcher(std::unique_ptr<Fetcher> fetcher) {
} else {
LOGV2_ERROR(21776,
"Error scheduling fetcher to evaluate host as sync source, "
- "host:{fetcher_getSource}, error: {status}",
- "fetcher_getSource"_attr = fetcher->getSource(),
+ "host:{source}, error: {status}",
+ "source"_attr = fetcher->getSource(),
"status"_attr = status);
}
return status;
@@ -239,10 +239,10 @@ OpTime SyncSourceResolver::_parseRemoteEarliestOpTime(const HostAndPort& candida
// Remote oplog is empty.
const auto until = _taskExecutor->now() + kOplogEmptyBlacklistDuration;
LOGV2(21766,
- "Blacklisting {candidate} due to empty oplog for {kOplogEmptyBlacklistDuration} "
+ "Blacklisting {candidate} due to empty oplog for {duration} "
"until: {until}",
"candidate"_attr = candidate,
- "kOplogEmptyBlacklistDuration"_attr = kOplogEmptyBlacklistDuration,
+ "duration"_attr = kOplogEmptyBlacklistDuration,
"until"_attr = until);
_syncSourceSelector->blacklistSyncSource(candidate, until);
return OpTime();
@@ -254,10 +254,9 @@ OpTime SyncSourceResolver::_parseRemoteEarliestOpTime(const HostAndPort& candida
const auto until = _taskExecutor->now() + kFirstOplogEntryEmptyBlacklistDuration;
LOGV2(21767,
"Blacklisting {candidate} due to empty first document for "
- "{kFirstOplogEntryEmptyBlacklistDuration} until: {until}",
+ "{duration} until: {until}",
"candidate"_attr = candidate,
- "kFirstOplogEntryEmptyBlacklistDuration"_attr =
- kFirstOplogEntryEmptyBlacklistDuration,
+ "duration"_attr = kFirstOplogEntryEmptyBlacklistDuration,
"until"_attr = until);
_syncSourceSelector->blacklistSyncSource(candidate, until);
return OpTime();
@@ -268,14 +267,13 @@ OpTime SyncSourceResolver::_parseRemoteEarliestOpTime(const HostAndPort& candida
const auto until = _taskExecutor->now() + kFirstOplogEntryNullTimestampBlacklistDuration;
LOGV2(21768,
"Blacklisting {candidate} due to error parsing OpTime from the oldest oplog entry "
- "for {kFirstOplogEntryNullTimestampBlacklistDuration} until: {until}. Error: "
- "{remoteEarliestOpTime_getStatus}, Entry: {firstObjFound}",
+ "for {duration} until: {until}. Error: "
+ "{status}, Entry: {entry}",
"candidate"_attr = candidate,
- "kFirstOplogEntryNullTimestampBlacklistDuration"_attr =
- kFirstOplogEntryNullTimestampBlacklistDuration,
+ "duration"_attr = kFirstOplogEntryNullTimestampBlacklistDuration,
"until"_attr = until,
- "remoteEarliestOpTime_getStatus"_attr = remoteEarliestOpTime.getStatus(),
- "firstObjFound"_attr = redact(firstObjFound));
+ "status"_attr = remoteEarliestOpTime.getStatus(),
+ "entry"_attr = redact(firstObjFound));
_syncSourceSelector->blacklistSyncSource(candidate, until);
return OpTime();
}
@@ -285,10 +283,9 @@ OpTime SyncSourceResolver::_parseRemoteEarliestOpTime(const HostAndPort& candida
const auto until = _taskExecutor->now() + kFirstOplogEntryNullTimestampBlacklistDuration;
LOGV2(21769,
"Blacklisting {candidate} due to null timestamp in first document for "
- "{kFirstOplogEntryNullTimestampBlacklistDuration} until: {until}",
+ "{duration} until: {until}",
"candidate"_attr = candidate,
- "kFirstOplogEntryNullTimestampBlacklistDuration"_attr =
- kFirstOplogEntryNullTimestampBlacklistDuration,
+ "duration"_attr = kFirstOplogEntryNullTimestampBlacklistDuration,
"until"_attr = until);
_syncSourceSelector->blacklistSyncSource(candidate, until);
return OpTime();
@@ -319,11 +316,11 @@ void SyncSourceResolver::_firstOplogEntryFetcherCallback(
// We got an error.
const auto until = _taskExecutor->now() + kFetcherErrorBlacklistDuration;
LOGV2(21770,
- "Blacklisting {candidate} due to error: '{queryResult_getStatus}' for "
- "{kFetcherErrorBlacklistDuration} until: {until}",
+ "Blacklisting {candidate} due to error: '{status}' for "
+ "{duration} until: {until}",
"candidate"_attr = candidate,
- "queryResult_getStatus"_attr = queryResult.getStatus(),
- "kFetcherErrorBlacklistDuration"_attr = kFetcherErrorBlacklistDuration,
+ "status"_attr = queryResult.getStatus(),
+ "duration"_attr = kFetcherErrorBlacklistDuration,
"until"_attr = until);
_syncSourceSelector->blacklistSyncSource(candidate, until);
@@ -346,12 +343,12 @@ void SyncSourceResolver::_firstOplogEntryFetcherCallback(
LOGV2(21771,
"We are too stale to use {candidate} as a sync source. Blacklisting this sync source "
- "because our last fetched timestamp: {lastOpTimeFetched_getTimestamp} is before "
- "their earliest timestamp: {remoteEarliestOpTime_getTimestamp} for "
+ "because our last fetched timestamp: {lastOpTimeFetchedTimestamp} is before "
+ "their earliest timestamp: {remoteEarliestOpTimeTimestamp} for "
"{blacklistDuration} until: {until}",
"candidate"_attr = candidate,
- "lastOpTimeFetched_getTimestamp"_attr = _lastOpTimeFetched.getTimestamp(),
- "remoteEarliestOpTime_getTimestamp"_attr = remoteEarliestOpTime.getTimestamp(),
+ "lastOpTimeFetchedTimestamp"_attr = _lastOpTimeFetched.getTimestamp(),
+ "remoteEarliestOpTimeTimestamp"_attr = remoteEarliestOpTime.getTimestamp(),
"blacklistDuration"_attr = blacklistDuration,
"until"_attr = until);
@@ -420,11 +417,11 @@ void SyncSourceResolver::_rbidRequestCallback(
} catch (const DBException& ex) {
const auto until = _taskExecutor->now() + kFetcherErrorBlacklistDuration;
LOGV2(21772,
- "Blacklisting {candidate} due to error: '{ex}' for {kFetcherErrorBlacklistDuration} "
+ "Blacklisting {candidate} due to error: '{ex}' for {duration} "
"until: {until}",
"candidate"_attr = candidate,
"ex"_attr = ex,
- "kFetcherErrorBlacklistDuration"_attr = kFetcherErrorBlacklistDuration,
+ "duration"_attr = kFetcherErrorBlacklistDuration,
"until"_attr = until);
_syncSourceSelector->blacklistSyncSource(candidate, until);
_chooseAndProbeNextSyncSource(earliestOpTimeSeen).transitional_ignore();
@@ -496,11 +493,11 @@ void SyncSourceResolver::_requiredOpTimeFetcherCallback(
const auto until = _taskExecutor->now() + kFetcherErrorBlacklistDuration;
LOGV2(21773,
"Blacklisting {candidate} due to required optime fetcher error: "
- "'{queryResult_getStatus}' for {kFetcherErrorBlacklistDuration} until: {until}. "
+ "'{status}' for {duration} until: {until}. "
"required optime: {requiredOpTime}",
"candidate"_attr = candidate,
- "queryResult_getStatus"_attr = queryResult.getStatus(),
- "kFetcherErrorBlacklistDuration"_attr = kFetcherErrorBlacklistDuration,
+ "status"_attr = queryResult.getStatus(),
+ "duration"_attr = kFetcherErrorBlacklistDuration,
"until"_attr = until,
"requiredOpTime"_attr = _requiredOpTime);
_syncSourceSelector->blacklistSyncSource(candidate, until);
@@ -518,12 +515,12 @@ void SyncSourceResolver::_requiredOpTimeFetcherCallback(
"We cannot use {candidate} as a sync source because it does not contain the necessary "
"operations for us to reach a consistent state: {status} last fetched optime: "
"{lastOpTimeFetched}. required optime: {requiredOpTime}. Blacklisting this sync source "
- "for {kNoRequiredOpTimeBlacklistDuration} until: {until}",
+ "for {duration} until: {until}",
"candidate"_attr = candidate.toString(),
"status"_attr = status,
"lastOpTimeFetched"_attr = _lastOpTimeFetched,
"requiredOpTime"_attr = _requiredOpTime,
- "kNoRequiredOpTimeBlacklistDuration"_attr = kNoRequiredOpTimeBlacklistDuration,
+ "duration"_attr = kNoRequiredOpTimeBlacklistDuration,
"until"_attr = until);
_syncSourceSelector->blacklistSyncSource(candidate, until);
@@ -582,8 +579,8 @@ Status SyncSourceResolver::_finishCallback(const SyncSourceResolverResponse& res
_onCompletion(response);
} catch (...) {
LOGV2_WARNING(21775,
- "sync source resolver finish callback threw exception: {exceptionToStatus}",
- "exceptionToStatus"_attr = exceptionToStatus());
+ "sync source resolver finish callback threw exception: {exception}",
+ "exception"_attr = exceptionToStatus());
}
stdx::lock_guard<Latch> lock(_mutex);