From b6ad46146c28e98263783f692247eeb49486aa27 Mon Sep 17 00:00:00 2001 From: Eric Milkie Date: Wed, 3 Jul 2019 16:07:35 -0400 Subject: SERVER-42079 all non-primary index build specs should contain {backgroundSecondary:true} (cherry picked from commit 4b90989121808343da76d3b2c29099cf4b545da2) --- src/mongo/db/catalog/index_build_block.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mongo/db') diff --git a/src/mongo/db/catalog/index_build_block.cpp b/src/mongo/db/catalog/index_build_block.cpp index ec37e55430b..adee836bfa5 100644 --- a/src/mongo/db/catalog/index_build_block.cpp +++ b/src/mongo/db/catalog/index_build_block.cpp @@ -76,7 +76,7 @@ Status IndexCatalogImpl::IndexBuildBlock::init(OperationContext* opCtx, Collecti if (auto replCoord = repl::ReplicationCoordinator::get(opCtx)) { isBackgroundSecondaryBuild = replCoord->getReplicationMode() == repl::ReplicationCoordinator::Mode::modeReplSet && - replCoord->getMemberState().secondary() && isBackgroundIndex; + !replCoord->getMemberState().primary() && isBackgroundIndex; } // Setup on-disk structures. -- cgit v1.2.1