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

Shard find commands get unnecessarily serialized by the ShardingState refresh rate limiting

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.13
    • Affects Version/s: 3.2.12
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • Sharding 2017-04-17

      The find command implementation in 3.2 indiscriminately calls ShardingState::refreshMetadataIfNeeded even if no migrations or shard version mismatch has been found for the collection being queried.

      This is bad, because the refreshMetadataIfNeeded call is internally rate limited to at most 3 concurrent callers in order to not overwhelm the config server if refresh "is needed". However the rate limiting is done at the wrong place - where the in-memory check is done instead when the refresh from the config server is actually.

      This check should only be done if stale version has been hit and not on all occasions.

            kaloian.manassiev@mongodb.com Kaloian Manassiev
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            0 Vote for this issue
            12 Start watching this issue