[SERVER-71614] Add a case to accept to hide an index if it is not compatible with shard key Created: 24/Nov/22  Updated: 29/Oct/23  Resolved: 19/Dec/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 6.0.3, 6.2.0-rc3, 6.3.0-rc0
Fix Version/s: 6.0.4, 6.3.0-rc0

Type: Bug Priority: Major - P3
Reporter: Pol Pinol Assignee: Pol Pinol
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.2, v6.0
Steps To Reproduce:

Set up a sharded cluster with primary nodes at v5.0 a secondary nodes at 6.0.
 

const mongos = st.s; const ns = "test.foo";
const db = mongos.getDB("test"); 
const coll = db.getCollection("foo");   
 
st.adminCommand({enablesharding:db.getName(), primaryShard:st.shard1.shardName}); 
st.adminCommand({shardcollection:ns, key: {skey:1}}); 
 
assert.commandWorked(coll.dropIndexes()); 
assert.commandWorked(coll.createIndex({"a":1})); 
assert.commandWorked(coll.hideIndex("a_1"));

Sprint: Sharding EMEA 2022-11-28, Sharding EMEA 2022-12-12, Sharding EMEA 2022-12-26
Participants:
Linked BF Score: 135

 Description   

Add a case to accept to hide an index if it is not compatible with shard key although we don't have a shard key index.



 Comments   
Comment by Githook User [ 23/Dec/22 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-71614 Add case to hide the index when is not compatible with shard key.

(cherry picked from commit 014381421c79a4d24bed1ebf82b7075db2ce7bd9)
Branch: v6.0
https://github.com/mongodb/mongo/commit/fd849606b1548ba0d47c01216d6fc1f7961f6e90

Comment by Githook User [ 19/Dec/22 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-71614 Add case to hide the index when is not compatible with shard key.
Branch: master
https://github.com/mongodb/mongo/commit/014381421c79a4d24bed1ebf82b7075db2ce7bd9

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