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

PIT read across movePrimary ends up with Collection with inconsistent RecordStore pointer

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • CAR Team 2024-03-18, CAR Team 2024-04-01
    • 129

      When movePrimary forces the same collection UUID as in the source, it is possible to end up with a Collection instance which uses an incorrect ident / RecordStore pointer.

      This is possible when:

      • movePrimary a collection from shard0 to shard1.
      • movePrimary the same collection from shard1 back to shard0.
      • A PIT read on shard0 establishes a consistent collection at a point in time before the collection was first moved away.

      (Note: Even if UUID is forced during collection creation, the underlaying ident / WT table will be new).

      The logic for creating a compatible collection involves using the SharedState of the latest collection instance to initialise a new PIT collection instance (link), but fetching of the latest instance only relies on the UUID, which remains the same across movePrimaries. The SharedState contains the pointer to the RecordStore, thus we end up in a situation where the Collection instance is pointing to an incorrect ident.

      Index idents will be correct, as those take a separate path outside the shared state. An specific example of this is dbHash returning corruption errors due to not finding the collection entry corresponding to an index entry, when in fact it is the collection catalog which is incorrect.

      We should fix the logic instantiating PIT compatible Collection instances.

            Assignee:
            yujin.kang@mongodb.com Yujin Kang Park
            Reporter:
            yujin.kang@mongodb.com Yujin Kang Park
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: