[SERVER-63582] Fail gracefully if a user tries converting a unique index with old format keys to a non-unique index. Created: 11/Feb/22  Updated: 29/Oct/23  Resolved: 11/Mar/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc0

Type: Improvement 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:
Related
is related to SERVER-61158 Convert a non-unique index to a uniqu... Closed
is related to SERVER-63578 Convert a unique index to a non-uniqu... Closed
is related to SERVER-34263 Make new format unique index creation... Closed
is related to SERVER-63577 Ensure that new unique indexes don't ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2022-03-21
Participants:

 Description   

If a unique index was built before 4.2 and then upgraded to a later major version, it can have mixed format keys. We have no way of ensuring that these indexes only contain new format keys so we should fail the collMod conversion if we detect this scenario.

We can probably check for the internal data format introduced in SERVER-63578 and fail collMod if not.



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

Author:

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

Message: SERVER-63582 validation warns about unique indexes containing keys in old format (without record id)
Branch: master
https://github.com/mongodb/mongo/commit/437c8572e8eec8fae6ecf79a45878735b05155d6

Comment by Githook User [ 10/Mar/22 ]

Author:

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

Message: SERVER-63582 add SortedDataInterface::Cursor:::isRecordIdAtEndOfKeyString()
Branch: master
https://github.com/mongodb/mongo/commit/c285cac4fd07a632e83f59dd2d9add29d2219be7

Comment by Githook User [ 10/Mar/22 ]

Author:

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

Message: SERVER-63582 add collection validation test case for unique indexes with pre-4.2 keys
Branch: master
https://github.com/mongodb/mongo/commit/7213b5ee7e3e83bad94ec66d1a13f63ca8d908a1

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