diff options
author | David Storch <david.storch@10gen.com> | 2018-10-26 17:21:58 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2018-10-31 17:26:35 -0400 |
commit | d6c618fc94ebdfdba5d270e396a084290a54d360 (patch) | |
tree | 81f42ec3ebe8522ebbca4e95a6c1615fccfbdb26 /src/mongo/db/query/plan_executor.h | |
parent | 5180b48eedec5e57e7f12f734d173184bbff2af7 (diff) | |
download | mongo-d6c618fc94ebdfdba5d270e396a084290a54d360.tar.gz |
SERVER-37444 Added RequiresCollectionStage and use for COLLSCAN.
This is a pure refactor with no user-facing changes. It is
the first step in making PlanExecutors check their own
validity during yield recovery, rather than requiring the
invalidating actor to issue a kill notification.
Diffstat (limited to 'src/mongo/db/query/plan_executor.h')
-rw-r--r-- | src/mongo/db/query/plan_executor.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/mongo/db/query/plan_executor.h b/src/mongo/db/query/plan_executor.h index 9c97d30903d..86480562f98 100644 --- a/src/mongo/db/query/plan_executor.h +++ b/src/mongo/db/query/plan_executor.h @@ -306,20 +306,18 @@ public: virtual void saveState() = 0; /** - * Restores the state saved by a saveState() call. + * Restores the state saved by a saveState() call. When this method returns successfully, the + * execution tree can once again be executed via work(). * - * Returns Status::OK() if the state was successfully restored and the execution tree can be - * work()'d. + * Throws a UserException if the state cannot be successfully restored (e.g. a collection was + * dropped or the position of a capped cursor was lost during a yield). If restore fails, it is + * only safe to call dispose(), detachFromOperationContext(), or the destructor. * - * Returns ErrorCodes::QueryPlanKilled if the PlanExecutor was killed while saved. - * - * If allowed, will yield and retry if a WriteConflictException is encountered. If the time - * limit is exceeded during this retry process, returns ErrorCodes::MaxTimeMSExpired. If this - * PlanExecutor is killed during this retry process, returns ErrorCodes::QueryPlanKilled. In - * this scenario, locks will have been released, and will not be held when control returns to - * the caller. + * If allowed by the executor's yield policy, will yield and retry internally if a + * WriteConflictException is encountered. If the time limit is exceeded during this retry + * process, throws ErrorCodes::MaxTimeMSExpired. */ - virtual Status restoreState() = 0; + virtual void restoreState() = 0; /** * Detaches from the OperationContext and releases any storage-engine state. @@ -344,7 +342,7 @@ public: * * This is only public for PlanYieldPolicy. DO NOT CALL ANYWHERE ELSE. */ - virtual Status restoreStateWithoutRetrying() = 0; + virtual void restoreStateWithoutRetrying() = 0; // // Running Support |