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

Send the version of the chunk being moved as part of the shard moveChunk and splitChunk commands

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.12
    • Component/s: Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Sharding 2016-08-29

      Description

      Currently, mongos sends the collection version as part of the shard's moveChunk/splitChunk requests and MongoD versions 3.2 and earlier check that the collection version matches in the beginning of the operation and then include it as part of the applyOps command that they issue against the config server.

      This check on the collection version effectively serializes all metadata operations for the same collection, even though they might be for different chunks. It seems much more reasonable to send the version of the chunks being modified instead of the entire collection's version. In addition, with parallel migrations available in 3.4 we can no longer use the collection version when committing the migration because it may change when multiple migrations commit at once.

      The road to deprecation of the collectionVersion field should be:

      • 3.2 - mongos sends only the collectionVersion and mongod only understands and checks the collectionVersion;
      • 3.4 - mongos sends both collectionVersion and individual chunkVersion; on mongod, if collectionVersion is present, it only checks that the epoch matches; if chunkVersion is present, checks both the version and the epoch and includes both in the applyOps command against the config server;
      • 3.6 - mongos sends only chunkVersion; mongod only interprets the chunkVersion and fails if it is missing;

      This requires changes on the config server and on the shard itself.

      NOTE: The mongos invocation of the mergeChunks command intentionally does not include either of these fields, because (a) it contains a [min, max) range of chunks to be merged and it is impractical to send version for entry from the range due to the unbounded nature of such information and (b) it is a rare enough and cheap enough operation that having it fail due to collectionVersion mismatch at applyOps time is an acceptable tradeoff.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: