[SERVER-25527] Send the version of the chunk being moved as part of the shard moveChunk and splitChunk commands Created: 10/Aug/16  Updated: 06/Jan/17  Resolved: 17/Aug/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.3.12

Type: Task Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-25673 Remove ChunkManager use in the Migrat... Closed
related to SERVER-25665 Make splitChunk and moveChunk command... Closed
is related to SERVER-27510 Compare only epochs instead of full c... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2016-08-29
Participants:

 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.



 Comments   
Comment by Githook User [ 17/Aug/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-25527 Make moveChunk and splitChunk commands include the chunk version

Currently this value is ignored by the shard and it will be used by a
subsequent change.
Branch: master
https://github.com/mongodb/mongo/commit/056aad7850061fca084ecaef9951e4a60bcb736c

Generated at Thu Feb 08 04:09:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.