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

Calls to ShardRegistry::reload needs to be serialized

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.2.4, 3.3.3
    • 3.3.2
    • Sharding
    • Fully Compatible
    • ALL
    • Sharding 11 (03/11/16)
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: