[SERVER-65922] Index build invariant with {prepareUnique: true} Created: 25/Apr/22  Updated: 29/Oct/23  Resolved: 27/Apr/22

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

Type: Bug Priority: Major - P3
Reporter: Gregory Wlodarek Assignee: Yuhong Zhang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.0
Sprint: Execution Team 2022-05-02
Participants:
Linked BF Score: 150

 Description   

[js_test:repro] d20020| {"t":{"$date":"2022-04-25T15:06:10.901+00:00"},"s":"I",  "c":"STORAGE",  "id":20649,   "ctx":"IndexBuildsCoordinatorMongod-0","msg":"Index build: failed","attr":{"buildUUID":{"uuid":{"$uuid":"9d664a1a-9389-4287-b8c6-f611f64b890c"}},"collectionUUID":{"uuid":{"$uuid":"042f6fc1-b3d1-4f58-a403-d695b28187bc"}},"namespace":"test.abc","error":{"code":11000,"codeName":"DuplicateKey","errmsg":"E11000 duplicate key error collection: test.abc index: a_1 dup key: { a: 123.0 }","keyPattern":{"a":1},"keyValue":{"a":123}}}}
[js_test:repro] d20020| {"t":{"$date":"2022-04-25T15:06:10.902+00:00"},"s":"F",  "c":"ASSERT",   "id":23081,   "ctx":"IndexBuildsCoordinatorMongod-0","msg":"Invariant failure","attr":{"expr":"status.isA<ErrorCategory::Interruption>() || status.isA<ErrorCategory::ShutdownError>() || status.code() == ErrorCodes::CannotCreateIndex","msg":"Unexpected error code during index build cleanup: DuplicateKey{ keyPattern: { a: 1.0 }, keyValue: { a: 123.0 } }: E11000 duplicate key error collection: test.abc index: a_1 dup key: { a: 123.0 }","file":"src/mongo/db/index_builds_coordinator.cpp","line":2291}}



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

Author:

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

Message: SERVER-65922 Allow duplicate keys to be inserted before the index build with the `prepareUnique` option commits

(cherry picked from commit b61476a952e1297436c8d9dbd72fc8d4f8b10da4)
Branch: v6.0
https://github.com/mongodb/mongo/commit/c32b4ba278af9a3eea691101be8c617aa1015c4f

Comment by Githook User [ 28/Apr/22 ]

Author:

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

Message: SERVER-65922 Disallow `unique` and `prepareUnique` to exist in the index spec together

(cherry picked from commit fcb9d766b6f66e6a9cfabe1795c1e9d43465b151)
Branch: v6.0
https://github.com/mongodb/mongo/commit/292b6b8a235da387f536f37d97f616be132e0fec

Comment by Githook User [ 26/Apr/22 ]

Author:

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

Message: SERVER-65922 Allow duplicate keys to be inserted before the index build with the `prepareUnique` option commits
Branch: master
https://github.com/mongodb/mongo/commit/b61476a952e1297436c8d9dbd72fc8d4f8b10da4

Comment by Githook User [ 26/Apr/22 ]

Author:

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

Message: SERVER-65922 Disallow `unique` and `prepareUnique` to exist in the index spec together
Branch: master
https://github.com/mongodb/mongo/commit/fcb9d766b6f66e6a9cfabe1795c1e9d43465b151

Generated at Thu Feb 08 06:04:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.