[SERVER-52639] Fail resharding operation if new shard key includes array Created: 05/Nov/20 Updated: 29/Oct/23 Resolved: 02/Mar/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Max Hirschhorn | Assignee: | Alexander Taskov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | PM-234-M2.5, PM-234-T-data-clone, PM-234-T-oplog-apply | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Sprint: | Sharding 2021-02-22, Sharding 2021-03-08 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Linked BF Score: | 153 | ||||||||||||||||||||
| Story Points: | 2 | ||||||||||||||||||||
| Description |
|
Sharding prevents documents with array values for the shard key pattern from being written (for inserts, for updates). We either need a similar restriction for the new shard key while resharding is in-progress, or these inserts/updates must cause the resharding operation to fail. |
| Comments |
| Comment by Githook User [ 02/Mar/21 ] |
|
Author: {'name': 'Alex Taskov', 'email': 'alex.taskov@mongodb.com', 'username': 'alextaskov'}Message: |
| Comment by Max Hirschhorn [ 01/Feb/21 ] |
|
My thought here would be to call ShardKeyPattern::extractShardKeyFromDoc() for every insert and update to the temporary resharding collection as part of ReshardingOpObserver and to throw if ShardKeyPattern::extractShardKeyFromDoc() returns an empty BSONObj. The idea is that both the ReshardingCollectionCloner and ReshardingOplogApplier would cause the recipient shard to transition to the kError state as a result of this exception being propagated to the RecipientStateMachine. |