summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/kill_sessions_remote.cpp
diff options
context:
space:
mode:
authorA. Jesse Jiryu Davis <jesse@mongodb.com>2020-10-02 11:11:45 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-02 18:44:07 +0000
commit9b8d4c2f029e2384fa769014c00091e4de362ea4 (patch)
tree179772b6808276c49fb3c69d22c411993773dc09 /src/mongo/s/commands/kill_sessions_remote.cpp
parent0b805a4119272e83f9ffe9bf7990397be9b0c7e9 (diff)
downloadmongo-9b8d4c2f029e2384fa769014c00091e4de362ea4.tar.gz
SERVER-50375 Ensure mongos forwards API parameters to shards
Diffstat (limited to 'src/mongo/s/commands/kill_sessions_remote.cpp')
-rw-r--r--src/mongo/s/commands/kill_sessions_remote.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mongo/s/commands/kill_sessions_remote.cpp b/src/mongo/s/commands/kill_sessions_remote.cpp
index d9b5ce26ccf..0bda8eacf61 100644
--- a/src/mongo/s/commands/kill_sessions_remote.cpp
+++ b/src/mongo/s/commands/kill_sessions_remote.cpp
@@ -119,9 +119,11 @@ SessionKiller::Result killSessionsRemote(OperationContext* opCtx,
// Generate the kill command.
KillAllSessionsByPatternCmd cmd;
- cmd.setKillAllSessionsByPattern(std::vector<KillAllSessionsByPattern>{
- matcher.getPatterns().begin(), matcher.getPatterns().end()});
-
+ std::vector<KillAllSessionsByPattern> patterns;
+ for (auto& item : matcher.getPatterns()) {
+ patterns.push_back(std::move(item.pattern));
+ }
+ cmd.setKillAllSessionsByPattern(std::move(patterns));
return parallelExec(opCtx, cmd.toBSON(), urbg);
}