summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands.cpp
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2020-12-04 03:24:22 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-12-04 03:59:50 +0000
commit2851094f12d05f96fabe023abb9062f096557c02 (patch)
tree8431ad15af8a1a25098fd0d0cb16c42043b97996 /src/mongo/db/commands.cpp
parent4d32e2bf75963c5ff5d4cdeb98554fb654c0d1de (diff)
downloadmongo-2851094f12d05f96fabe023abb9062f096557c02.tar.gz
SERVER-53199 Auto retry on TTE in ShardingCatalogManager::withTxn().
Also adds a "failLocalClients" option to the failCommand failpoint.
Diffstat (limited to 'src/mongo/db/commands.cpp')
-rw-r--r--src/mongo/db/commands.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp
index 8b6faaa93f9..025def0f609 100644
--- a/src/mongo/db/commands.cpp
+++ b/src/mongo/db/commands.cpp
@@ -595,7 +595,8 @@ bool CommandHelpers::shouldActivateFailCommandFailPoint(const BSONObj& data,
if (cmd->getName() == "configureFailPoint"_sd) // Banned even if in failCommands.
return false;
- if (!client->session()) {
+ if (!(data.hasField("failLocalClients") && data.getBoolField("failLocalClients")) &&
+ !client->session()) {
return false;
}
@@ -604,7 +605,8 @@ bool CommandHelpers::shouldActivateFailCommandFailPoint(const BSONObj& data,
if (auto clientMetadata = ClientMetadata::get(client)) {
appName = clientMetadata->getApplicationName();
}
- auto isInternalClient = client->session()->getTags() & transport::Session::kInternalClient;
+ auto isInternalClient =
+ !client->session() || (client->session()->getTags() & transport::Session::kInternalClient);
if (data.hasField("threadName") && (threadName != data.getStringField("threadName"))) {
return false; // only activate failpoint on thread from certain client