diff options
author | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2019-01-12 09:54:35 -0500 |
---|---|---|
committer | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2019-01-14 16:03:53 -0500 |
commit | f99c8d913706efc48d3b41672eebbb6166e1680b (patch) | |
tree | ffc766e2fcaae87a5cd771acfea10451e1ac2007 /src/mongo/db/curop_failpoint_helpers.cpp | |
parent | ddb5d16aa7a5854d326bff0b6d094b33f1b662b5 (diff) | |
download | mongo-f99c8d913706efc48d3b41672eebbb6166e1680b.tar.gz |
SERVER-38191 Enforce restriction on namespace for failpoints in write_ops
This reverts commit d19bd0c883a338e4f443399c928700381c682e32.
Diffstat (limited to 'src/mongo/db/curop_failpoint_helpers.cpp')
-rw-r--r-- | src/mongo/db/curop_failpoint_helpers.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mongo/db/curop_failpoint_helpers.cpp b/src/mongo/db/curop_failpoint_helpers.cpp index 4df9311cc6d..fb78284f6f8 100644 --- a/src/mongo/db/curop_failpoint_helpers.cpp +++ b/src/mongo/db/curop_failpoint_helpers.cpp @@ -49,12 +49,19 @@ void CurOpFailpointHelpers::waitWhileFailPointEnabled(FailPoint* failPoint, OperationContext* opCtx, const std::string& curOpMsg, const std::function<void(void)>& whileWaiting, - bool checkForInterrupt) { + bool checkForInterrupt, + boost::optional<NamespaceString> nss) { + 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))) { |