[SERVER-74235] Create compound indexes before sharding collections in refine_collection_shard_key_crud_ops.js Created: 21/Feb/23 Updated: 29/Oct/23 Resolved: 02/Mar/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 6.3.0-rc0 |
| Fix Version/s: | 7.0.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Pierlauro Sciarelli | Assignee: | Pierlauro Sciarelli |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Backport Requested: |
v6.3
|
||||||||||||||||
| Sprint: | Sharding EMEA 2023-03-06 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||
| Description |
|
Creating the compound index AFTER sharding the collection potentially allows the balancer to kick-in in the middle leading to a failure when trying to refine the shard key. Lengthy explanation Aftwerards, refine happens as part of the refineCollectionShardKey state. A test failure signaled that shard0 did not seem to have the index {a:1, b:1} for test15_fsmdb0.fsmcoll0_25 when trying to refine the shard key from {a:1} to {a:1, b:1}. Question is: why was the index created during the setup not found when trying to refine the shard key? From the logs we can see that:
The migration started on (4) resulted in the recipient cloning the indexes before (5). Hence the index was never created on shard0 because createIndex is not serialized with migrations and is only sent with a scatter gather by routing table to the shards owning chunks (so - at time 4.5 - only to shard1). |
| Comments |
| Comment by Githook User [ 02/Mar/23 ] |
|
Author: {'name': 'Pierlauro Sciarelli', 'email': 'pierlauro.sciarelli@mongodb.com', 'username': 'pierlauro'}Message: |