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

Calls to ShardRegistry::reload needs to be serialized

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.3.2
    • Fix Version/s: 3.2.4, 3.3.3
    • Component/s: Sharding
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Completed:
    • Sprint:
      Sharding 11 (03/11/16)
    • Linked BF Score:
      0

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: