[SERVER-41480] Increment collection major version on chunk splits/merges Created: 03/Jun/19  Updated: 29/Oct/23  Resolved: 22/Jul/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.6.15, 4.0.13, 4.3.1, 4.2.2

Type: Bug Priority: Major - P3
Reporter: Matthew Saltz (Inactive) Assignee: Matthew Saltz (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-49433 Stop incrementing the collection majo... Closed
is related to SERVER-49233 Introduce a flag to toggle the logic ... Closed
is related to SERVER-49479 Create performance test for the effec... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2, v4.0, v3.6
Sprint: Sharding 2019-07-01, Sharding 2019-07-15, Sharding 2019-07-29
Participants:
Case:

 Description   

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.



 Comments   
Comment by Githook User [ 21/Oct/19 ]

Author:

{'name': 'Matthew Saltz', 'username': 'saltzm', 'email': 'matthew.saltz@mongodb.com'}

Message: SERVER-41480 Increment major version on splits where the shard version equals the collection version

(cherry picked from commit 790609ffb6bc1dac0a3c13d1898d5884e21a1b7a)
Branch: v4.2
https://github.com/mongodb/mongo/commit/d7c96ec405d6fc319f32dabd9b4136d0c29bc99b

Comment by Githook User [ 21/Oct/19 ]

Author:

{'name': 'Matthew Saltz', 'username': 'saltzm', 'email': 'matthew.saltz@mongodb.com'}

Message: SERVER-41480 Increment major version on splits where the shard version equals the collection version

(cherry picked from commit 790609ffb6bc1dac0a3c13d1898d5884e21a1b7a)
Branch: v3.6
https://github.com/mongodb/mongo/commit/f0e88542ab2ba937c25372d02bef3014cda6779f

Comment by Githook User [ 13/Aug/19 ]

Author:

{'name': 'Matthew Saltz', 'email': 'matthew.saltz@mongodb.com', 'username': 'saltzm'}

Message: SERVER-41480 Increment major version on splits where the shard version equals the collection version

(cherry picked from commit 790609ffb6bc1dac0a3c13d1898d5884e21a1b7a)
Branch: v4.0
https://github.com/mongodb/mongo/commit/6c6f2be0cba78f4e75400d6cd1c0acbd793a7edb

Comment by Githook User [ 22/Jul/19 ]

Author:

{'name': 'Matthew Saltz', 'username': 'saltzm', 'email': 'matthew.saltz@mongodb.com'}

Message: SERVER-41480 Increment major version on splits where the shard version equals the collection version
Branch: master
https://github.com/mongodb/mongo/commit/790609ffb6bc1dac0a3c13d1898d5884e21a1b7a

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