-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 5.0 Required
-
Component/s: None
-
None
-
Storage Execution
-
Fully Compatible
-
ALL
-
Execution Team 2024-06-24, Execution Team 2024-07-08
When we create an index we look up any existing index by the same name and compare the two index descriptors. If they are different we throw an IndexKeySpecsConflict error. If they are identical we return IndexAlreadyExists which is not an error condition. There's also an IndexOptionsConflict error condition where the key and uniquely-identifying options are equivalent to an existing index, but some other options are not identical.
SERVER-47657 added 'unique' and 'sparse' parameters to index signature and gated this feature behind FCV 5.0. However, in doing so it introduced a bug that added 'unique' and 'sparse' to the options maps used for comparison. A nonexistent 'sparse' therefore compares unequal to false.
To fix this bug, do not add unique/sparse to the options maps for comparison. Compare them as bool instead, in which nonexistent key is cast to false.
- is caused by
-
SERVER-47657 Add 'unique' and 'sparse' parameters to index signature
- Closed