[SERVER-61755] Migration recovery should handle refined shard key Created: 29/Nov/21 Updated: 29/Oct/23 Resolved: 18/Jan/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 5.0.0, 5.2.0, 5.1.0 |
| Fix Version/s: | 5.3.0, 5.2.1, 5.0.7 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Allison Easton | Assignee: | Allison Easton |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Backport Requested: |
v5.2, v5.0
|
||||||||||||||||||||
| Steps To Reproduce: | Attached repro patch |
||||||||||||||||||||
| Sprint: | Sharding EMEA 2021-11-29, Sharding EMEA 2021-12-13, Sharding EMEA 2021-12-27, Sharding EMEA 2022-01-10, Sharding EMEA 2022-01-24 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Linked BF Score: | 33 | ||||||||||||||||||||
| Description |
|
If a refine shard key command finishes before this check in the migration recovery runs, this invariant will be triggered. The function findIntersectingChunk uses string comparisons to find the chunk that contains the key. However, the containsKey function uses BSONObj comparison. In the case where a refine shard key has run, the string comparison will return the correct chunk but the bsonobj comparison will fail because there is an extra field in the shard key. The migration recovery should either specifically handle refine shard key, or the comparisons in findIntersectingChunk and containsKey should be fixed to not return conflicting information. |
| Comments |
| Comment by Githook User [ 25/Jan/22 ] |
|
Author: {'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com', 'username': 'allisoneaston'}Message: (cherry picked from commit a19f0b1c2575b8423c65f56e81d1e077274d0065) |
| Comment by Githook User [ 25/Jan/22 ] |
|
Author: {'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com', 'username': 'allisoneaston'}Message: (cherry picked from commit a19f0b1c2575b8423c65f56e81d1e077274d0065) |
| Comment by Githook User [ 18/Jan/22 ] |
|
Author: {'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com', 'username': 'allisoneaston'}Message: |
| Comment by Jordi Serra Torrens [ 13/Jan/22 ] |
|
I believe this situation was already addressed by |