diff options
author | David Storch <david.storch@mongodb.com> | 2021-01-07 17:23:11 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-01-15 20:52:42 +0000 |
commit | 8ccc099b1821a18a120a9ce483bf64dac1899ad1 (patch) | |
tree | ebe12b1d0209d72077221b5e12398392610273a4 /src/mongo/db/dbhelpers.cpp | |
parent | 601e94d2edd7a07ca5dd3a66bf3bebaaf7597b4a (diff) | |
download | mongo-8ccc099b1821a18a120a9ce483bf64dac1899ad1.tar.gz |
SERVER-53435 Make queries run with DBHelpers plus SBE circumvent 'checkCanServeReadsFor()'
Such queries may be run when a node is neither primary nor
secondary, e.g. as part of executing an initial sync. This
affects only the SBE engine, since SBE's internal lock
policy requires it to have its own calls to
'checkCanServeReadsFor()'.
Diffstat (limited to 'src/mongo/db/dbhelpers.cpp')
-rw-r--r-- | src/mongo/db/dbhelpers.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index cafe10dd59c..94d5ef3e3d3 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -107,6 +107,7 @@ RecordId Helpers::findOne(OperationContext* opCtx, unique_ptr<CanonicalQuery> cq = std::move(statusWithCQ.getValue()); size_t options = requireIndex ? QueryPlannerParams::NO_TABLE_SCAN : QueryPlannerParams::DEFAULT; + options = options | QueryPlannerParams::OMIT_REPL_STATE_PERMITS_READS_CHECK; auto exec = uassertStatusOK(getExecutor( opCtx, &collection, std::move(cq), PlanYieldPolicy::YieldPolicy::NO_YIELD, options)); |