diff options
Diffstat (limited to 'src/mongo/db/query/query_solution.h')
-rw-r--r-- | src/mongo/db/query/query_solution.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mongo/db/query/query_solution.h b/src/mongo/db/query/query_solution.h index 4d3c272f7fa..6445b7d8f2f 100644 --- a/src/mongo/db/query/query_solution.h +++ b/src/mongo/db/query/query_solution.h @@ -326,7 +326,7 @@ struct QuerySolutionNodeWithSortSet : public QuerySolutionNode { */ class QuerySolution { public: - QuerySolution() = default; + explicit QuerySolution(size_t plannerOptions) : plannerOptions(plannerOptions) {} /** * Return true if this solution tree contains a node of the given 'type'. @@ -362,6 +362,18 @@ public: */ void setRoot(std::unique_ptr<QuerySolutionNode> root); + /** + * Returns true if the execution plan which is constructed from this QuerySolution should check + * that the node is eligible to serve reads prior to actually performing any reads. + */ + bool shouldCheckCanServeReads() const { + return !(plannerOptions & QueryPlannerParams::OMIT_REPL_STATE_PERMITS_READS_CHECK); + } + + // A bit vector of flags which clients to the QueryPlanner pass to control which plans are + // generated and their properties. + const size_t plannerOptions; + // There are two known scenarios in which a query solution might potentially block: // // Sort stage: |