[SERVER-60123] Support using clusterKey {_id : 1} for shardKey in a sharded collection Created: 21/Sep/21  Updated: 29/Oct/23  Resolved: 21/Dec/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0

Type: Task Priority: Major - P3
Reporter: Haley Connelly Assignee: Haley Connelly
Resolution: Fixed Votes: 0
Labels: PM-2311-M2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-61009 Make createIndex a no-op on a cluster... Closed
depends on SERVER-61374 Support min/max with clustered $hint Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2021-11-01, Execution Team 2021-11-15, Execution Team 2021-11-29, Execution Team 2021-12-13, Execution Team 2021-12-27
Participants:
Story Points: 2

 Description   

This ticket should enable shardCollection() on an existing clustered collection's cluster key to succeed.

Proposed solution details:
All shardKey validation through the CreateCollectionCoordinator must be modified to consider clusteredIndex options whenever present. The options taken from listCollections will be used to construct the clustered collection on participant shards.



 Comments   
Comment by Githook User [ 21/Dec/21 ]

Author:

{'name': 'Haley Connelly', 'email': 'haley.connelly@mongodb.com', 'username': 'haleyConnelly'}

Message: SERVER-60123 Support sharding by cluster key _id on explicitly created clustered collection
Branch: master
https://github.com/mongodb/mongo/commit/3130c8146113e2c2efb4615cf93630f42fd9f1bf

Comment by Haley Connelly [ 10/Nov/21 ]

Depends on SERVER-61374 for orphan cleanup checks

Comment by Haley Connelly [ 29/Oct/21 ]

Sharding (almost) appears to work right out of the box. With a small change to avoid adding the clusteredIndex from listIndexes output, sharded clustered collections can be created and move chunks can be performed. 

Marking as dependent on SERVER-61009 since those changes should enable sharding to work while avoiding having to special case the clusteredIndex from the listIndexes() output

Comment by Haley Connelly [ 19/Oct/21 ]

Either in this ticket or in a new ticket we should switch all the "core" clustered collection jstests to allow for sharding environments

Generated at Thu Feb 08 05:49:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.