diff options
author | Josef Ahmad <josef.ahmad@mongodb.com> | 2021-12-22 11:47:44 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-12-22 12:12:52 +0000 |
commit | 1bb26e23c16f3f43ef477fc91cacabdf962d16f0 (patch) | |
tree | 94ea8a0045e3a76561a6e3bd04f008fc274fbed1 | |
parent | d9c83ee0c93970029e41234c77dc20b2c5ca6291 (diff) | |
download | mongo-1bb26e23c16f3f43ef477fc91cacabdf962d16f0.tar.gz |
SERVER-62210 Fix dbCheck progress meter for dropped and recreated collections
-rw-r--r-- | src/mongo/db/commands/dbcheck.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mongo/db/commands/dbcheck.cpp b/src/mongo/db/commands/dbcheck.cpp index 03317dd132e..145c792b808 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; } } |