[SERVER-73751] movePrimary shouldn't create indexes for sharded collections Created: 08/Feb/23 Updated: 29/Oct/23 Resolved: 22/Feb/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 7.0.0-rc0, 5.0.16, 6.0.6, 6.3.0-rc2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Sergi Mateo Bellido | Assignee: | Sergi Mateo Bellido |
| 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, v6.0, v5.0
|
||||||||||||||||||||
| Sprint: | Sharding EMEA 2023-02-06, Sharding EMEA 2023-02-20, Sharding EMEA 2023-03-06 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Linked BF Score: | 9 | ||||||||||||||||||||
| Description |
|
Before cloning unsharded collections, the movePrimary operation creates the indexes that are not present on the destination shard (i.e. the candidate to be primary). This creation of indexes was designed for unsharded collections: since the collection doesn't exist on the destination shard, we create the indexes assuming that the collection doesn't have data. However, we also try to create indexes for sharded collection which is risky because we might hit an invariant if we end up trying to create an index over a collection with data. |
| Comments |
| Comment by Githook User [ 27/Mar/23 ] |
|
Author: {'name': 'Sergi Mateo Bellido', 'email': 'sergi.mateo-bellido@mongodb.com', 'username': 'smateo'}Message: (cherry picked from commit c636ba3a9914fd3eddc905d8b1dfc50668e239b4) |
| Comment by Githook User [ 17/Mar/23 ] |
|
Author: {'name': 'Sergi Mateo Bellido', 'email': 'sergi.mateo-bellido@mongodb.com', 'username': 'smateo'}Message: (cherry picked from commit c636ba3a9914fd3eddc905d8b1dfc50668e239b4) |
| Comment by Githook User [ 17/Mar/23 ] |
|
Author: {'name': 'Sergi Mateo Bellido', 'email': 'sergi.mateo-bellido@mongodb.com', 'username': 'smateo'}Message: (cherry picked from commit c636ba3a9914fd3eddc905d8b1dfc50668e239b4) |
| Comment by Githook User [ 22/Feb/23 ] |
|
Author: {'name': 'Sergi Mateo Bellido', 'email': 'sergi.mateo-bellido@mongodb.com', 'username': 'smateo'}Message: |