[SERVER-40959] forEachCollectionFromDb() should skip collections that were dropped Created: 02/May/19  Updated: 29/Oct/23  Resolved: 03/May/19

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.1.11

Type: Bug Priority: Major - P3
Reporter: Gregory Wlodarek Assignee: Gregory Wlodarek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage NYC 2019-05-06
Participants:
Linked BF Score: 23

 Description   

forEachCollectionFromDb() grabs the collection UUID from the UUIDCatalog iterator, however between getting the UUID and resolving the namespace string, the collection could be dropped as we're not holding any locks and it would return the empty namespace string, hitting an invariant later on.

Additionally, lookupNSSByUUID should use the CollectionCatalogEntry to retrieve the NamespaceString in the event that the Collection pointer is dropped.



 Comments   
Comment by Githook User [ 03/May/19 ]

Author:

{'name': 'Gregory Wlodarek', 'username': 'GWlodarek', 'email': 'gregory.wlodarek@mongodb.com'}

Message: SERVER-40959 use the unique CollectionCatalogEntry pointer to retrieve the NamespaceString instead of the raw Collection pointer
Branch: master
https://github.com/mongodb/mongo/commit/d4281131901438a3ca32ad854685a92cab5473dd

Comment by Githook User [ 03/May/19 ]

Author:

{'name': 'Gregory Wlodarek', 'username': 'GWlodarek', 'email': 'gregory.wlodarek@mongodb.com'}

Message: 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
Branch: master
https://github.com/mongodb/mongo/commit/bc53595723299bcc054080cddd01d1c8f22826dc

Generated at Thu Feb 08 04:56:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.