diff options
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r-- | src/mongo/db/commands/create_indexes.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/commands/find_cmd.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/commands/pipeline_command.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/commands/write_commands/batch_executor.cpp | 12 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/mongo/db/commands/create_indexes.cpp b/src/mongo/db/commands/create_indexes.cpp index 46ad1759247..685cc4ca0ad 100644 --- a/src/mongo/db/commands/create_indexes.cpp +++ b/src/mongo/db/commands/create_indexes.cpp @@ -201,7 +201,7 @@ namespace mongo { // If we're a background index, replace exclusive db lock with an intent lock, so that // other readers and writers can proceed during this phase. if (indexer.getBuildInBackground()) { - txn->recoveryUnit()->commitAndRestart(); + txn->recoveryUnit()->abandonSnapshot(); dbLock.relockWithMode(MODE_IX); if (!repl::getGlobalReplicationCoordinator()->canAcceptWritesForDatabase(dbname)) { return appendCommandStatus(result, Status(ErrorCodes::NotMaster, str::stream() @@ -221,7 +221,7 @@ namespace mongo { try { // This function cannot throw today, but we will preemptively prepare for // that day, to avoid data corruption due to lack of index cleanup. - txn->recoveryUnit()->commitAndRestart(); + txn->recoveryUnit()->abandonSnapshot(); dbLock.relockWithMode(MODE_X); if (!repl::getGlobalReplicationCoordinator()->canAcceptWritesForDatabase( dbname)) { @@ -241,7 +241,7 @@ namespace mongo { } // Need to return db lock back to exclusive, to complete the index build. if (indexer.getBuildInBackground()) { - txn->recoveryUnit()->commitAndRestart(); + txn->recoveryUnit()->abandonSnapshot(); dbLock.relockWithMode(MODE_X); uassert(ErrorCodes::NotMaster, str::stream() << "Not primary while completing index build in " << dbname, diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp index 9b78a2a0543..c4d56be099c 100644 --- a/src/mongo/db/commands/find_cmd.cpp +++ b/src/mongo/db/commands/find_cmd.cpp @@ -333,7 +333,7 @@ namespace mongo { if (!(pq.isTailable() && state == PlanExecutor::IS_EOF)) { // 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(); + txn->recoveryUnit()->abandonSnapshot(); cursor->setOwnedRecoveryUnit(txn->releaseRecoveryUnit()); StorageEngine* engine = getGlobalServiceContext()->getGlobalStorageEngine(); txn->setRecoveryUnit(engine->newRecoveryUnit()); diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp index 0763771af70..afc01a8c81a 100644 --- a/src/mongo/db/commands/pipeline_command.cpp +++ b/src/mongo/db/commands/pipeline_command.cpp @@ -137,7 +137,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(); + txn->recoveryUnit()->abandonSnapshot(); cursor->setOwnedRecoveryUnit(txn->releaseRecoveryUnit()); StorageEngine* storageEngine = getGlobalServiceContext()->getGlobalStorageEngine(); txn->setRecoveryUnit(storageEngine->newRecoveryUnit()); diff --git a/src/mongo/db/commands/write_commands/batch_executor.cpp b/src/mongo/db/commands/write_commands/batch_executor.cpp index 3c2750dfb16..13305866af4 100644 --- a/src/mongo/db/commands/write_commands/batch_executor.cpp +++ b/src/mongo/db/commands/write_commands/batch_executor.cpp @@ -874,7 +874,7 @@ namespace mongo { state.unlock(); // This releases any storage engine held locks/snapshots. - _txn->recoveryUnit()->commitAndRestart(); + _txn->recoveryUnit()->abandonSnapshot(); } _txn->checkForInterrupt(); @@ -927,7 +927,7 @@ namespace mongo { finishCurrentOp( _txn, ¤tOp, result.getError() ); // End current transaction and release snapshot. - _txn->recoveryUnit()->commitAndRestart(); + _txn->recoveryUnit()->abandonSnapshot(); if ( result.getError() ) { result.getError()->setIndex( updateItem.getItemIndex() ); @@ -968,7 +968,7 @@ namespace mongo { finishCurrentOp( _txn, ¤tOp, result.getError() ); // End current transaction and release snapshot. - _txn->recoveryUnit()->commitAndRestart(); + _txn->recoveryUnit()->abandonSnapshot(); if ( result.getError() ) { result.getError()->setIndex( removeItem.getItemIndex() ); @@ -1103,7 +1103,7 @@ namespace mongo { catch ( const WriteConflictException& wce ) { state->unlock(); state->txn->getCurOp()->debug().writeConflicts++; - state->txn->recoveryUnit()->commitAndRestart(); + state->txn->recoveryUnit()->abandonSnapshot(); WriteConflictException::logAndBackoff( attempt++, "insert", state->getCollection() ? @@ -1129,7 +1129,7 @@ namespace mongo { // Errors release the write lock, as a matter of policy. if (result->getError()) { - state->txn->recoveryUnit()->commitAndRestart(); + state->txn->recoveryUnit()->abandonSnapshot(); state->unlock(); } } @@ -1366,7 +1366,7 @@ namespace mongo { createCollection = false; // RESTART LOOP fakeLoop = -1; - txn->recoveryUnit()->commitAndRestart(); + txn->recoveryUnit()->abandonSnapshot(); WriteConflictException::logAndBackoff( attempt++, "update", nsString.ns() ); } |