diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-05-02 20:22:15 -0400 |
---|---|---|
committer | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-05-02 20:24:08 -0400 |
commit | bc53595723299bcc054080cddd01d1c8f22826dc (patch) | |
tree | a3e62abc36df597701a73d77cebb65de5e70ceac /src/mongo/db | |
parent | dc2f2dee5bd682076a76416fb02157317a9e797b (diff) | |
download | mongo-bc53595723299bcc054080cddd01d1c8f22826dc.tar.gz |
SERVER-40959 forEachCollectionFromDb() should skip collections that return a NamespaceString of size 0 from UUIDCatalog::lookupNSSByUUID() as it may have been dropped since we aren't holding any locks
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/catalog/uuid_catalog_helper.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/catalog/uuid_catalog_helper.cpp b/src/mongo/db/catalog/uuid_catalog_helper.cpp index 1ba42ec7b04..49f79e15007 100644 --- a/src/mongo/db/catalog/uuid_catalog_helper.cpp +++ b/src/mongo/db/catalog/uuid_catalog_helper.cpp @@ -47,6 +47,12 @@ void forEachCollectionFromDb( auto uuid = collectionIt.uuid().get(); auto nss = uuidCatalog.lookupNSSByUUID(uuid); + // If the NamespaceString we resolve by the 'uuid' is empty, the collection was dropped + // and we should move onto the next one. + if (nss.isEmpty()) { + continue; + } + Lock::CollectionLock clk(opCtx, nss, collLockMode); auto collection = uuidCatalog.lookupCollectionByUUID(uuid); |