summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/repair_cursor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/repair_cursor.cpp')
-rw-r--r--src/mongo/db/commands/repair_cursor.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mongo/db/commands/repair_cursor.cpp b/src/mongo/db/commands/repair_cursor.cpp
index bf45608ccff..031370f4316 100644
--- a/src/mongo/db/commands/repair_cursor.cpp
+++ b/src/mongo/db/commands/repair_cursor.cpp
@@ -96,16 +96,13 @@ public:
auto statusWithPlanExecutor = PlanExecutor::make(
opCtx, std::move(ws), std::move(stage), collection, PlanExecutor::YIELD_AUTO);
invariant(statusWithPlanExecutor.isOK());
- std::unique_ptr<PlanExecutor> exec = std::move(statusWithPlanExecutor.getValue());
+ auto exec = std::move(statusWithPlanExecutor.getValue());
- // 'exec' will be used in getMore(). It was automatically registered on construction
- // due to the auto yield policy, so it could yield during plan selection. We deregister
- // it now so that it can be registed with ClientCursor.
- exec->deregisterExec();
exec->saveState();
exec->detachFromOperationContext();
auto pinnedCursor = collection->getCursorManager()->registerCursor(
+ opCtx,
{std::move(exec),
ns,
AuthorizationSession::get(opCtx->getClient())->getAuthenticatedUserNames(),