diff options
author | Gregory Noma <gregory.noma@gmail.com> | 2020-08-25 16:07:00 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-02 22:38:20 +0000 |
commit | 6b3e341703b781bb1ff7b1263406a0f1d28dd77c (patch) | |
tree | 0b5067fd45609a3edac86956105b60f6fe2afa28 /src/mongo/db/storage/wiredtiger | |
parent | 30e0f2a2b33a9b87259ac4c8a9e19518e2b8e1a3 (diff) | |
download | mongo-6b3e341703b781bb1ff7b1263406a0f1d28dd77c.tar.gz |
SERVER-50365 Use short WT transaction rollback timeout in the multi-document transaction expirer thread
Diffstat (limited to 'src/mongo/db/storage/wiredtiger')
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp index 8eba439563c..1167fd673f3 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp @@ -374,17 +374,22 @@ void WiredTigerRecoveryUnit::_txnClose(bool commit) { } wtRet = s->commit_transaction(s, conf.str().c_str()); - LOGV2_DEBUG(22412, - 3, - "WT commit_transaction for snapshot id {snapshotId}", - "snapshotId"_attr = getSnapshotId().toNumber()); + + LOGV2_DEBUG( + 22412, 3, "WT commit_transaction", "snapshotId"_attr = getSnapshotId().toNumber()); } else { - wtRet = s->rollback_transaction(s, nullptr); - invariant(!wtRet); - LOGV2_DEBUG(22413, - 3, - "WT rollback_transaction for snapshot id {snapshotId}", - "snapshotId"_attr = getSnapshotId().toNumber()); + StringBuilder config; + if (_noEvictionAfterRollback) { + // The only point at which rollback_transaction() can time out is in the bonus-eviction + // phase. If the timeout expires here, the function will stop the eviction and return + // success. It cannot return an error due to timeout. + config << "operation_timeout_ms=1,"; + } + + wtRet = s->rollback_transaction(s, config.str().c_str()); + + LOGV2_DEBUG( + 22413, 3, "WT rollback_transaction", "snapshotId"_attr = getSnapshotId().toNumber()); } if (_isTimestamped) { |