[SERVER-61009] Make createIndex a no-op on a cluster key if the collection exists Created: 26/Oct/21  Updated: 29/Oct/23  Resolved: 14/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
is depended on by SERVER-60123 Support using clusterKey {_id : 1} fo... Closed
is depended on by SERVER-60979 TenantCollectionCloner::listIndexesSt... Closed
Related
related to SERVER-62055 Enable tests in clustered_collection_... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2021-11-15, Execution Team 2021-11-29, Execution Team 2021-12-13, Execution Team 2021-12-27
Participants:
Linked BF Score: 15

 Description   

createIndex( { key: <clusterKey>, 'clustered': true}) should behave as follows
(1) no-op if the collection is already clustered by 'cluster key'
(2) implicitly create the collection on clusterKey provided the collection does not yet exist.
(3) Throw if the collection is already clustered, but not on the clusterKey provided in the command

Old Description:
There are several places in the code where listIndexes results are assumed to be standard indexes (non-clustered).

Since the 'clustered' index for a clustered collection is also outputted in listIndexes, we want to prevent trying to build it / handle it as a standard index.

eg) SERVER-60979



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

Author:

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

Message: SERVER-61009 Make createIndex a no-op on a cluster key and allow 'clustered' on cluster key
Branch: master
https://github.com/mongodb/mongo/commit/aa3e4bb18dec429a7fdec60fa8a17e19045c398a

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