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

Fix data race over the chunk jumbo flag

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 7.3.3, 7.0.12, 8.0.0-rc7, 6.0.17
    • Affects Version/s: 5.0.0, 6.0.0, 7.0.0, 8.1.0-rc0, 8.0.0-rc4
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v8.0, v7.3, v7.0, v6.0, v5.0
    • CAR Team 2024-05-27
    • 200

      There is a data race on the jumbo flag stored on the RoutingInformationCache since there is no mechanism to serialize its reads and writes.

      The RoutingInformationCache keeps in memory a ChunkInfo struct data for every chunk and it's passed as a non-const reference every time a chunk is consulted, this reference is used to update the jumbo flag on the cache side.

      Here is a point where the jumbo flag is written. And here is a point where the jumbo flag is read.

       

      Some extra clarifications:

      When the jumbo flag is set, we update the config.chunks collection and the cache at the same time. Usually, the chunk updates are only applied to the config.chunks collection and, later, the RoutingInformationCache detects those changes and refreshes the collection's cache. But, in the case of the jumbo flag, we are not increasing the collection version to avoid having an unnecessary refresh on every shard, therefore, we also have to force the update on the cache side, otherwise, we wouldn't see the change until the collection was refreshed.

            Assignee:
            silvia.surroca@mongodb.com Silvia Surroca
            Reporter:
            silvia.surroca@mongodb.com Silvia Surroca
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: