Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-51133

$indexStats should consider index visibility in relation to its snapshot

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.9.0
    • 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

        Activity

          People

            louis.williams@mongodb.com Louis Williams
            louis.williams@mongodb.com Louis Williams
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: