diff options
author | Ian Boros <ian.boros@10gen.com> | 2018-01-10 11:41:37 -0500 |
---|---|---|
committer | Ian Boros <ian.boros@10gen.com> | 2018-01-10 11:41:37 -0500 |
commit | da80e97d103434a6bc566c589a23af13477e1a28 (patch) | |
tree | ebf3227fcc30feb6d8c9a0742b20e956ecf25e58 /src/mongo/db/commands/killcursors_cmd.cpp | |
parent | ba1d0d901ef386310457b03eecf9f5c4afce9047 (diff) | |
download | mongo-da80e97d103434a6bc566c589a23af13477e1a28.tar.gz |
SERVER-21710 Add ability to kill pinned cursors on mongod
Diffstat (limited to 'src/mongo/db/commands/killcursors_cmd.cpp')
-rw-r--r-- | src/mongo/db/commands/killcursors_cmd.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/mongo/db/commands/killcursors_cmd.cpp b/src/mongo/db/commands/killcursors_cmd.cpp index dbee95b4976..512ec7e0e94 100644 --- a/src/mongo/db/commands/killcursors_cmd.cpp +++ b/src/mongo/db/commands/killcursors_cmd.cpp @@ -51,14 +51,7 @@ private: Status _checkAuth(Client* client, const NamespaceString& nss, CursorId id) const final { auto opCtx = client->getOperationContext(); const auto check = [client, opCtx, id](CursorManager* manager) { - auto ccPin = manager->pinCursor(opCtx, id, CursorManager::kNoCheckSession); - if (!ccPin.isOK()) { - return ccPin.getStatus(); - } - - const auto* cursor = ccPin.getValue().getCursor(); - AuthorizationSession* as = AuthorizationSession::get(client); - return as->checkAuthForKillCursors(cursor->nss(), cursor->getAuthenticatedUsers()); + return manager->checkAuthForKillCursors(opCtx, id); }; return CursorManager::withCursorManager(opCtx, id, nss, check); @@ -80,7 +73,7 @@ private: return CursorManager::withCursorManager( opCtx, id, nss, [opCtx, id](CursorManager* manager) { - return manager->eraseCursor(opCtx, id, true /* shouldAudit */); + return manager->killCursor(opCtx, id, true /* shouldAudit */); }); } } killCursorsCmd; |