[SERVER-37918] Fast initial split algorithm produces corrupted routing info if passed unsorted zones list Created: 05/Nov/18  Updated: 29/Oct/23  Resolved: 05/Nov/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 4.0.3
Fix Version/s: 4.0.5, 4.1.5

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

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Sprint: Sharding 2018-11-19
Participants:

 Description   

The fast initial split algorithm operates by iterating the set of zones for a collection and writing chunks for each zone and for each "hole" between zones. However, the main assumption of this logic is that the set of zones comes in sorted order. Otherwise, the results are unpredictable.

The current caller of the algorhtm doesn't pass a sort based on the min key of the tags, which means tags could come in the order in which they were inserted, which is not necessarily sorted.

This is not a data-loss bug, but it renders the Geo sharding feature unusable in random cases.



 Comments   
Comment by Githook User [ 16/Nov/18 ]

Author:

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

Message: SERVER-37918 Improve the messaging around corrupted routing metadata

(cherry picked from commit 8319bd16ad2fdac48db6530570bb5913859509f0)
Branch: v4.0
https://github.com/mongodb/mongo/commit/b02a8a12d698772b88b669435836e5af0828c56b

Comment by Githook User [ 05/Nov/18 ]

Author:

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

Message: SERVER-37918 Make sure tags passed to the fast initial split algorithm are in sorted order

(cherry picked from commit b0c9a1c8419d7a343c2a0496f2cd6a7c0c4d8c92)
Branch: v4.0
https://github.com/mongodb/mongo/commit/650d5df4c7f033da7cae1d50c3cdb43c6d1c9739

Comment by Githook User [ 05/Nov/18 ]

Author:

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

Message: SERVER-37918 Improve the messaging around corrupted routing metadata
Branch: master
https://github.com/mongodb/mongo/commit/8319bd16ad2fdac48db6530570bb5913859509f0

Comment by Githook User [ 05/Nov/18 ]

Author:

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

Message: SERVER-37918 Make sure tags passed to the fast initial split algorithm are in sorted order
Branch: master
https://github.com/mongodb/mongo/commit/b0c9a1c8419d7a343c2a0496f2cd6a7c0c4d8c92

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