diff options
Diffstat (limited to 'src/mongo/db/exec/delete.cpp')
-rw-r--r-- | src/mongo/db/exec/delete.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/exec/delete.cpp b/src/mongo/db/exec/delete.cpp index ddfeeaaffd0..f4633af95a8 100644 --- a/src/mongo/db/exec/delete.cpp +++ b/src/mongo/db/exec/delete.cpp @@ -164,6 +164,12 @@ namespace mongo { _txn = opCtx; ++_commonStats.unyields; _child->restoreState(opCtx); + + const NamespaceString& ns(_collection->ns()); + massert(28537, + str::stream() << "Demoted from primary while removing from " << ns.ns(), + !_params.shouldCallLogOp || + repl::getGlobalReplicationCoordinator()->canAcceptWritesForDatabase(ns.db())); } void DeleteStage::invalidate(const DiskLoc& dl, InvalidationType type) { |