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

Stop forcing collection version refreshes in chunk manager targeter

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 5.0.2, 5.1.0-rc0
    • 5.0.0-rc7
    • Sharding
    • None
    • Fully Compatible
    • ALL
    • v5.0
    • Sharding EMEA 2021-06-28, Sharding EMEA 2021-07-12

    Description

      When we received a StaleDbVersion error during a batchWrite, in the ChunkManagerTargeter we locally decide if we need to refresh based on some version comparision and if this is the case we force a full refresh of the cached entry.

      If multiple cuncurrent batchWrite operations hit the same StaleShardVersion they will all force a full refresh of the catalog without any kind of synchronization, causing several refreshes of the cached database metadata when actually only one is required.

      When receiving a StaleShardVersion the ChunkManagerTargeter should only call CatalogCache::invalidateShardOrEntireCollectionEntryForShardedCollection() and expect that on the next CatalogCache lookup it will receive the refreshed metadata. In this new approach if we receive several StaleShardVersion concurrently with the same db version we will only perform one refresh.

      Attachments

        Activity

          People

            tommaso.tocci@mongodb.com Tommaso Tocci
            tommaso.tocci@mongodb.com Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: