diff options
author | Jack Mulrow <jack.mulrow@mongodb.com> | 2018-12-07 12:15:01 -0500 |
---|---|---|
committer | Jack Mulrow <jack.mulrow@mongodb.com> | 2018-12-10 17:44:54 -0500 |
commit | e6a0068b690c1bfc53f090401e1f066be3574733 (patch) | |
tree | 9e4ba33ceff3adb355843392172ffea9ef7df8b4 /src/mongo/s/transaction_router.cpp | |
parent | 3fa51aa6da0aa37c1fa51f01172db8b7fe9a44b2 (diff) | |
download | mongo-e6a0068b690c1bfc53f090401e1f066be3574733.tar.gz |
SERVER-38459 TransactionRouter shouldn't lose original non internally retryable snapshot and stale version errors
Diffstat (limited to 'src/mongo/s/transaction_router.cpp')
-rw-r--r-- | src/mongo/s/transaction_router.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/s/transaction_router.cpp b/src/mongo/s/transaction_router.cpp index 01e4b18abca..3af5fe824ff 100644 --- a/src/mongo/s/transaction_router.cpp +++ b/src/mongo/s/transaction_router.cpp @@ -365,11 +365,12 @@ bool TransactionRouter::_canContinueOnStaleShardOrDbError(StringData cmdName) co return false; } -void TransactionRouter::onStaleShardOrDbError(StringData cmdName) { +void TransactionRouter::onStaleShardOrDbError(StringData cmdName, const Status& errorStatus) { uassert(ErrorCodes::NoSuchTransaction, str::stream() << "Transaction " << _txnNumber << " was aborted on statement " << _latestStmtId - << " due to cluster data placement change", + << " due to an error from cluster data placement change: " + << errorStatus, _canContinueOnStaleShardOrDbError(cmdName)); // Remove participants created during the current statement so they are sent the correct options @@ -390,11 +391,12 @@ bool TransactionRouter::_canContinueOnSnapshotError() const { return _atClusterTime && _atClusterTime->canChange(_latestStmtId); } -void TransactionRouter::onSnapshotError() { +void TransactionRouter::onSnapshotError(const Status& errorStatus) { uassert(ErrorCodes::NoSuchTransaction, str::stream() << "Transaction " << _txnNumber << " was aborted on statement " << _latestStmtId - << " due to a non-retryable snapshot error", + << " due to a non-retryable snapshot error: " + << errorStatus, _canContinueOnSnapshotError()); // The transaction must be restarted on all participants because a new read timestamp will be |