diff options
Diffstat (limited to 'src/mongo/db/service_entry_point_common.cpp')
-rw-r--r-- | src/mongo/db/service_entry_point_common.cpp | 5 |
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; } |