summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeert Bosch <geert@mongodb.com>2015-03-23 18:11:35 -0400
committerRamon Fernandez <ramon.fernandez@mongodb.com>2015-03-30 18:09:37 -0400
commit6d12fa62f9604a985b48da19bf52ebe2d683864b (patch)
tree0d9ffcae74b2be50868fd86ba6e640f8df29732e
parente82fc79a0bd5cf5b93bbfa0b62e6ea05a5f607c7 (diff)
downloadmongo-6d12fa62f9604a985b48da19bf52ebe2d683864b.tar.gz
SERVER-17562: Rollback transaction in WT commitAndRestart
(cherry picked from commit bbe95e94bc7231a0b06c395a52c6575d7d23e03e)
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp
index 963fe481ae3..5d38e25635f 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp
@@ -197,9 +197,10 @@ namespace mongo {
}
void WiredTigerRecoveryUnit::commitAndRestart() {
- invariant( _depth == 0 );
- if ( _active ) {
- _txnClose( true );
+ invariant(_depth == 0);
+ if (_active) {
+ // Can't be in a WriteUnitOfWork, so safe to rollback
+ _txnClose(false);
}
}