diff options
author | Jason Chan <jason.chan@mongodb.com> | 2019-11-25 18:58:43 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-06-29 17:54:35 +0000 |
commit | ae50878af2ca1a297067ae7ba351d54d836b6327 (patch) | |
tree | 5298e6829dcc189d5cbd205604ae025e3f39250d | |
parent | 21184efa95bdb654726b9ad516621965d2581976 (diff) | |
download | mongo-ae50878af2ca1a297067ae7ba351d54d836b6327.tar.gz |
SERVER-44779 dassert internal operations that hit a prepareConflict must be marked killable
(cherry picked from commit e5875e47cc5f4c1a1c7878ddc18557366cb9b364)
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.h b/src/mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.h index d2de945877d..9f57969cad7 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.h @@ -79,6 +79,13 @@ int wiredTigerPrepareConflictRetry(OperationContext* opCtx, F&& f) { PrepareConflictTracker::get(opCtx).beginPrepareConflict(); + auto client = opCtx->getClient(); + if (client->isFromSystemConnection()) { + // System (internal) connections that hit a prepare conflict should be killable to prevent + // deadlocks with prepared transactions on replica set step up and step down. + stdx::lock_guard<Client> lk(*client); + dassert(client->shouldKillSystemOperation(lk)); + } // It is contradictory to be running into a prepare conflict when we are ignoring interruptions, // particularly when running code inside an // OperationContext::runWithoutInterruptionExceptAtGlobalShutdown block. Operations executed in |