[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: Text File 0001-Repro-SERVER-61755.patch    
Issue Links:
Backports
Depends
Related
is related to SERVER-53973 Migration manager recovery should han... Closed
is related to SERVER-62332 RefineCollectionShardKeyCoordinator d... Closed
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: SERVER-61755 Migration recovery should handle refined shard key

(cherry picked from commit a19f0b1c2575b8423c65f56e81d1e077274d0065)
Branch: v5.0
https://github.com/mongodb/mongo/commit/6b0be4d9a7c69d41497bb154aaf59df16fe81499

Comment by Githook User [ 25/Jan/22 ]

Author:

{'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com', 'username': 'allisoneaston'}

Message: SERVER-61755 Migration recovery should handle refined shard key

(cherry picked from commit a19f0b1c2575b8423c65f56e81d1e077274d0065)
Branch: v5.2
https://github.com/mongodb/mongo/commit/5bfab44f4eb5f6c7d977996f8cae8208e9116230

Comment by Githook User [ 18/Jan/22 ]

Author:

{'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com', 'username': 'allisoneaston'}

Message: SERVER-61755 Migration recovery should handle refined shard key
Branch: master
https://github.com/mongodb/mongo/commit/a19f0b1c2575b8423c65f56e81d1e077274d0065

Comment by Jordi Serra Torrens [ 13/Jan/22 ]

I believe this situation was already addressed by SERVER-48198 by extending the bounds of the recovered migration recovery document. However, it looks like SERVER-47985 (not sure if intentionally) reverted this change and also modified the test case that I expect would have caught this regression.

Generated at Thu Feb 08 05:53:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.