summaryrefslogtreecommitdiff
path: root/src/mongo/transport
diff options
context:
space:
mode:
authorYoonsoo Kim <yoonsoo.kim@mongodb.com>2021-05-07 20:24:40 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-07 22:57:48 +0000
commitf8fbeb7e49303088e6a9cf5e8e6e7ec1b4cf7938 (patch)
tree7dd7c61daf5fbb80f6e4fddd55554c1943e6b081 /src/mongo/transport
parent4a5a29bad42924fb5de2eba5a17b6f8c2fb435ee (diff)
downloadmongo-f8fbeb7e49303088e6a9cf5e8e6e7ec1b4cf7938.tar.gz
SERVER-56505 Removed a deprecated wire OP_KILL_CURSORS request
Diffstat (limited to 'src/mongo/transport')
-rw-r--r--src/mongo/transport/SConscript1
-rw-r--r--src/mongo/transport/service_state_machine.cpp6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/transport/SConscript b/src/mongo/transport/SConscript
index 1cd3d65f7ce..b0dc247c673 100644
--- a/src/mongo/transport/SConscript
+++ b/src/mongo/transport/SConscript
@@ -115,6 +115,7 @@ env.Library(
LIBDEPS=[
'$BUILD_DIR/mongo/db/auth/authentication_restriction',
'$BUILD_DIR/mongo/db/dbmessage',
+ '$BUILD_DIR/mongo/db/query/command_request_response',
'$BUILD_DIR/mongo/db/server_options_core',
'$BUILD_DIR/mongo/db/service_context',
'$BUILD_DIR/mongo/db/stats/counters',
diff --git a/src/mongo/transport/service_state_machine.cpp b/src/mongo/transport/service_state_machine.cpp
index befb06f95b7..52b8df8b438 100644
--- a/src/mongo/transport/service_state_machine.cpp
+++ b/src/mongo/transport/service_state_machine.cpp
@@ -40,6 +40,7 @@
#include "mongo/db/client.h"
#include "mongo/db/client_strand.h"
#include "mongo/db/dbmessage.h"
+#include "mongo/db/query/kill_cursors_gen.h"
#include "mongo/db/stats/counters.h"
#include "mongo/db/traffic_recorder.h"
#include "mongo/logv2/log.h"
@@ -644,7 +645,10 @@ void ServiceStateMachine::Impl::cleanupExhaustResources() noexcept try {
// Fire and forget. This is a best effort attempt to immediately clean up the exhaust
// cursor. If the killCursors request fails here for any reasons, it will still be cleaned
// up once the cursor times out.
- _sep->handleRequest(opCtx.get(), makeKillCursorsMessage(cursorId)).get();
+ auto nss = NamespaceString(request.getDatabase(), request.body["collection"].String());
+ auto req = OpMsgRequest::fromDBAndBody(
+ request.getDatabase(), KillCursorsCommandRequest(nss, {cursorId}).toBSON(BSONObj{}));
+ _sep->handleRequest(opCtx.get(), req.serialize()).get();
}
} catch (const DBException& e) {
LOGV2(22992,