[SERVER-25203] Improve the incremental chunk refresh logic to not rely on the collection version Created: 21/Jul/16  Updated: 06/Dec/22  Resolved: 28/Jul/16

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

Type: Improvement Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding
Participants:

 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.



 Comments   
Comment by Andy Schwerin [ 28/Jul/16 ]

This would be obviated by moving chunk auto splits to the shards, which we'd like to do eventually.

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