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

Calls to ShardRegistry::reload needs to be serialized

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.4, 3.3.3
    • Affects Version/s: 3.3.2
    • Component/s: Sharding
    • Labels:
    • Fully Compatible
    • ALL
    • Sharding 11 (03/11/16)
    • 0

      Currently it is possible for multiple threads to call reload and we use the $replData lastVisibleOpTime to disregard older data:

      https://github.com/mongodb/mongo/blob/r3.2.0/src/mongo/s/client/shard_registry.cpp#L190-l195

      The problem with this is that lastVisibleOpTime gives you the opTime that is guaranteed to include the data you just read. In other words, it is possible for the lastVisibleOpTime to be way newer than the data you read; which also means that it is possible for the returned shard list that was actually older than the currently stored one to have a newer lastVisibleOpTime and override the shard list. This will cause a momentary "shard not found" error until the next reload.

            Assignee:
            randolph@mongodb.com Randolph Tan
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: