[SERVER-32033] Allow dropIndex to succeed when index build is in progress Created: 19/Nov/17  Updated: 28/Jan/20  Resolved: 28/Jan/20

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Cailin Nelson Assignee: Gregory Wlodarek
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-37726 Make dropIndexes abort in-progress in... Closed
Related
related to SERVER-33634 Allow dropDatabase (and dropCollectio... Closed
is related to SERVER-21307 Replicated DDL (catalog) operation du... Closed
Sprint: Execution Team 2020-03-09
Participants:
Case:
Linked BF Score: 14

 Description   

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.



 Comments   
Comment by Brian Lane [ 28/Jan/20 ]

Closing this issue as a duplicate of SERVER-37726 where we will have dropIndex abort any in-progress index builds.

Comment by James Wahlin [ 20/Nov/17 ]

Linking SERVER-21307 (Replicated dropIndexes during background index build blocks reads/writes) which should be taken under consideration if implementing this request.

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