summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavi Vetriselvan <pavithra.vetriselvan@mongodb.com>2022-02-08 21:12:16 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-06 17:47:06 +0000
commit53cfd57797aa9a7867c469d425f35f18b8324a78 (patch)
tree8a0156f9451d9d33ab11987b37ac6de429c340bf
parentba218f4a7fd63bf898cef934be794a4cdb8b0c51 (diff)
downloadmongo-53cfd57797aa9a7867c469d425f35f18b8324a78.tar.gz
SERVER-62229 Allow applying index build abort entry when in recoverFromOplogAsStandalone mode
(cherry picked from commit bb6c77de8123856e9eb6bcc4f47479d9e37ddbd7)
-rw-r--r--src/mongo/db/repl_index_build_state.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/repl_index_build_state.cpp b/src/mongo/db/repl_index_build_state.cpp
index 9048112a6dd..eb81219fa95 100644
--- a/src/mongo/db/repl_index_build_state.cpp
+++ b/src/mongo/db/repl_index_build_state.cpp
@@ -175,7 +175,8 @@ void ReplIndexBuildState::abortForShutdown(OperationContext* opCtx) {
void ReplIndexBuildState::onOplogAbort(OperationContext* opCtx, const NamespaceString& nss) const {
auto replCoord = repl::ReplicationCoordinator::get(opCtx);
- bool isPrimary = replCoord->canAcceptWritesFor(opCtx, nss);
+ bool isPrimary = replCoord->canAcceptWritesFor(opCtx, nss) &&
+ !replCoord->getSettings().shouldRecoverFromOplogAsStandalone();
invariant(!isPrimary, str::stream() << "Index build: " << buildUUID);
stdx::unique_lock<Latch> lk(_mutex);