AutoGetCollection should have an invalid CollectionPtr while CollectionWriter is active

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • CAR Team 2025-05-12, CAR Team 2025-05-26
    • 2
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      In SERVER-94563 we made CollectionWriter the only way of modifying a collection instance.

      In doing so we maintained the legacy behaviour of AutoGetCollection::getWritableCollection that updates the AutoGetCollection's internal CollectionPtr to point to the new writable instance. However, this is a difference in behaviour from the replacement Shard Role acquisitions. Acquisitions instead make their internal CollectionPtr a nullptr to mark themselves invalid. Accessing the acquisition's collection will deliberately crash the server in such an event.

      As a result, we have two differing behaviours. Ideally we should only do the latter since that's what acquisitions do.

      This ticket is about looking at instances of CollectionWriter that use AutoGetCollection and see if they access the writable collection through the AutoGetCollection instead of the writer. If none exist then we should ideally modify the behaviour to stay in line with acquisitions.

            Assignee:
            Enrico Golfieri
            Reporter:
            Jordi Olivares Provencio
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: