From edb8778350326d2b33f056b1b5f0b25a4b5b444a Mon Sep 17 00:00:00 2001 From: Henrik Edin Date: Mon, 23 Mar 2020 10:04:42 -0400 Subject: SERVER-47040 LOGV2_FATAL also fasserts Added LOGV2_FATAL_NOTRACE and LOGV2_CONTINUE to have different behavior. --- src/mongo/db/repl/rollback_impl.cpp | 49 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 25 deletions(-) (limited to 'src/mongo/db/repl/rollback_impl.cpp') 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 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 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)); } } -- cgit v1.2.1