diff options
author | Benety Goh <benety@mongodb.com> | 2021-10-01 19:02:09 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-10-01 19:35:48 +0000 |
commit | fac8064540ae6159bb010ef6f71947e749be3e9f (patch) | |
tree | 7dc17225c4c97cd7761fc271ffb0bfea90822d78 /src/mongo/db/repl | |
parent | 3a5fdbfcf053b1b165a474705639e0ef0fe28b88 (diff) | |
download | mongo-fac8064540ae6159bb010ef6f71947e749be3e9f.tar.gz |
SERVER-60351 writing last vote to local.replset.election should not acquire PBWM lock
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_external_state_impl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp index cb0e9e9bcd6..3f4ace4b665 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp @@ -685,6 +685,11 @@ Status ReplicationCoordinatorExternalStateImpl::storeLocalLastVoteDocument( Status status = writeConflictRetry(opCtx, "save replica set lastVote", lastVoteCollectionName, [&] { + // Writes to non-replicated collections do not need concurrency control with the + // OplogApplier that never accesses them. Skip taking the PBWM. + ShouldNotConflictWithSecondaryBatchApplicationBlock shouldNotConflictBlock( + opCtx->lockState()); + AutoGetCollection coll(opCtx, NamespaceString(lastVoteCollectionName), MODE_IX); WriteUnitOfWork wunit(opCtx); |