[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:
Backports
Depends
Related
related to SERVER-74252 Tests can assume that movePrimary doe... Closed
is related to SERVER-73665 Cloner::copyDb should handle the scen... Closed
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: SERVER-73751 MovePrimary shouldn't copy indexes of sharded collections

(cherry picked from commit c636ba3a9914fd3eddc905d8b1dfc50668e239b4)
Branch: v5.0
https://github.com/mongodb/mongo/commit/8fdd3caaae08ef4f4e97299fb82d802c22c24af6

Comment by Githook User [ 17/Mar/23 ]

Author:

{'name': 'Sergi Mateo Bellido', 'email': 'sergi.mateo-bellido@mongodb.com', 'username': 'smateo'}

Message: SERVER-73751 MovePrimary shouldn't copy indexes of sharded collections

(cherry picked from commit c636ba3a9914fd3eddc905d8b1dfc50668e239b4)
Branch: v6.0
https://github.com/mongodb/mongo/commit/bc6fefe4d5870d6e763d2501ae797a0206eb589d

Comment by Githook User [ 17/Mar/23 ]

Author:

{'name': 'Sergi Mateo Bellido', 'email': 'sergi.mateo-bellido@mongodb.com', 'username': 'smateo'}

Message: SERVER-73751 MovePrimary shouldn't copy indexes of sharded collections

(cherry picked from commit c636ba3a9914fd3eddc905d8b1dfc50668e239b4)
Branch: v6.3
https://github.com/mongodb/mongo/commit/988151ae978b51b5c4c9b28424c96ab6b0a436ce

Comment by Githook User [ 22/Feb/23 ]

Author:

{'name': 'Sergi Mateo Bellido', 'email': 'sergi.mateo-bellido@mongodb.com', 'username': 'smateo'}

Message: SERVER-73751 MovePrimary shouldn't copy indexes of sharded collections
Branch: master
https://github.com/mongodb/mongo/commit/c636ba3a9914fd3eddc905d8b1dfc50668e239b4

Generated at Thu Feb 08 06:25:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.