-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Index Maintenance
-
None
-
Fully Compatible
-
ALL
-
v4.2, v4.0
-
Execution Team 2019-07-15
-
13
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.