[SERVER-42079] all non-primary-started index builds should be labeled backgroundSecondary Created: 03/Jul/19  Updated: 29/Oct/23  Resolved: 05/Jul/19

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: 4.0.11, 4.2.0-rc3, 4.3.1

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

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2, v4.0
Sprint: Execution Team 2019-07-15
Participants:
Linked BF Score: 13

 Description   

The logic for setting the backgroundSecondary flag in an index spec for an index build currently checks replCoord->getMemberState().secondary():
https://github.com/mongodb/mongo/blob/8071e24f0f7a4fa83015daa59d828c11c246423c/src/mongo/db/catalog/index_build_block.cpp#L85

This causes such builds to be mislabeled if the node happens to be in state RECOVERING. The effect of this is that if the node starts and discovers such an unfinished index build, it will remove the catalog entry instead of continuing the index build, thus causing the index to be lost on that node.



 Comments   
Comment by Githook User [ 18/Jul/19 ]

Author:

{'name': 'Eric Milkie', 'email': 'milkie@10gen.com', 'username': 'milkie'}

Message: SERVER-42079 all non-primary index build specs should contain

{backgroundSecondary:true}

Branch: v4.0
https://github.com/mongodb/mongo/commit/d32e18cf7a584a5c0e4b1c787b600dd0623d7c26

Comment by Githook User [ 05/Jul/19 ]

Author:

{'name': 'Eric Milkie', 'email': 'milkie@10gen.com', 'username': 'milkie'}

Message: SERVER-42079 all non-primary index build specs should contain

{backgroundSecondary:true}

(cherry picked from commit 4b90989121808343da76d3b2c29099cf4b545da2)
Branch: v4.2
https://github.com/mongodb/mongo/commit/b6ad46146c28e98263783f692247eeb49486aa27

Comment by Githook User [ 05/Jul/19 ]

Author:

{'name': 'Eric Milkie', 'email': 'milkie@10gen.com', 'username': 'milkie'}

Message: SERVER-42079 all non-primary index build specs should contain

{backgroundSecondary:true}

Branch: master
https://github.com/mongodb/mongo/commit/4b90989121808343da76d3b2c29099cf4b545da2

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