[SERVER-45378] IndexBuildsCoordinator::_setUpIndexBuild() can throw exceptions which should be caught and clean (unregister) the index build Created: 06/Jan/20  Updated: 29/Oct/23  Resolved: 05/Feb/20

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

Type: Bug Priority: Major - P3
Reporter: Suganthi Mani Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-45933 2 phase index build running with maxT... Closed
is related to SERVER-37643 add createIndexes command logic to th... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2020-02-10
Participants:
Linked BF Score: 23

 Description   

 The "IndexBuildsCoordinatorMongod" thread can throw DB exception "ErrorCodes::MaxTimeMSExpired" if the opCtx deadline gets expired. Currently, we acquire locks here in IndexBuildsCoordinator::_setUpIndexBuild which are allowed to throw exceptions. But, we don't catch those exceptions for _setUpIndexBuild(). This can result in server to crash. I feel, we should follow exception handling something similar to IndexBuildsCoordinator::_runIndexBuild.. On catching the exception, we should also make sure we cleanup(unregister) the index build.



 Comments   
Comment by Githook User [ 05/Feb/20 ]

Author:

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

Message: SERVER-45378 clean up IndexBuildsCoordinator::_setUpIndexBuild()
Branch: master
https://github.com/mongodb/mongo/commit/35cf05881732c60b671fbe05c635dd623429c8ee

Comment by Githook User [ 04/Feb/20 ]

Author:

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

Message: SERVER-45378 remove unnecessary IndexBuildCoordinator::_setUpIndexBuild() arguments
Branch: master
https://github.com/mongodb/mongo/commit/58f944406b0e8fdb07b0905f14c839329f335ca6

Comment by Githook User [ 04/Feb/20 ]

Author:

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

Message: SERVER-45378 unregister index build on lock acquisition failure during index build setup
Branch: master
https://github.com/mongodb/mongo/commit/b3c4e02b7454a3b496e038332fb2dd18e905359d

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