summaryrefslogtreecommitdiff
path: root/src/mongo/db/logical_time_validator.cpp
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2021-03-01 15:34:35 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-03-15 23:45:28 +0000
commit3d6f8fab0bf25cdcb9caf2319f64cb18bf8ae9c0 (patch)
tree7ab966769b09cdbf0d0d99b3953e530534de4fc9 /src/mongo/db/logical_time_validator.cpp
parent4686af4495640257d02ddbb787ba3f2647b36255 (diff)
downloadmongo-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.cpp7
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.