While working on the background validation project, it came to my attention that requires_index_stage.h holds a weak_ptr to a shared_ptr of IndexCatalogEntry. This is used to detect when the underlying index entry has been destroyed.
However, background collection validation holds a shared_ptr to the IndexCatalogEntries it’s validating even when they’ve been removed from the IndexCatalog while periodically yielding locks during validation.
This seems unsafe for requires_index_stage.h to rely on a weak_ptr now. I was thinking if we should change the weak_ptr to a shared_ptr and check the isDropped() flag on the IndexCatalogEntry that was added as part of the background validation project here.