summaryrefslogtreecommitdiff
path: root/src/mongo/db/vector_clock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/vector_clock.cpp')
-rw-r--r--src/mongo/db/vector_clock.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/vector_clock.cpp b/src/mongo/db/vector_clock.cpp
index 24ce442a417..89b0f3ccd90 100644
--- a/src/mongo/db/vector_clock.cpp
+++ b/src/mongo/db/vector_clock.cpp
@@ -349,6 +349,9 @@ const VectorClock::ComponentArray<std::unique_ptr<VectorClock::GossipFormat>>
bool VectorClock::gossipOut(OperationContext* opCtx,
BSONObjBuilder* outMessage,
const transport::Session::TagMask defaultClientSessionTags) const {
+ if (!isEnabled()) {
+ return false;
+ }
auto clientSessionTags = defaultClientSessionTags;
if (opCtx && opCtx->getClient()) {
clientSessionTags = opCtx->getClient()->getSessionTags();
@@ -365,6 +368,9 @@ void VectorClock::gossipIn(OperationContext* opCtx,
const BSONObj& inMessage,
bool couldBeUnauthenticated,
const transport::Session::TagMask defaultClientSessionTags) {
+ if (!isEnabled()) {
+ return;
+ }
auto clientSessionTags = defaultClientSessionTags;
if (opCtx && opCtx->getClient()) {
clientSessionTags = opCtx->getClient()->getSessionTags();