Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
None
-
Fully Compatible
-
ALL
-
Execution Team 2020-10-19
-
23
Description
$indexStats may read at a point in time where it observes an index completed in the CollectionIndexUsageTracker (in-memory), but whose durable catalog information is not visible in the current snapshot.
As of SERVER-47866, $indexStats needs to consider each index's visibility, because it is no longer protected from AutoGetCollectionForRead.
I see a few options:
- Don't report indexes that have a minimumVisibleSnapshot higher than the current read timestamp. Since we setMinimumVisibleSnapshot at the begin and end of an index build, this would fail to report just-completed indexes that otherwise should be seen as in-progress.
- Create a helpers IndexCatalogEntry::isPresentInMySnapshot() and IndexCatalogEntry::isReadyInMySnapshot() that are renamed from the existing _catalogIsPresent and _catalogIsReady functions. This should allow us to preserve the same behavior and without relying on minimumVisibleSnapshot
Note: the reason why the current isReady() check is not sufficient is because of this debug check which does not fail, but will trigger a different invariant in the DurableCatalog::isIndexReady.
Attachments
Issue Links
- related to
-
SERVER-51794 collStats should consider index visibility in relation to its snapshot
-
- Closed
-