diff options
author | Louis Williams <louis.williams@mongodb.com> | 2020-05-26 09:48:38 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-05-26 14:06:39 +0000 |
commit | 0e4178afe88237ead101b11fcb19864d9d5a903c (patch) | |
tree | c60ebdc794638b05f675c8406f053092c5b69dfe /src/mongo/db/repl/rollback_impl.cpp | |
parent | 2992a78c15fbd1db49f0eec86a2b0ffbc63954e0 (diff) | |
download | mongo-0e4178afe88237ead101b11fcb19864d9d5a903c.tar.gz |
SERVER-39140 Remove BackgroundOperation
Diffstat (limited to 'src/mongo/db/repl/rollback_impl.cpp')
-rw-r--r-- | src/mongo/db/repl/rollback_impl.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/mongo/db/repl/rollback_impl.cpp b/src/mongo/db/repl/rollback_impl.cpp index 94f66713b4c..9c13c0e0fe2 100644 --- a/src/mongo/db/repl/rollback_impl.cpp +++ b/src/mongo/db/repl/rollback_impl.cpp @@ -37,7 +37,6 @@ #include <fmt/format.h> #include "mongo/bson/util/bson_extract.h" -#include "mongo/db/background.h" #include "mongo/db/catalog/collection_catalog.h" #include "mongo/db/catalog/database_holder.h" #include "mongo/db/commands.h" @@ -361,19 +360,15 @@ void RollbackImpl::_stopAndWaitForIndexBuilds(OperationContext* opCtx) { std::vector<StringData> dbNames(dbs.begin(), dbs.end()); LOGV2(21595, "Waiting for all background operations to complete before starting rollback"); for (auto db : dbNames) { - auto numInProg = BackgroundOperation::numInProgForDb(db); - auto numInProgInCoordinator = IndexBuildsCoordinator::get(opCtx)->numInProgForDb(db); - if (numInProg > 0 || numInProgInCoordinator > 0) { - LOGV2_DEBUG( - 21596, - 1, - "Waiting for {numBackgroundOperationsInProgress} " - "background operations to complete on database '{db}'", - "Waiting for background operations to complete", - "numBackgroundOperationsInProgress"_attr = - (numInProg > numInProgInCoordinator ? numInProg : numInProgInCoordinator), - "db"_attr = db); - BackgroundOperation::awaitNoBgOpInProgForDb(db); + auto numInProg = IndexBuildsCoordinator::get(opCtx)->numInProgForDb(db); + if (numInProg > 0) { + LOGV2_DEBUG(21596, + 1, + "Waiting for {numBackgroundOperationsInProgress} " + "background operations to complete on database '{db}'", + "Waiting for background operations to complete", + "numBackgroundOperationsInProgress"_attr = numInProg, + "db"_attr = db); IndexBuildsCoordinator::get(opCtx)->awaitNoBgOpInProgForDb(opCtx, db); } } |