summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2019-09-10 19:03:36 +0000
committerevergreen <evergreen@mongodb.com>2019-09-10 19:03:36 +0000
commit5a0f718e1309a4484580d8038016d043ef3b887f (patch)
tree7a331d57ba6e33e61f96ed69b2aa387003a039ab /src/mongo/db/matcher
parentb9e29cd56ebc9aca06f68eeeda7c523d3dfd6d41 (diff)
downloadmongo-5a0f718e1309a4484580d8038016d043ef3b887f.tar.gz
SERVER-43119 FailPoint cleanup
- Don't use MONGO_INITIALIZER to declare each fail point. We only need one init task in total: freeze and iterate the registry. - remove MONGO_FAIL_POINT_DECLARE macro (extern) - remove MONGO_FAIL_POINT_SHOULD_FAIL macro (FailPoint::shouldFail) - remove MONGO_FAIL_POINT_BLOCK_IF (FailPoint::executeIf) - remove MONGO_FAIL_POINT_BLOCK (FailPoint::execute) - clean up FailPointRegistry and fail_point_service implementation.
Diffstat (limited to 'src/mongo/db/matcher')
-rw-r--r--src/mongo/db/matcher/expression.h4
-rw-r--r--src/mongo/db/matcher/expression_expr.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/matcher/expression.h b/src/mongo/db/matcher/expression.h
index f5bae2f7c55..b476db91330 100644
--- a/src/mongo/db/matcher/expression.h
+++ b/src/mongo/db/matcher/expression.h
@@ -46,7 +46,7 @@ namespace mongo {
* Enabling the disableMatchExpressionOptimization fail point will stop match expressions from
* being optimized.
*/
-MONGO_FAIL_POINT_DECLARE(disableMatchExpressionOptimization);
+extern FailPoint disableMatchExpressionOptimization;
class CollatorInterface;
class MatchExpression;
@@ -143,7 +143,7 @@ public:
static std::unique_ptr<MatchExpression> optimize(std::unique_ptr<MatchExpression> expression) {
// If the disableMatchExpressionOptimization failpoint is enabled, optimizations are skipped
// and the expression is left unmodified.
- if (MONGO_FAIL_POINT(disableMatchExpressionOptimization)) {
+ if (MONGO_unlikely(disableMatchExpressionOptimization.shouldFail())) {
return expression;
}
diff --git a/src/mongo/db/matcher/expression_expr.cpp b/src/mongo/db/matcher/expression_expr.cpp
index f356c4aa25b..62a345ab515 100644
--- a/src/mongo/db/matcher/expression_expr.cpp
+++ b/src/mongo/db/matcher/expression_expr.cpp
@@ -62,7 +62,7 @@ bool ExprMatchExpression::matches(const MatchableDocument* doc, MatchDetails* de
auto value = _expression->evaluate(document, &variables);
return value.coerceToBool();
} catch (const DBException&) {
- if (MONGO_FAIL_POINT(ExprMatchExpressionMatchesReturnsFalseOnException)) {
+ if (MONGO_unlikely(ExprMatchExpressionMatchesReturnsFalseOnException.shouldFail())) {
return false;
}