summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Ahmad <josef.ahmad@mongodb.com>2021-12-22 11:47:44 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-12-22 16:41:19 +0000
commit7ab244e01aa273062be82043e201f76243925ed3 (patch)
tree419c4ff987c9839127cee780a77726517948b550
parentc52c37bb2ac332cde41047ce1f8c16447b893361 (diff)
downloadmongo-7ab244e01aa273062be82043e201f76243925ed3.tar.gz
SERVER-62210 Fix dbCheck progress meter for dropped and recreated collections
(cherry picked from commit 1bb26e23c16f3f43ef477fc91cacabdf962d16f0)
-rw-r--r--src/mongo/db/commands/dbcheck.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mongo/db/commands/dbcheck.cpp b/src/mongo/db/commands/dbcheck.cpp
index 8c680e23c8a..de6e58024bf 100644
--- a/src/mongo/db/commands/dbcheck.cpp
+++ b/src/mongo/db/commands/dbcheck.cpp
@@ -299,9 +299,6 @@ protected:
private:
void _doCollection(OperationContext* opCtx, const DbCheckCollectionInfo& info) {
- // The collection was confirmed as existing in singleCollectionRun().
- // runBatch() will handle the case of the collection having been dropped since then.
-
if (_done) {
return;
}
@@ -314,6 +311,14 @@ private:
stdx::unique_lock<Client> lk(*opCtx->getClient());
progress.set(CurOp::get(opCtx)->setProgress_inlock(StringData(curOpMessage),
coll->numRecords(opCtx)));
+ } else {
+ const auto entry = dbCheckWarningHealthLogEntry(
+ info.nss,
+ "abandoning dbCheck batch because collection no longer exists",
+ OplogEntriesEnum::Batch,
+ Status(ErrorCodes::NamespaceNotFound, "collection not found"));
+ HealthLog::get(Client::getCurrent()->getServiceContext()).log(*entry);
+ return;
}
}