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

listCollections and listIndexes should include commit-pending namespaces

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.2.1, 7.3.0-rc0, 7.0.6
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v7.2, v7.0, v6.0, v5.0
    • CAR Team 2023-11-13, CAR Team 2023-11-27, CAR Team 2023-12-11, CAR Team 2023-12-25
    • 135
    • 3

      listCollections and listIndexes do not include commit-pending metadata. This can race with initial sync: the clone phase may fail to detect a collection or index that is pending commit (specifically, the storage transaction has committed, but the catalog changes are yet to be published to the in-mem catalog), while the beginApplyingTimestamp may point to that catalog change because the storage transaction has committed.
      We have observed a failure where an initial syncing node did not clone a collection that was implicitly created via index creation (two oplog entries, one for collection creation, one for index creation). The beginApplyingTimestamp was set to the optime of the index creation, and listCollections failed to find the collection because it had yet to be published in the in-mem catalog.
      This issue is unlikely to be observed in the field - it requires a careful combination of implicit collection creation + slow commit handlers + initial sync pointing the beginApplyingTimestamp to the creation optime. It has also probably existed since the dawn of time (I've reproduced on 6.0 onwards).
      listCollections and listIndexes always read at latest; one solution would be to include commit-pending entries to their output.

            david.dominguez@mongodb.com David Dominguez Sal (Inactive)
            josef.ahmad@mongodb.com Josef Ahmad
            0 Vote for this issue
            8 Start watching this issue