On 3.6 and 4.0, we only increment the collection minor version when a chunk is split or merged. The original reasoning for this was to prevent unnecessary routing table refreshes on the routers, which don't ordinarily need to know about chunk splits (since they don't change targeting information).
However, when a chunk split operation fails in 3.6, we refresh the routing table on the shard. When the routing table is refreshed, any shard whose shard version is less than the collection version will then have its shard version bumped. This means that on all but one shard (the shard whose shard version is equal to the collection version), this means that subsequent requests to that shard will trigger a refresh on the router anyways.
In other words, only incrementing the minor version was not achieving its goal anyways, so it's safe to increment the major version instead.
In the case of autosplitting triggered by routers, this is important in the case where the shard being targeted for a split is also the shard whose shard version is equal to the collection version, because a failed chunk split will not cause routers to refresh, and they will simply continue trying to split the same chunk over and over again until something else causes them to refresh.
- is related to
-
SERVER-49433 Stop incrementing the collection major version on chunk splits
- Closed
-
SERVER-49233 Introduce a flag to toggle the logic for bumping collection's major version during split
- Closed
-
SERVER-49479 Create performance test for the effects of refreshes due to autosplitting
- Closed