Details
-
Improvement
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
Sharding
Description
Currently splits and merges generate the new chunk versions based on the current collection version (the highest version across all chunks in the collection) so that the chunk differ will see the changed chunks the next time refresh happens on mongos.
This causes a problem that on all shards except the one, which contains the highest chunk, splits and merges are causing StaleConfigException.
We should add a separate "counter" field to the chunk document, which gets incremented every time a chunk is modified or added and use this as a watermark in the differ instead of using the chunk version. That way we can just bump the minor version of the chunk without causing StaleConfigExceptions to happen.
We can only do that in 3.6 of course, but in order to be able to do it in 3.6 we need to add the counter field in 3.4.