-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Index Maintenance
-
None
-
Execution Team 2020-03-09
-
(copied to CRM)
-
14
Currently, if you try to drop an index while the index is being built, you receive the following error:
shard-0:PRIMARY> db.bigStuff.dropIndex({x:1}) { "ok" : 0, "errmsg" : "cannot perform operation: a background operation is currently running for collection randomStuff.bigStuff", "code" : 12587, "codeName" : "BackgroundOperationInProgressForNamespace" }
This is confusing, and can be a problem for a user who regrets their decision to create the index and would like to cancel the request. The user can abort the index build by finding the operation in currentOp and then calling killOp. I am unclear if that leaves any index metadata in an inconsistent state, but, regardless, it's not an easy sequence for a distressed user to figure out in a hurry (especially in a sharded cluster). Users would benefit from the dropIndex command being able to do whatever is necessary to safely abort an in-progress index build.
- is duplicated by
-
SERVER-37726 Make dropIndexes abort in-progress index builds
- Closed
- is related to
-
SERVER-21307 Replicated DDL (catalog) operation during background index build blocks reads/writes
- Closed
- related to
-
SERVER-33634 Allow dropDatabase (and dropCollection) to succeed when index build is in progress
- Closed