diff options
author | Matthew Russotto <matthew.russotto@mongodb.com> | 2023-05-10 13:38:39 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-05-16 22:01:20 +0000 |
commit | 00635530f8dd4d98d765de4c215a495c49036d16 (patch) | |
tree | 7b174f76b082c885e3a37667474dd48891e77558 /src/mongo/db | |
parent | 9354aa6ccf769929ed3e7bd09f0dd95f8ab3a2a2 (diff) | |
download | mongo-00635530f8dd4d98d765de4c215a495c49036d16.tar.gz |
SERVER-76987 Make oplog notification robust to step-up
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_external_state_impl.cpp | 4 |
1 files changed, 4 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 7c7640c7be5..ea28a21a1f3 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp @@ -516,6 +516,10 @@ OpTime ReplicationCoordinatorExternalStateImpl::onTransitionToPrimary(OperationC << ReplicationCoordinator::newPrimaryMsg)); wuow.commit(); }); + // As far as the storage system is concerned, we're still secondary here, and will be until we + // change readWriteAbility. So new and resumed lock-free reads will read from lastApplied. We + // just advanced lastApplied by writing the no-op, so we need to signal oplog waiters. + signalOplogWaiters(); const auto loadLastOpTimeAndWallTimeResult = loadLastOpTimeAndWallTime(opCtx); fassert(28665, loadLastOpTimeAndWallTimeResult); auto opTimeToReturn = loadLastOpTimeAndWallTimeResult.getValue().opTime; |