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

Race in catalog cache loader

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.8
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Linked BF Score:
      17

      Description

      In CatalogCache::checkEpochOrThrow() we check if there pointer to routingInfo associated with a collection is non-null.

      In _scheduleCollectionRefresh() (which may run at the same time as a call to checkEpochOrThrow()), we std::move() from collEntry->routingInfo. See here. (Keep in mind that std::move()ing from a shared pointer will "transfer" the reference count to the left hand side, and set the right hand side to nullptr).

      The routingInfo is reset once the refresh has completed here. This means that in the period during which the refresh is happening (after we've scheduled the refresh, dropped the mutex, and are waiting for the background thread here), the collection's routingInfo will be nullptr, so it will appear to be unsharded.

        Attachments

          Activity

            People

            Assignee:
            ian.boros Ian Boros
            Reporter:
            ian.boros Ian Boros
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: