[SERVER-61158] Convert a non-unique index to a unique index via the collMod command Created: 01/Nov/21  Updated: 29/Oct/23  Resolved: 04/Nov/21

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

Type: Task Priority: Major - P3
Reporter: Pavithra Vetriselvan Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Documented
is documented by DOCS-15151 [SERVER] Convert a non-unique index t... Closed
Related
related to SERVER-61182 [inMemory] collmod_convert_to_unique.... Backlog
related to SERVER-61181 [ephemeralForTest] collmod_convert_to... Closed
related to SERVER-61980 collMod does not consider unique opti... Closed
related to SERVER-61224 Investigate retryability of collMod c... Closed
related to SERVER-63582 Fail gracefully if a user tries conve... Closed
related to SERVER-69874 Document or possibly mitigate scenari... Closed
is related to MONGOSH-1250 [MONGOSH] Incomplete output from coll... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.2
Sprint: Execution Team 2021-11-15
Participants:

 Description   

This should include making the necessary catalog changes, but does not encompass checking for duplicates. We should avoid bumping the data format version so that there aren't any upgrade/downgrade implications.



 Comments   
Comment by Githook User [ 28/Mar/22 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: Revert "SERVER-61158 add unique to collMod index request"

This reverts commit a94046f398f652564813c90cae8c9e419b1f0f6b.
Branch: v4.2
https://github.com/mongodb/mongo/commit/2c6735a418d593d40a61ba8a40300afeed94d1c5

Comment by Githook User [ 28/Mar/22 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: Revert "SERVER-61158 IndexCatalog::refreshEntry() can update metadata"

This reverts commit 0e09eec7acc2dae2fab4d131b6b5c6ef1efd44e9.
Branch: v4.2
https://github.com/mongodb/mongo/commit/d5a2caec52c8abefb2fc06e21755fa63f00aa44c

Comment by Githook User [ 28/Mar/22 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: Revert "SERVER-61158 Convert a non-unique index to a unique index via the collMod command"

This reverts commit fe15f13c05c4bfa65f09f6b60931770277785117.
Branch: v4.2
https://github.com/mongodb/mongo/commit/d38f89d0438e7135e1e0ab09d032e97de0a41b36

Comment by Githook User [ 11/Mar/22 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-61158 Convert a non-unique index to a unique index via the collMod command
Branch: v4.2
https://github.com/mongodb/mongo/commit/fe15f13c05c4bfa65f09f6b60931770277785117

Comment by Githook User [ 11/Mar/22 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-61158 IndexCatalog::refreshEntry() can update metadata
Branch: v4.2
https://github.com/mongodb/mongo/commit/0e09eec7acc2dae2fab4d131b6b5c6ef1efd44e9

Comment by Githook User [ 11/Mar/22 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-61158 add unique to collMod index request
Branch: v4.2
https://github.com/mongodb/mongo/commit/a94046f398f652564813c90cae8c9e419b1f0f6b

Comment by Pavithra Vetriselvan [ 27/Jan/22 ]

garaudy.etienne There isn't, but we're still in the process of making changes to this command's API so I think it would be easier for us to create a DOCS ticket at the end once it's finalized.

Comment by Garaudy Etienne [ 18/Jan/22 ]

Is there a docs ticket associated with this change?

Comment by Githook User [ 04/Nov/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-61158 Convert a non-unique index to a unique index via the collMod command
Branch: master
https://github.com/mongodb/mongo/commit/4a5690123c82851503acac889d1c8e7537522972

Comment by Githook User [ 04/Nov/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-61158 add method to Collection to set unique property in index catalog entry

This adds Collection::updateUniqueSetting() and
BSONCollectionCatalogEntry::IndexMetaData::updateUniqueSetting().
Branch: master
https://github.com/mongodb/mongo/commit/d462d6532a5511c5a3c03f23e3d7c044068e8637

Comment by Githook User [ 04/Nov/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-61158 add CreateIndexEntryFlags::kUpdateMetadata

This also restores KVEngine::alterIdentMetadata() which was removed
during 4.4 FCV-related work in commit 8e4f280e492fe2bfb7842733ff640030d559cd0a.
Branch: master
https://github.com/mongodb/mongo/commit/4b04962780d870c4e6afbe2f0ba61bf4865fc2a8

Comment by Githook User [ 04/Nov/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-61158 IndexCatalog::refreshEntry() accepts CreateIndexEntryFlags
Branch: master
https://github.com/mongodb/mongo/commit/058019e29ff1c96f09fa9c183f94bcd840126372

Comment by Githook User [ 03/Nov/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-61158 add unique to collMod index request

This also adds unique_new to the collMod response when the command completes
successfully.
Branch: master
https://github.com/mongodb/mongo/commit/f64776b399ee0934724da0065541886c31da90f4

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