[SERVER-20960] Default index build option support in config/runtime Created: 16/Oct/15  Updated: 07/Apr/23  Resolved: 17/Jan/19

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 2.6.11, 3.0.7, 3.2.16, 3.4.7, 3.6.9, 4.0.5, 4.1.6
Fix Version/s: None

Type: New Feature Priority: Minor - P4
Reporter: Luke Prochazka Assignee: Louis Williams
Resolution: Done Votes: 23
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-31430 `background:true` is more sensible de... Closed
is duplicated by SERVER-24041 Don´t Allow Foreground Index Creation Closed
is duplicated by SERVER-27867 It would be nice if createIndex ran i... Closed
Related
is related to TOOLS-936 Add option to force mongorestore to b... Closed
Sprint: Storage NYC 2019-01-28
Participants:
Case:
Story Points: 0

 Description   

Add support for index build preferences in the config file and/or mongod runtime parameters.

Specifically to control preferences for background or foreground index build options.

EDIT: in SERVER-24041 the following request was added:

It would be great if I can block foreground index creation by configuration.



 Comments   
Comment by Louis Williams [ 17/Jan/19 ]

As of SERVER-37270 in 4.1.8, all index builds run in the background. Closing as "Gone away" because there is no longer a need to configure a default.

Comment by Nic Cottrell [ 12/Jan/18 ]

It makes sense in the dev environment for the software to create its indexes automatically, so yes this would need to be done in conjunction with a config setting. For production clusters the default could be refuse foreground indexes, but dev clusters could set a config option to allow foreground indexes, which I thought was the idea of this ticket.

Comment by Eric Milkie [ 08/Sep/17 ]

Ernest, it appears that mongomirror was running on a cluster while it was active in production; this situation is not recommended and the behavior of the cluster in that situation is expected. The Epic containing this ticket is to design a new system for index builds that does not exclusively lock a database for their duration – thus removing the problematic behavior of foreground index builds. Once that is in place, the need for a config option will be removed.

Comment by Ernest Mueller [ 08/Sep/17 ]

This would be very helpful. I recently was migrating multiple on premise production Mongos into one Atlas cluster using mongomirror. I migrated the first and it was fine. Then I migrated the second, and since it had a foreground index on it, not only was it not usable, it took the previous collections offline too (which we were using in production). This could have been avoided if I could have enforced background index creation.

Generated at Thu Feb 08 03:55:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.