diff options
4 files changed, 24 insertions, 4 deletions
diff --git a/jstests/replsets/awaitdata_getmore_new_last_committed_optime.js b/jstests/replsets/awaitdata_getmore_new_last_committed_optime.js index 014ab84618e..4d17389c209 100644 --- a/jstests/replsets/awaitdata_getmore_new_last_committed_optime.js +++ b/jstests/replsets/awaitdata_getmore_new_last_committed_optime.js @@ -10,7 +10,6 @@ // on a failpoint, we only run this test with storage engine that supports snapshot read. // @tags: [ // requires_snapshot_read, -// sbe_incompatible, // ] (function() { diff --git a/jstests/replsets/sync_source_enters_quiesce_mode.js b/jstests/replsets/sync_source_enters_quiesce_mode.js index e4f4da72c95..bc2446c89d1 100644 --- a/jstests/replsets/sync_source_enters_quiesce_mode.js +++ b/jstests/replsets/sync_source_enters_quiesce_mode.js @@ -5,7 +5,6 @@ * @tags: [ * live_record_incompatible, * requires_fcv_47, - * sbe_incompatible, * ] */ (function() { diff --git a/src/mongo/db/query/plan_executor_impl.cpp b/src/mongo/db/query/plan_executor_impl.cpp index 7c5f5dd4871..e6378ae3177 100644 --- a/src/mongo/db/query/plan_executor_impl.cpp +++ b/src/mongo/db/query/plan_executor_impl.cpp @@ -76,10 +76,12 @@ using std::vector; const OperationContext::Decoration<repl::OpTime> clientsLastKnownCommittedOpTime = OperationContext::declareDecoration<repl::OpTime>(); -namespace { - +// This failpoint is also accessed by the SBE executor so we define it outside of an anonymous +// namespace. MONGO_FAIL_POINT_DEFINE(planExecutorHangBeforeShouldWaitForInserts); +namespace { + /** * Constructs a PlanYieldPolicy based on 'policy'. */ diff --git a/src/mongo/db/query/plan_executor_sbe.cpp b/src/mongo/db/query/plan_executor_sbe.cpp index 792f832f28b..6f7e9fe4ba0 100644 --- a/src/mongo/db/query/plan_executor_sbe.cpp +++ b/src/mongo/db/query/plan_executor_sbe.cpp @@ -27,6 +27,8 @@ * it in the license file. */ +#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kQuery + #include "mongo/platform/basic.h" #include "mongo/db/query/plan_executor_sbe.h" @@ -37,8 +39,12 @@ #include "mongo/db/query/plan_explainer_factory.h" #include "mongo/db/query/plan_insert_listener.h" #include "mongo/db/query/sbe_stage_builder.h" +#include "mongo/logv2/log.h" namespace mongo { +// This failpoint is defined by the classic executor but is also accessed here. +extern FailPoint planExecutorHangBeforeShouldWaitForInserts; + PlanExecutorSBE::PlanExecutorSBE(OperationContext* opCtx, std::unique_ptr<CanonicalQuery> cq, sbe::CandidatePlans candidates, @@ -233,6 +239,20 @@ PlanExecutor::ExecState PlanExecutorSBE::getNext(BSONObj* out, RecordId* dlOut) _root->close(); _state = State::kClosed; + if (MONGO_unlikely(planExecutorHangBeforeShouldWaitForInserts.shouldFail( + [this](const BSONObj& data) { + if (data.hasField("namespace") && + _nss != NamespaceString(data.getStringField("namespace"))) { + return false; + } + return true; + }))) { + LOGV2(5567001, + "PlanExecutor - planExecutorHangBeforeShouldWaitForInserts fail point " + "enabled. Blocking until fail point is disabled"); + planExecutorHangBeforeShouldWaitForInserts.pauseWhileSet(); + } + if (!insert_listener::shouldWaitForInserts(_opCtx, _cq.get(), _yieldPolicy.get())) { return PlanExecutor::ExecState::IS_EOF; } |