[SERVER-78360] Handle duplicate index in resharding building-index phase Created: 22/Jun/23  Updated: 29/Oct/23  Resolved: 26/Jun/23

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

Type: Bug Priority: Major - P3
Reporter: Jiawei Yang Assignee: Jiawei Yang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2023-06-26, Repl 2023-07-10
Participants:
Linked BF Score: 41

 Description   

If failover happens during building-index phase, the new primary will try starting all the indexes and will fail the resharding if the old primary has already created the index entries in IndexCatalog. We should catch and handle this case by either removing existed indexSpec before calling startIndexBuild or catch the IndexAlreadyExist error.
We should also add a jstest to catch this case.



 Comments   
Comment by Githook User [ 26/Jun/23 ]

Author:

{'name': 'Jiawei Yang', 'email': 'jiawei.yang@mongodb.com', 'username': 'YoungYang0820'}

Message: SERVER-78360 resharding building index phase should wait in progress index build finish
Branch: master
https://github.com/mongodb/mongo/commit/7a424088f5d7fb20f6fcfabb9e26fb5a06f520b3

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