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

Shard loader in primary nodes blindly read the version of config.cache.collections

    • Fully Compatible
    • ALL
    • v4.4
    • Sharding 2020-06-15, Sharding 2020-06-29
    • 24

      When the catalog cache loader does a refresh from scratch, it first checks the maximum version that it has from config.cache.collections. This version will be used in the query to get the chunk diffs. It will then combine the result from the diff and config.cache.chunks to form the complete collection metadata. The issue, however, is that the writes in the config.cache.collections and config.cache.chunks are not atomic. This means that it is possible for the version to be higher than what is contained in the config.cache.chunks. This can make the loader falsely believe that it is a certain version, but the contents of the chunk map does not agree with it.

      One example manifestation is that when a shard key refine happens, then the primary stepped down after it modified the config.cache.collections but before it was able to modify the config.cache.chunks (or was rolled back), the new primary will not be able to find the matching exact bounds when trying to migrate because the in memory metadata will still contain the older shard keys despite having the version of post refine.

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

              Created:
              Updated:
              Resolved: