diff options
author | Jack Mulrow <jack.mulrow@mongodb.com> | 2021-03-01 15:34:35 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-03-15 23:45:28 +0000 |
commit | 3d6f8fab0bf25cdcb9caf2319f64cb18bf8ae9c0 (patch) | |
tree | 7ab966769b09cdbf0d0d99b3953e530534de4fc9 /src/mongo/db/logical_time_validator.cpp | |
parent | 4686af4495640257d02ddbb787ba3f2647b36255 (diff) | |
download | mongo-3d6f8fab0bf25cdcb9caf2319f64cb18bf8ae9c0.tar.gz |
SERVER-53408 Add tenant migrations passthrough with secondary read preference and causal sessions
Diffstat (limited to 'src/mongo/db/logical_time_validator.cpp')
-rw-r--r-- | src/mongo/db/logical_time_validator.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/logical_time_validator.cpp b/src/mongo/db/logical_time_validator.cpp index 852585aff18..2b65ad4470c 100644 --- a/src/mongo/db/logical_time_validator.cpp +++ b/src/mongo/db/logical_time_validator.cpp @@ -51,6 +51,7 @@ namespace mongo { namespace { MONGO_FAIL_POINT_DEFINE(alwaysValidateClientsClusterTime); +MONGO_FAIL_POINT_DEFINE(externalClientsNeverAuthorizedToAdvanceLogicalClock); MONGO_FAIL_POINT_DEFINE(throwClientDisconnectInSignLogicalTimeForExternalClients); const auto getLogicalTimeValidator = @@ -209,6 +210,12 @@ void LogicalTimeValidator::enableKeyGenerator(OperationContext* opCtx, bool doEn } bool LogicalTimeValidator::isAuthorizedToAdvanceClock(OperationContext* opCtx) { + if (MONGO_unlikely(externalClientsNeverAuthorizedToAdvanceLogicalClock.shouldFail())) { + auto isInternalClient = opCtx->getClient()->session() && + (opCtx->getClient()->session()->getTags() & transport::Session::kInternalClient); + return isInternalClient; + } + auto client = opCtx->getClient(); // Note: returns true if auth is off, courtesy of // AuthzSessionExternalStateServerCommon::shouldIgnoreAuthChecks. |