summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2015-01-15 13:42:56 -0500
committerMathias Stearn <mathias@10gen.com>2015-01-15 18:08:36 -0500
commit63bd5b5962dace5a96b3919538105e3ee2e18636 (patch)
tree7204aaef7dd8b528d12aa8453136d04bf6e78f63
parent59fec904c441998dc6381b8e26bd4b90d8718a3e (diff)
downloadmongo-63bd5b5962dace5a96b3919538105e3ee2e18636.tar.gz
SERVER-16873 call commitAndRestart() when stashing RUs
-rw-r--r--src/mongo/db/commands/pipeline_command.cpp1
-rw-r--r--src/mongo/db/query/find.cpp3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp
index a01fad5f1d4..312794eeb94 100644
--- a/src/mongo/db/commands/pipeline_command.cpp
+++ b/src/mongo/db/commands/pipeline_command.cpp
@@ -131,6 +131,7 @@ namespace mongo {
// We stash away the RecoveryUnit in the ClientCursor. It's used for subsequent
// getMore requests. The calling OpCtx gets a fresh RecoveryUnit.
+ txn->recoveryUnit()->commitAndRestart();
cursor->setOwnedRecoveryUnit(txn->releaseRecoveryUnit());
StorageEngine* storageEngine = getGlobalEnvironment()->getGlobalStorageEngine();
txn->setRecoveryUnit(storageEngine->newRecoveryUnit());
diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp
index 7e176e2c7f5..67867835c31 100644
--- a/src/mongo/db/query/find.cpp
+++ b/src/mongo/db/query/find.cpp
@@ -155,6 +155,7 @@ namespace mongo {
: _cc(cc), _txn(txn) {
// Save this for later. We restore it upon destruction.
+ _txn->recoveryUnit()->commitAndRestart();
_txnPreviousRecoveryUnit = txn->releaseRecoveryUnit();
// Transfer ownership of the RecoveryUnit from the ClientCursor to the OpCtx.
@@ -163,6 +164,7 @@ namespace mongo {
}
~ScopedRecoveryUnitSwapper() {
+ _txn->recoveryUnit()->commitAndRestart();
_cc->setOwnedRecoveryUnit(_txn->releaseRecoveryUnit());
_txn->setRecoveryUnit(_txnPreviousRecoveryUnit);
}
@@ -894,6 +896,7 @@ namespace mongo {
else {
// We stash away the RecoveryUnit in the ClientCursor. It's used for subsequent
// getMore requests. The calling OpCtx gets a fresh RecoveryUnit.
+ txn->recoveryUnit()->commitAndRestart();
cc->setOwnedRecoveryUnit(txn->releaseRecoveryUnit());
StorageEngine* storageEngine = getGlobalEnvironment()->getGlobalStorageEngine();
txn->setRecoveryUnit(storageEngine->newRecoveryUnit());