summaryrefslogtreecommitdiff
path: root/src/mongo/db/service_entry_point_common.cpp
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2020-12-10 16:10:30 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-03-04 23:28:32 +0000
commit82dd40f60c55dae12426c08fd7150d79a0e28e23 (patch)
treee041f9ccd41b2ef861f2b54dcf882b075a581da2 /src/mongo/db/service_entry_point_common.cpp
parent9387b3daca940c1c2b8a7527f62bb7bab42b187f (diff)
downloadmongo-r4.2.13.tar.gz
SERVER-47568 Disable clusterTime gossiping for nodes in unreadable statesr4.2.13-rc2r4.2.13
(cherry picked from commit 024b130c5e66bafd99cf7f899cdef8d23284ef81)
Diffstat (limited to 'src/mongo/db/service_entry_point_common.cpp')
-rw-r--r--src/mongo/db/service_entry_point_common.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/service_entry_point_common.cpp b/src/mongo/db/service_entry_point_common.cpp
index a5068b83d58..9a4b200d37a 100644
--- a/src/mongo/db/service_entry_point_common.cpp
+++ b/src/mongo/db/service_entry_point_common.cpp
@@ -332,8 +332,9 @@ void appendClusterAndOperationTime(OperationContext* opCtx,
BSONObjBuilder* commandBodyFieldsBob,
BSONObjBuilder* metadataBob,
LogicalTime startTime) {
- if (repl::ReplicationCoordinator::get(opCtx)->getReplicationMode() !=
- repl::ReplicationCoordinator::modeReplSet ||
+ auto replicationCoordinator = repl::ReplicationCoordinator::get(opCtx);
+ if (replicationCoordinator->getReplicationMode() != repl::ReplicationCoordinator::modeReplSet ||
+ !replicationCoordinator->getMemberState().readable() ||
!LogicalClock::get(opCtx)->isEnabled()) {
return;
}