diff options
author | Dianna Hohensee <dianna.hohensee@10gen.com> | 2019-01-22 11:47:50 -0500 |
---|---|---|
committer | Dianna Hohensee <dianna.hohensee@10gen.com> | 2019-03-11 17:38:03 -0400 |
commit | d02edd5290131978f901ffc657bee3470d03f8fd (patch) | |
tree | 3e53beb391466f36d073d0ce710dee3f88d90273 /src/mongo/db/background.cpp | |
parent | b69c97b4da596f1da8dea2b40cf32a7c5c657870 (diff) | |
download | mongo-d02edd5290131978f901ffc657bee3470d03f8fd.tar.gz |
SERVER-39079 Move BackgroundOperation checks out of the catalog layer; add parallel IndexBuildsCoordinator checks for all BackgroundOperation checks
Diffstat (limited to 'src/mongo/db/background.cpp')
-rw-r--r-- | src/mongo/db/background.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/db/background.cpp b/src/mongo/db/background.cpp index eb24f3c6529..f499e8a1a2e 100644 --- a/src/mongo/db/background.cpp +++ b/src/mongo/db/background.cpp @@ -136,6 +136,17 @@ bool BackgroundOperation::inProgForNs(StringData ns) { return nsInProg.find(ns) != nsInProg.end(); } +void BackgroundOperation::assertNoBgOpInProg() { + for (auto& db : dbsInProg) { + uassert(ErrorCodes::BackgroundOperationInProgressForDatabase, + mongoutils::str::stream() + << "cannot perform operation: a background operation is currently running for " + "database " + << db.first, + !inProgForDb(db.first)); + } +} + void BackgroundOperation::assertNoBgOpInProgForDb(StringData db) { uassert(ErrorCodes::BackgroundOperationInProgressForDatabase, mongoutils::str::stream() |