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

Stop forcing collection version refreshes in chunk manager targeter

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

      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.

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

              Created:
              Updated:
              Resolved: