summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/rollback_impl.cpp
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2020-03-23 10:04:42 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-24 20:22:44 +0000
commitedb8778350326d2b33f056b1b5f0b25a4b5b444a (patch)
tree15afcaa7a707be0872b764cd054aee55d855ba92 /src/mongo/db/repl/rollback_impl.cpp
parent51b338ad41653a8188adcc67b682ea12bbe63b4d (diff)
downloadmongo-edb8778350326d2b33f056b1b5f0b25a4b5b444a.tar.gz
SERVER-47040 LOGV2_FATAL also fasserts
Added LOGV2_FATAL_NOTRACE and LOGV2_CONTINUE to have different behavior.
Diffstat (limited to 'src/mongo/db/repl/rollback_impl.cpp')
-rw-r--r--src/mongo/db/repl/rollback_impl.cpp49
1 files changed, 24 insertions, 25 deletions
diff --git a/src/mongo/db/repl/rollback_impl.cpp b/src/mongo/db/repl/rollback_impl.cpp
index 88ecd1e849a..53c91047487 100644
--- a/src/mongo/db/repl/rollback_impl.cpp
+++ b/src/mongo/db/repl/rollback_impl.cpp
@@ -1025,13 +1025,12 @@ StatusWith<RollBackLocalOperations::RollbackCommonPoint> RollbackImpl::_findComm
if (commonPointOpTime.getTimestamp() < *stableTimestamp) {
// This is an fassert rather than an invariant, since it can happen if the server was
// recently upgraded to enableMajorityReadConcern=true.
- LOGV2_FATAL(21644,
- "Common point must be at least stable timestamp, common point: "
- "{commonPoint}, stable timestamp: {stableTimestamp}",
- "Common point must be at least stable timestamp",
- "commonPoint"_attr = commonPointOpTime.getTimestamp(),
- "stableTimestamp"_attr = *stableTimestamp);
- fassertFailedNoTrace(51121);
+ LOGV2_FATAL_NOTRACE(51121,
+ "Common point must be at least stable timestamp, common point: "
+ "{commonPoint}, stable timestamp: {stableTimestamp}",
+ "Common point must be at least stable timestamp",
+ "commonPoint"_attr = commonPointOpTime.getTimestamp(),
+ "stableTimestamp"_attr = *stableTimestamp);
}
return commonPointSW.getValue();
@@ -1100,14 +1099,15 @@ boost::optional<BSONObj> RollbackImpl::_findDocumentById(OperationContext* opCtx
} else if (document.getStatus().code() == ErrorCodes::NoSuchKey) {
return boost::none;
} else {
- LOGV2_FATAL(21645,
- "Rollback failed to read document with {id} in namespace {namespace} with uuid "
- "{uuid}{error}",
- "Rollback failed to read document",
- "id"_attr = redact(id),
- "namespace"_attr = nss.ns(),
- "uuid"_attr = uuid.toString(),
- "error"_attr = causedBy(document.getStatus()));
+ LOGV2_FATAL_CONTINUE(
+ 21645,
+ "Rollback failed to read document with {id} in namespace {namespace} with uuid "
+ "{uuid}{error}",
+ "Rollback failed to read document",
+ "id"_attr = redact(id),
+ "namespace"_attr = nss.ns(),
+ "uuid"_attr = uuid.toString(),
+ "error"_attr = causedBy(document.getStatus()));
fassert(50751, document.getStatus());
}
@@ -1219,16 +1219,15 @@ void RollbackImpl::_transitionFromRollbackToSecondary(OperationContext* opCtx) {
auto status = _replicationCoordinator->setFollowerMode(MemberState::RS_SECONDARY);
if (!status.isOK()) {
- LOGV2_FATAL(21646,
- "Failed to transition into {targetState}; expected to be in "
- "state {expectedState}; found self in "
- "{actualState} {error}",
- "Failed to perform replica set state transition",
- "targetState"_attr = MemberState(MemberState::RS_SECONDARY),
- "expectedState"_attr = MemberState(MemberState::RS_ROLLBACK),
- "actualState"_attr = _replicationCoordinator->getMemberState(),
- "error"_attr = causedBy(status));
- fassertFailedNoTrace(40408);
+ LOGV2_FATAL_NOTRACE(40408,
+ "Failed to transition into {targetState}; expected to be in "
+ "state {expectedState}; found self in "
+ "{actualState} {error}",
+ "Failed to perform replica set state transition",
+ "targetState"_attr = MemberState(MemberState::RS_SECONDARY),
+ "expectedState"_attr = MemberState(MemberState::RS_ROLLBACK),
+ "actualState"_attr = _replicationCoordinator->getMemberState(),
+ "error"_attr = causedBy(status));
}
}