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

AutoGetCollection should have an invalid CollectionPtr while CollectionWriter is active

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing

      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:
            Unassigned Unassigned
            Reporter:
            jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: