summaryrefslogtreecommitdiff
path: root/src/mongo/s/query/store_possible_cursor.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2015-10-29 17:53:50 -0400
committerDavid Storch <david.storch@10gen.com>2015-11-05 11:22:06 -0500
commit5edafdbf6ca1effcb18d62c8e53b37544afecfcc (patch)
treeef0767a5a91633b10be634cc9469c9df2d193d51 /src/mongo/s/query/store_possible_cursor.cpp
parent911c1a1162ce65dd51fc9bc27a26fc0646b1938c (diff)
downloadmongo-5edafdbf6ca1effcb18d62c8e53b37544afecfcc.tar.gz
SERVER-20596 don't access ClusterCursorManager for single-batch queries
Diffstat (limited to 'src/mongo/s/query/store_possible_cursor.cpp')
-rw-r--r--src/mongo/s/query/store_possible_cursor.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mongo/s/query/store_possible_cursor.cpp b/src/mongo/s/query/store_possible_cursor.cpp
index dd029616936..0014d8fd19f 100644
--- a/src/mongo/s/query/store_possible_cursor.cpp
+++ b/src/mongo/s/query/store_possible_cursor.cpp
@@ -98,14 +98,12 @@ StatusWith<BSONObj> storePossibleCursor(const HostAndPort& server,
ClusterClientCursorParams params(incomingCursorResponse.getValue().getNSS());
params.remotes.emplace_back(server, incomingCursorResponse.getValue().getCursorId());
- auto ccc = stdx::make_unique<ClusterClientCursorImpl>(executor, std::move(params));
- auto pinnedCursor =
- cursorManager->registerCursor(std::move(ccc),
+ auto ccc = ClusterClientCursorImpl::make(executor, std::move(params));
+ auto clusterCursorId =
+ cursorManager->registerCursor(ccc.releaseCursor(),
incomingCursorResponse.getValue().getNSS(),
ClusterCursorManager::CursorType::NamespaceNotSharded,
ClusterCursorManager::CursorLifetime::Mortal);
- CursorId clusterCursorId = pinnedCursor.getCursorId();
- pinnedCursor.returnCursor(ClusterCursorManager::CursorState::NotExhausted);
CursorResponse outgoingCursorResponse(incomingCursorResponse.getValue().getNSS(),
clusterCursorId,