From d19bd0c883a338e4f443399c928700381c682e32 Mon Sep 17 00:00:00 2001 From: Nick Zolnierz Date: Fri, 11 Jan 2019 19:27:28 -0500 Subject: Revert "SERVER-38191 Enforce restriction on namespace for failpoints in write_ops" This reverts commit 587ad0e175cb501e378f4aeaf37199dbb28dd011. --- src/mongo/db/curop_failpoint_helpers.cpp | 11 ++--------- src/mongo/db/curop_failpoint_helpers.h | 3 +-- src/mongo/db/ops/write_ops_exec.cpp | 25 ++++++++----------------- 3 files changed, 11 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/mongo/db/curop_failpoint_helpers.cpp b/src/mongo/db/curop_failpoint_helpers.cpp index fb78284f6f8..4df9311cc6d 100644 --- a/src/mongo/db/curop_failpoint_helpers.cpp +++ b/src/mongo/db/curop_failpoint_helpers.cpp @@ -49,19 +49,12 @@ void CurOpFailpointHelpers::waitWhileFailPointEnabled(FailPoint* failPoint, OperationContext* opCtx, const std::string& curOpMsg, const std::function& whileWaiting, - bool checkForInterrupt, - boost::optional nss) { - + bool checkForInterrupt) { invariant(failPoint); MONGO_FAIL_POINT_BLOCK((*failPoint), options) { - const BSONObj& data = options.getData(); - StringData fpNss = data.getStringField("nss"); - if (nss && !fpNss.empty() && fpNss != nss.get().toString()) { - return; - } - auto origCurOpMsg = updateCurOpMsg(opCtx, curOpMsg); + const BSONObj& data = options.getData(); const bool shouldCheckForInterrupt = checkForInterrupt || data["shouldCheckForInterrupt"].booleanSafe(); while (MONGO_FAIL_POINT((*failPoint))) { diff --git a/src/mongo/db/curop_failpoint_helpers.h b/src/mongo/db/curop_failpoint_helpers.h index 84f15caecb1..acdf01b9889 100644 --- a/src/mongo/db/curop_failpoint_helpers.h +++ b/src/mongo/db/curop_failpoint_helpers.h @@ -55,7 +55,6 @@ public: OperationContext* opCtx, const std::string& curOpMsg, const std::function& whileWaiting = nullptr, - bool checkForInterrupt = false, - boost::optional nss = boost::none); + bool checkForInterrupt = false); }; } diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp index bf46d4fe3eb..23072437272 100644 --- a/src/mongo/db/ops/write_ops_exec.cpp +++ b/src/mongo/db/ops/write_ops_exec.cpp @@ -355,14 +355,12 @@ bool insertBatchAndHandleErrors(OperationContext* opCtx, &hangDuringBatchInsert, opCtx, "hangDuringBatchInsert", - [wholeOp]() { - log() - << "batch insert - hangDuringBatchInsert fail point enabled for namespace " - << wholeOp.getNamespace() << ". Blocking " - "until fail point is disabled."; + []() { + log() << "batch insert - hangDuringBatchInsert fail point enabled. Blocking " + "until fail point is disabled."; }, - true, // Check for interrupt periodically. - wholeOp.getNamespace()); + true // Check for interrupt periodically. + ); if (MONGO_FAIL_POINT(failAllInserts)) { uasserted(ErrorCodes::InternalError, "failAllInserts failpoint active!"); @@ -570,18 +568,11 @@ static SingleWriteResult performSingleUpdateOp(OperationContext* opCtx, boost::optional collection; while (true) { - const auto checkForInterrupt = false; CurOpFailpointHelpers::waitWhileFailPointEnabled( - &hangDuringBatchUpdate, - opCtx, - "hangDuringBatchUpdate", - [ns]() { - log() << "batch update - hangDuringBatchUpdate fail point enabled for nss " << ns - << ". Blocking until " + &hangDuringBatchUpdate, opCtx, "hangDuringBatchUpdate", [opCtx]() { + log() << "batch update - hangDuringBatchUpdate fail point enabled. Blocking until " "fail point is disabled."; - }, - checkForInterrupt, - ns); + }); if (MONGO_FAIL_POINT(failAllUpdates)) { uasserted(ErrorCodes::InternalError, "failAllUpdates failpoint active!"); -- cgit v1.2.1