diff options
author | Randolph Tan <randolph@10gen.com> | 2019-03-22 11:36:22 -0400 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2019-04-01 16:42:30 -0400 |
commit | 258f72a671492853501b551cd3135a6dbf5208d4 (patch) | |
tree | eb34cb02e6276480e4224001f64fa955347640c1 /src/mongo/s/transaction_router.cpp | |
parent | cbe3968ce01e4a749756422893b7274100675705 (diff) | |
download | mongo-258f72a671492853501b551cd3135a6dbf5208d4.tar.gz |
SERVER-37734 Add a default log component verbosity for mongos to resmoke, and set the 'transaction' component to 3
Diffstat (limited to 'src/mongo/s/transaction_router.cpp')
-rw-r--r-- | src/mongo/s/transaction_router.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mongo/s/transaction_router.cpp b/src/mongo/s/transaction_router.cpp index 3b1b2aaeb00..cca77b8ae8f 100644 --- a/src/mongo/s/transaction_router.cpp +++ b/src/mongo/s/transaction_router.cpp @@ -256,7 +256,7 @@ void TransactionRouter::processParticipantResponse(const ShardId& shardId, if (txnResponseMetadata.getReadOnly()) { if (participant->readOnly == Participant::ReadOnly::kUnset) { - LOG(0) << txnIdToString() << " Marking " << shardId << " as read-only"; + LOG(3) << txnIdToString() << " Marking " << shardId << " as read-only"; participant->readOnly = Participant::ReadOnly::kReadOnly; return; } @@ -272,7 +272,7 @@ void TransactionRouter::processParticipantResponse(const ShardId& shardId, // The shard reported readOnly:false on this statement. if (participant->readOnly != Participant::ReadOnly::kNotReadOnly) { - LOG(0) << txnIdToString() << " Marking " << shardId << " as having done a write"; + LOG(3) << txnIdToString() << " Marking " << shardId << " as having done a write"; participant->readOnly = Participant::ReadOnly::kNotReadOnly; } } @@ -467,7 +467,7 @@ void TransactionRouter::onStaleShardOrDbError(OperationContext* opCtx, const Status& errorStatus) { invariant(canContinueOnStaleShardOrDbError(cmdName)); - LOG(0) << txnIdToString() + LOG(3) << txnIdToString() << " Clearing pending participants after stale version error: " << errorStatus; // Remove participants created during the current statement so they are sent the correct options @@ -478,7 +478,7 @@ void TransactionRouter::onStaleShardOrDbError(OperationContext* opCtx, void TransactionRouter::onViewResolutionError(OperationContext* opCtx, const NamespaceString& nss) { // The router can always retry on a view resolution error. - LOG(0) << txnIdToString() + LOG(3) << txnIdToString() << " Clearing pending participants after view resolution error on namespace: " << nss; // Requests against views are always routed to the primary shard for its database, but the retry @@ -498,7 +498,7 @@ bool TransactionRouter::canContinueOnSnapshotError() const { void TransactionRouter::onSnapshotError(OperationContext* opCtx, const Status& errorStatus) { invariant(canContinueOnSnapshotError()); - LOG(0) << txnIdToString() << " Clearing pending participants and resetting global snapshot " + LOG(3) << txnIdToString() << " Clearing pending participants and resetting global snapshot " "timestamp after snapshot error: " << errorStatus << ", previous timestamp: " << _atClusterTime->getTime(); @@ -531,7 +531,7 @@ void TransactionRouter::_setAtClusterTime(const boost::optional<LogicalTime>& af return; } - LOG(0) << txnIdToString() << " Setting global snapshot timestamp to " << candidateTime + LOG(2) << txnIdToString() << " Setting global snapshot timestamp to " << candidateTime << " on statement " << _latestStmtId; _atClusterTime->setTime(candidateTime, _latestStmtId); @@ -608,7 +608,7 @@ void TransactionRouter::beginOrContinueTxn(OperationContext* opCtx, _atClusterTime.emplace(); } - LOG(0) << txnIdToString() << " New transaction started"; + LOG(3) << txnIdToString() << " New transaction started"; } const LogicalSessionId& TransactionRouter::_sessionId() const { @@ -628,7 +628,7 @@ BSONObj TransactionRouter::_commitSingleShardTransaction(OperationContext* opCtx _commitType = CommitType::kDirectCommit; - LOG(0) << txnIdToString() + LOG(3) << txnIdToString() << " Committing single-shard transaction, single participant: " << shardId; CommitTransaction commitCmd; @@ -659,7 +659,7 @@ BSONObj TransactionRouter::_commitReadOnlyTransaction(OperationContext* opCtx) { _commitType = CommitType::kDirectCommit; - LOG(0) << txnIdToString() << " Committing read-only transaction on " << requests.size() + LOG(3) << txnIdToString() << " Committing read-only transaction on " << requests.size() << " shards"; // Send the requests. @@ -713,7 +713,7 @@ BSONObj TransactionRouter::_commitMultiShardTransaction(OperationContext* opCtx) uassertStatusOK(Grid::get(opCtx)->shardRegistry()->getShard(opCtx, *_coordinatorId)); if (MONGO_FAIL_POINT(sendCoordinateCommitToConfigServer)) { - LOG(0) << "Sending coordinateCommit for transaction " << *opCtx->getTxnNumber() + LOG(3) << "Sending coordinateCommit for transaction " << *opCtx->getTxnNumber() << " on session " << opCtx->getLogicalSessionId()->toBSON() << " to config server rather than actual coordinator because failpoint is active"; @@ -758,7 +758,7 @@ BSONObj TransactionRouter::_commitMultiShardTransaction(OperationContext* opCtx) _commitType = CommitType::kTwoPhaseCommit; - LOG(0) << txnIdToString() + LOG(3) << txnIdToString() << " Committing multi-shard transaction, coordinator: " << *_coordinatorId; return uassertStatusOK( @@ -833,7 +833,7 @@ std::vector<AsyncRequestsSender::Response> TransactionRouter::abortTransaction( // Implicit aborts log earlier. if (!isImplicit) { - LOG(0) << txnIdToString() << " Aborting transaction on " << _participants.size() + LOG(3) << txnIdToString() << " Aborting transaction on " << _participants.size() << " shard(s)"; } @@ -852,18 +852,18 @@ void TransactionRouter::implicitlyAbortTransaction(OperationContext* opCtx, if (_commitType == CommitType::kTwoPhaseCommit || _commitType == CommitType::kRecoverWithToken) { - LOG(0) << txnIdToString() << " Router not sending implicit abortTransaction because commit " + LOG(3) << txnIdToString() << " Router not sending implicit abortTransaction because commit " "may have been handed off to the coordinator"; return; } - LOG(0) << txnIdToString() << " Implicitly aborting transaction on " << _participants.size() + LOG(3) << txnIdToString() << " Implicitly aborting transaction on " << _participants.size() << " shard(s) due to error: " << errorStatus; try { abortTransaction(opCtx, true /*isImplicit*/); } catch (const DBException& ex) { - LOG(0) << txnIdToString() << " Implicitly aborting transaction failed " + LOG(3) << txnIdToString() << " Implicitly aborting transaction failed " << causedBy(ex.toStatus()); // Ignore any exceptions. } |