diff options
author | William Schultz <william.schultz@mongodb.com> | 2018-01-25 17:37:52 -0500 |
---|---|---|
committer | William Schultz <william.schultz@mongodb.com> | 2018-01-25 17:37:52 -0500 |
commit | 0ebed531c6506e8538858758a6af5b8eb9da7ed2 (patch) | |
tree | cfabef518d510a9ad80738d52d9a7bfd0bcd0452 /src/mongo/db/repl/rollback_impl.cpp | |
parent | a917ca5b1691625d7a1e70e96672386bbf0a6243 (diff) | |
download | mongo-0ebed531c6506e8538858758a6af5b8eb9da7ed2.tar.gz |
Revert "SERVER-30818 Wait for all background index builds to complete before starting rollback to checkpoint"
This reverts commit 18eb990734653fc80f7d8c2916033e61ea7320e5.
Diffstat (limited to 'src/mongo/db/repl/rollback_impl.cpp')
-rw-r--r-- | src/mongo/db/repl/rollback_impl.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/mongo/db/repl/rollback_impl.cpp b/src/mongo/db/repl/rollback_impl.cpp index 63dfe97b02b..fa03b891526 100644 --- a/src/mongo/db/repl/rollback_impl.cpp +++ b/src/mongo/db/repl/rollback_impl.cpp @@ -32,7 +32,6 @@ #include "mongo/db/repl/rollback_impl.h" -#include "mongo/db/background.h" #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/logical_time_validator.h" #include "mongo/db/operation_context.h" @@ -92,13 +91,6 @@ Status RollbackImpl::runRollback(OperationContext* opCtx) { } _listener->onTransitionToRollback(); - // Wait for all background index builds to complete before starting the rollback process. - status = _awaitBgIndexCompletion(opCtx); - if (!status.isOK()) { - return status; - } - _listener->onBgIndexesComplete(); - auto commonPointSW = _findCommonPoint(); if (!commonPointSW.isOK()) { return commonPointSW.getStatus(); @@ -188,37 +180,6 @@ Status RollbackImpl::_transitionToRollback(OperationContext* opCtx) { return Status::OK(); } -Status RollbackImpl::_awaitBgIndexCompletion(OperationContext* opCtx) { - invariant(opCtx); - if (_isInShutdown()) { - return Status(ErrorCodes::ShutdownInProgress, "rollback shutting down"); - } - - // Get a list of all databases. - StorageEngine* storageEngine = opCtx->getServiceContext()->getGlobalStorageEngine(); - std::vector<std::string> dbs; - { - Lock::GlobalLock lk(opCtx, MODE_IS, UINT_MAX); - storageEngine->listDatabases(&dbs); - } - - // Wait for all background operations to complete by waiting on each database. - std::vector<StringData> dbNames(dbs.begin(), dbs.end()); - log() << "Waiting for all background operations to complete before starting rollback"; - for (auto db : dbNames) { - LOG(1) << "Waiting for " << BackgroundOperation::numInProgForDb(db) - << " background operations to complete on database '" << db << "'"; - BackgroundOperation::awaitNoBgOpInProgForDb(db); - // Check for shutdown again. - if (_isInShutdown()) { - return Status(ErrorCodes::ShutdownInProgress, "rollback shutting down"); - } - } - - log() << "Finished waiting for background operations to complete before rollback"; - return Status::OK(); -} - StatusWith<Timestamp> RollbackImpl::_findCommonPoint() { if (_isInShutdown()) { return Status(ErrorCodes::ShutdownInProgress, "rollback shutting down"); |