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/background.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/background.cpp')
-rw-r--r-- | src/mongo/db/background.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mongo/db/background.cpp b/src/mongo/db/background.cpp index d427c4db301..555062f7e63 100644 --- a/src/mongo/db/background.cpp +++ b/src/mongo/db/background.cpp @@ -124,14 +124,6 @@ bool BackgroundOperation::inProgForDb(StringData db) { return dbsInProg.find(db) != dbsInProg.end(); } -int BackgroundOperation::numInProgForDb(StringData db) { - stdx::lock_guard<stdx::mutex> lk(m); - std::shared_ptr<BgInfo> bgInfo = mapFindWithDefault(dbsInProg, db, std::shared_ptr<BgInfo>()); - if (!bgInfo) - return 0; - return bgInfo->getOpsInProgCount(); -} - bool BackgroundOperation::inProgForNs(StringData ns) { stdx::lock_guard<stdx::mutex> lk(m); return nsInProg.find(ns) != nsInProg.end(); @@ -155,6 +147,13 @@ void BackgroundOperation::assertNoBgOpInProgForNs(StringData ns) { !inProgForNs(ns)); } +void BackgroundOperation::awaitNoBgOpInProgForDbs(std::vector<StringData> dbs) { + stdx::unique_lock<stdx::mutex> lk(m); + for (auto db : dbs) { + awaitNoBgOps(lk, &dbsInProg, db); + } +} + void BackgroundOperation::awaitNoBgOpInProgForDb(StringData db) { stdx::unique_lock<stdx::mutex> lk(m); awaitNoBgOps(lk, &dbsInProg, db); |