summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/sync_tail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/sync_tail.cpp')
-rw-r--r--src/mongo/db/repl/sync_tail.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp
index e6b5e7557ee..a642140b72c 100644
--- a/src/mongo/db/repl/sync_tail.cpp
+++ b/src/mongo/db/repl/sync_tail.cpp
@@ -1290,7 +1290,8 @@ StatusWith<OpTime> multiApply(OperationContext* txn,
Lock::ParallelBatchWriterMode pbwm(txn->lockState());
auto replCoord = ReplicationCoordinator::get(txn);
- if (replCoord->getMemberState().primary() && !replCoord->isWaitingForApplierToDrain()) {
+ if (replCoord->getMemberState().primary() && !replCoord->isWaitingForApplierToDrain() &&
+ !replCoord->isCatchingUp()) {
severe() << "attempting to replicate ops while primary";
return {ErrorCodes::CannotApplyOplogWhilePrimary,
"attempting to replicate ops while primary"};