diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2019-10-03 19:57:40 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-03 19:57:40 +0000 |
commit | 8ccaacce937ae51deef27c41e977aca0511fb338 (patch) | |
tree | 0c29028123f23dc66aef660f05549dd0ebe109b2 /src | |
parent | 4d9a6a2ae4b6ad9b93d3c389e6d92d6acfe86cf3 (diff) | |
download | mongo-8ccaacce937ae51deef27c41e977aca0511fb338.tar.gz |
SERVER-43317 merge failpoint headers. Rewrite docs.
iterate docs
Diffstat (limited to 'src')
137 files changed, 473 insertions, 567 deletions
diff --git a/src/mongo/client/replica_set_change_notifier.cpp b/src/mongo/client/replica_set_change_notifier.cpp index d9333f54122..5edd6d9ec40 100644 --- a/src/mongo/client/replica_set_change_notifier.cpp +++ b/src/mongo/client/replica_set_change_notifier.cpp @@ -33,7 +33,7 @@ #include "mongo/client/replica_set_change_notifier.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/stacktrace.h" diff --git a/src/mongo/client/replica_set_monitor.cpp b/src/mongo/client/replica_set_monitor.cpp index ec7fdc24ddb..d0d9d3e86d1 100644 --- a/src/mongo/client/replica_set_monitor.cpp +++ b/src/mongo/client/replica_set_monitor.cpp @@ -51,7 +51,7 @@ #include "mongo/util/background.h" #include "mongo/util/debug_util.h" #include "mongo/util/exit.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/string_map.h" #include "mongo/util/timer.h" diff --git a/src/mongo/db/catalog/coll_mod.cpp b/src/mongo/db/catalog/coll_mod.cpp index 26eb6766f09..fdcb001a229 100644 --- a/src/mongo/db/catalog/coll_mod.cpp +++ b/src/mongo/db/catalog/coll_mod.cpp @@ -55,7 +55,7 @@ #include "mongo/db/storage/durable_catalog.h" #include "mongo/db/storage/recovery_unit.h" #include "mongo/db/views/view_catalog.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/catalog/collection_impl.cpp b/src/mongo/db/catalog/collection_impl.cpp index 61df6557190..520f6d6e9ef 100644 --- a/src/mongo/db/catalog/collection_impl.cpp +++ b/src/mongo/db/catalog/collection_impl.cpp @@ -72,7 +72,7 @@ #include "mongo/db/auth/user_document_parser.h" // XXX-ANDY #include "mongo/rpc/object_check.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/catalog/collection_validation_test.cpp b/src/mongo/db/catalog/collection_validation_test.cpp index 18072161348..85a648b0f51 100644 --- a/src/mongo/db/catalog/collection_validation_test.cpp +++ b/src/mongo/db/catalog/collection_validation_test.cpp @@ -36,7 +36,7 @@ #include "mongo/db/db_raii.h" #include "mongo/stdx/thread.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { diff --git a/src/mongo/db/catalog/database_impl.cpp b/src/mongo/db/catalog/database_impl.cpp index a072112e7ca..400b5f895c0 100644 --- a/src/mongo/db/catalog/database_impl.cpp +++ b/src/mongo/db/catalog/database_impl.cpp @@ -75,7 +75,7 @@ #include "mongo/platform/random.h" #include "mongo/s/cannot_implicitly_create_collection_info.h" #include "mongo/util/assert_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/catalog/drop_collection.cpp b/src/mongo/db/catalog/drop_collection.cpp index 5167f4f8383..da14e62084b 100644 --- a/src/mongo/db/catalog/drop_collection.cpp +++ b/src/mongo/db/catalog/drop_collection.cpp @@ -44,7 +44,7 @@ #include "mongo/db/server_options.h" #include "mongo/db/service_context.h" #include "mongo/db/views/view_catalog.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/catalog/drop_database.cpp b/src/mongo/db/catalog/drop_database.cpp index bb3747bfc23..ba78b5d8d24 100644 --- a/src/mongo/db/catalog/drop_database.cpp +++ b/src/mongo/db/catalog/drop_database.cpp @@ -48,7 +48,7 @@ #include "mongo/db/service_context.h" #include "mongo/db/write_concern_options.h" #include "mongo/util/duration.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/catalog/index_key_validate.cpp b/src/mongo/db/catalog/index_key_validate.cpp index 164876fe330..5d46cd319bc 100644 --- a/src/mongo/db/catalog/index_key_validate.cpp +++ b/src/mongo/db/catalog/index_key_validate.cpp @@ -50,7 +50,7 @@ #include "mongo/db/query/collation/collator_factory_interface.h" #include "mongo/db/query/query_knobs_gen.h" #include "mongo/db/service_context.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/represent_as.h" #include "mongo/util/str.h" diff --git a/src/mongo/db/catalog/multi_index_block.h b/src/mongo/db/catalog/multi_index_block.h index df940d2121e..2d4d763c91c 100644 --- a/src/mongo/db/catalog/multi_index_block.h +++ b/src/mongo/db/catalog/multi_index_block.h @@ -47,7 +47,7 @@ #include "mongo/db/index/index_access_method.h" #include "mongo/db/record_id.h" #include "mongo/platform/mutex.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { diff --git a/src/mongo/db/catalog/rename_collection.cpp b/src/mongo/db/catalog/rename_collection.cpp index f79632c3c75..f42bac3e5cb 100644 --- a/src/mongo/db/catalog/rename_collection.cpp +++ b/src/mongo/db/catalog/rename_collection.cpp @@ -57,7 +57,7 @@ #include "mongo/db/service_context.h" #include "mongo/db/storage/durable_catalog.h" #include "mongo/db/views/view_catalog.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/catalog/throttle_cursor.h b/src/mongo/db/catalog/throttle_cursor.h index ba4875fe7ed..2240ee9b58e 100644 --- a/src/mongo/db/catalog/throttle_cursor.h +++ b/src/mongo/db/catalog/throttle_cursor.h @@ -34,7 +34,7 @@ #include "mongo/db/storage/record_store.h" #include "mongo/db/storage/sorted_data_interface.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { diff --git a/src/mongo/db/catalog_raii.cpp b/src/mongo/db/catalog_raii.cpp index 254694ec1cc..1a207786be2 100644 --- a/src/mongo/db/catalog_raii.cpp +++ b/src/mongo/db/catalog_raii.cpp @@ -35,7 +35,7 @@ #include "mongo/db/catalog/database_holder.h" #include "mongo/db/s/database_sharding_state.h" #include "mongo/db/views/view_catalog.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { namespace { diff --git a/src/mongo/db/cloner.cpp b/src/mongo/db/cloner.cpp index 16dfcd0cd8f..514097ecc87 100644 --- a/src/mongo/db/cloner.cpp +++ b/src/mongo/db/cloner.cpp @@ -63,7 +63,7 @@ #include "mongo/db/storage/durable_catalog.h" #include "mongo/db/storage/storage_options.h" #include "mongo/util/assert_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/str.h" diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp index f9a08071fae..a9aba5ba218 100644 --- a/src/mongo/db/commands.cpp +++ b/src/mongo/db/commands.cpp @@ -58,7 +58,7 @@ #include "mongo/rpc/protocol.h" #include "mongo/rpc/write_concern_error_detail.h" #include "mongo/s/stale_exception.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/invariant.h" #include "mongo/util/log.h" #include "mongo/util/str.h" diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h index e944f7c238f..6002af5e03e 100644 --- a/src/mongo/db/commands.h +++ b/src/mongo/db/commands.h @@ -49,7 +49,7 @@ #include "mongo/db/write_concern.h" #include "mongo/rpc/op_msg.h" #include "mongo/rpc/reply_builder_interface.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/string_map.h" namespace mongo { diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp index 327983b3bd4..3db0141f5a5 100644 --- a/src/mongo/db/commands/dbcommands.cpp +++ b/src/mongo/db/commands/dbcommands.cpp @@ -88,7 +88,7 @@ #include "mongo/db/storage/storage_engine_init.h" #include "mongo/db/write_concern.h" #include "mongo/scripting/engine.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/md5.hpp" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/commands/dbcommands_d.cpp b/src/mongo/db/commands/dbcommands_d.cpp index 71642bec879..63d13351598 100644 --- a/src/mongo/db/commands/dbcommands_d.cpp +++ b/src/mongo/db/commands/dbcommands_d.cpp @@ -88,7 +88,7 @@ #include "mongo/db/write_concern.h" #include "mongo/s/stale_exception.h" #include "mongo/scripting/engine.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/md5.hpp" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/commands/fail_point_cmd.cpp b/src/mongo/db/commands/fail_point_cmd.cpp index a50cc4ff06d..4eb0d3e3a02 100644 --- a/src/mongo/db/commands/fail_point_cmd.cpp +++ b/src/mongo/db/commands/fail_point_cmd.cpp @@ -37,7 +37,7 @@ #include "mongo/db/auth/privilege.h" #include "mongo/db/commands.h" #include "mongo/db/commands/test_commands_enabled.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { @@ -48,19 +48,24 @@ namespace mongo { * Format * { * configureFailPoint: <string>, // name of the fail point. - * mode: <string|Object>, // the new mode to set. Can have one of the - * following format: * - * 1. 'off' - disable fail point. - * 2. 'alwaysOn' - fail point is always active. - * 3. { activationProbability: <n> } - n should be a double between 0 and 1, - * representing the probability that the fail point will fire. 0 means never, - * 1 means (nearly) always. - * 4. { times: <n> } - n should be positive and within the range of a 32 bit - * signed integer and this is the number of passes on the fail point will - * remain activated. + * mode: <string|Object>, // the new mode to set. Can have one of the following format: * - * data: <Object> // optional arbitrary object to store. + * - 'off' - disable fail point. + * + * - 'alwaysOn' - fail point is always active. + * + * - { activationProbability: <n> } - double n. [0 <= n <= 1] + * n: the probability that the fail point will fire. 0=never, 1=always. + * + * - { times: <n> } - int32 n. n > 0. n: # of passes the fail point remains active. + * + * - { skip: <n> } - int32 n. n > 0. n: # of passes before the fail point activates + * and remains active. + * + * data: <Object> // optional arbitrary object to inject into the failpoint. + * When activated, the FailPoint can read this data and it can be used to inform + * the specific action taken by the code under test. * } */ class FaultInjectCmd : public BasicCommand { diff --git a/src/mongo/db/commands/generic_servers.cpp b/src/mongo/db/commands/generic_servers.cpp index 5fe6e5b56e9..d753f010b4c 100644 --- a/src/mongo/db/commands/generic_servers.cpp +++ b/src/mongo/db/commands/generic_servers.cpp @@ -40,7 +40,6 @@ #include "mongo/scripting/engine.h" #include "mongo/util/exit.h" #include "mongo/util/fail_point.h" -#include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" #include "mongo/util/net/socket_utils.h" #include "mongo/util/ntservice.h" diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp index 345ac9f0049..295c8e0553d 100644 --- a/src/mongo/db/commands/getmore_cmd.cpp +++ b/src/mongo/db/commands/getmore_cmd.cpp @@ -58,7 +58,7 @@ #include "mongo/db/stats/counters.h" #include "mongo/db/stats/top.h" #include "mongo/s/chunk_version.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" #include "mongo/util/time_support.h" diff --git a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp index cfe59311ab4..6232dc35601 100644 --- a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp +++ b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp @@ -50,7 +50,7 @@ #include "mongo/s/database_version_helpers.h" #include "mongo/s/grid.h" #include "mongo/util/exit.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/commands/validate.cpp b/src/mongo/db/commands/validate.cpp index fc2b660b953..35369e9ef7c 100644 --- a/src/mongo/db/commands/validate.cpp +++ b/src/mongo/db/commands/validate.cpp @@ -38,7 +38,7 @@ #include "mongo/db/query/internal_plans.h" #include "mongo/db/storage/durable_catalog.h" #include "mongo/db/storage/record_store.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/concurrency/lock_state.cpp b/src/mongo/db/concurrency/lock_state.cpp index 5f5171e6129..508713b7d02 100644 --- a/src/mongo/db/concurrency/lock_state.cpp +++ b/src/mongo/db/concurrency/lock_state.cpp @@ -44,7 +44,7 @@ #include "mongo/util/background.h" #include "mongo/util/concurrency/ticketholder.h" #include "mongo/util/debug_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" #include "mongo/util/str.h" diff --git a/src/mongo/db/concurrency/lock_state_test.cpp b/src/mongo/db/concurrency/lock_state_test.cpp index f32068aa74b..81a6f59968a 100644 --- a/src/mongo/db/concurrency/lock_state_test.cpp +++ b/src/mongo/db/concurrency/lock_state_test.cpp @@ -40,7 +40,7 @@ #include "mongo/db/concurrency/locker.h" #include "mongo/db/service_context_test_fixture.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/timer.h" diff --git a/src/mongo/db/concurrency/write_conflict_exception.h b/src/mongo/db/concurrency/write_conflict_exception.h index 84089ae86f6..57455d4b12f 100644 --- a/src/mongo/db/concurrency/write_conflict_exception.h +++ b/src/mongo/db/concurrency/write_conflict_exception.h @@ -34,7 +34,7 @@ #include "mongo/base/string_data.h" #include "mongo/db/curop.h" #include "mongo/util/assert_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { diff --git a/src/mongo/db/curop_failpoint_helpers.h b/src/mongo/db/curop_failpoint_helpers.h index 8e2bd1bc08f..a88bbc67e30 100644 --- a/src/mongo/db/curop_failpoint_helpers.h +++ b/src/mongo/db/curop_failpoint_helpers.h @@ -29,7 +29,7 @@ #include "mongo/bson/bsonobj.h" #include "mongo/db/operation_context.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { @@ -42,7 +42,7 @@ public: static std::string updateCurOpMsg(OperationContext* opCtx, const std::string& newMsg); /** - * This helper function works much like MONGO_FAIL_POINT_PAUSE_WHILE_SET, but additionally + * This helper function works much like FailPoint::pauseWhileSet(opCtx), but additionally * calls whileWaiting() at regular intervals. Finally, it also sets the 'msg' field of the * opCtx's CurOp to the given string while the failpoint is active. * diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp index 2b84068ac50..2dc91c831d8 100644 --- a/src/mongo/db/db.cpp +++ b/src/mongo/db/db.cpp @@ -164,7 +164,7 @@ #include "mongo/util/concurrency/thread_name.h" #include "mongo/util/exception_filter_win32.h" #include "mongo/util/exit.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/fast_clock_source_factory.h" #include "mongo/util/log.h" #include "mongo/util/net/socket_utils.h" diff --git a/src/mongo/db/exec/collection_scan.cpp b/src/mongo/db/exec/collection_scan.cpp index 48ace4d7261..f53cf16e4af 100644 --- a/src/mongo/db/exec/collection_scan.cpp +++ b/src/mongo/db/exec/collection_scan.cpp @@ -43,7 +43,7 @@ #include "mongo/db/exec/working_set_common.h" #include "mongo/db/repl/optime.h" #include "mongo/db/storage/oplog_hack.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/db/client.h" // XXX-ERH diff --git a/src/mongo/db/exec/fetch.cpp b/src/mongo/db/exec/fetch.cpp index bb09866f983..6e9eb4fbeb6 100644 --- a/src/mongo/db/exec/fetch.cpp +++ b/src/mongo/db/exec/fetch.cpp @@ -38,7 +38,7 @@ #include "mongo/db/exec/filter.h" #include "mongo/db/exec/scoped_timer.h" #include "mongo/db/exec/working_set_common.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/index/index_build_interceptor.cpp b/src/mongo/db/index/index_build_interceptor.cpp index e8b88e91d1f..00d7b9e444e 100644 --- a/src/mongo/db/index/index_build_interceptor.cpp +++ b/src/mongo/db/index/index_build_interceptor.cpp @@ -46,7 +46,7 @@ #include "mongo/db/multi_key_path_tracker.h" #include "mongo/db/operation_context.h" #include "mongo/db/service_context.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/progress_meter.h" #include "mongo/util/uuid.h" diff --git a/src/mongo/db/index_builds_coordinator.h b/src/mongo/db/index_builds_coordinator.h index 832c85ee652..1eb709b48d1 100644 --- a/src/mongo/db/index_builds_coordinator.h +++ b/src/mongo/db/index_builds_coordinator.h @@ -46,7 +46,7 @@ #include "mongo/platform/condition_variable.h" #include "mongo/platform/mutex.h" #include "mongo/util/concurrency/with_lock.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/future.h" #include "mongo/util/net/hostandport.h" #include "mongo/util/string_map.h" diff --git a/src/mongo/db/key_generator.cpp b/src/mongo/db/key_generator.cpp index def0b6c4ac5..7c95d210bfa 100644 --- a/src/mongo/db/key_generator.cpp +++ b/src/mongo/db/key_generator.cpp @@ -36,7 +36,7 @@ #include "mongo/db/logical_clock.h" #include "mongo/db/operation_context.h" #include "mongo/s/client/shard_registry.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { diff --git a/src/mongo/db/key_generator_update_test.cpp b/src/mongo/db/key_generator_update_test.cpp index bcfc2942bdd..885d7dfe25b 100644 --- a/src/mongo/db/key_generator_update_test.cpp +++ b/src/mongo/db/key_generator_update_test.cpp @@ -42,7 +42,7 @@ #include "mongo/s/config_server_test_fixture.h" #include "mongo/unittest/unittest.h" #include "mongo/util/clock_source_mock.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { namespace { diff --git a/src/mongo/db/keys_collection_manager.cpp b/src/mongo/db/keys_collection_manager.cpp index 155c52b163c..c96af99f13d 100644 --- a/src/mongo/db/keys_collection_manager.cpp +++ b/src/mongo/db/keys_collection_manager.cpp @@ -42,7 +42,7 @@ #include "mongo/db/operation_context.h" #include "mongo/db/service_context.h" #include "mongo/util/concurrency/idle_thread_block.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/str.h" #include "mongo/util/time_support.h" diff --git a/src/mongo/db/keys_collection_manager_sharding_test.cpp b/src/mongo/db/keys_collection_manager_sharding_test.cpp index d7d96d15d14..f6d4fc53a97 100644 --- a/src/mongo/db/keys_collection_manager_sharding_test.cpp +++ b/src/mongo/db/keys_collection_manager_sharding_test.cpp @@ -42,7 +42,7 @@ #include "mongo/s/config_server_test_fixture.h" #include "mongo/unittest/unittest.h" #include "mongo/util/clock_source_mock.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { namespace { diff --git a/src/mongo/db/matcher/expression.h b/src/mongo/db/matcher/expression.h index b476db91330..a7aa51b7d33 100644 --- a/src/mongo/db/matcher/expression.h +++ b/src/mongo/db/matcher/expression.h @@ -38,7 +38,7 @@ #include "mongo/db/matcher/match_details.h" #include "mongo/db/matcher/matchable.h" #include "mongo/db/pipeline/dependencies.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { diff --git a/src/mongo/db/matcher/expression_expr.cpp b/src/mongo/db/matcher/expression_expr.cpp index 62a345ab515..bce9461a50f 100644 --- a/src/mongo/db/matcher/expression_expr.cpp +++ b/src/mongo/db/matcher/expression_expr.cpp @@ -31,7 +31,7 @@ #include "mongo/db/matcher/expression_expr.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { diff --git a/src/mongo/db/op_observer_impl.cpp b/src/mongo/db/op_observer_impl.cpp index 0c789bb301c..73d31fd799d 100644 --- a/src/mongo/db/op_observer_impl.cpp +++ b/src/mongo/db/op_observer_impl.cpp @@ -61,7 +61,7 @@ #include "mongo/s/grid.h" #include "mongo/scripting/engine.h" #include "mongo/util/assert_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { using repl::MutableOplogEntry; diff --git a/src/mongo/db/operation_context.cpp b/src/mongo/db/operation_context.cpp index c471c870fe1..bab631ad351 100644 --- a/src/mongo/db/operation_context.cpp +++ b/src/mongo/db/operation_context.cpp @@ -40,7 +40,7 @@ #include "mongo/transport/baton.h" #include "mongo/util/assert_util.h" #include "mongo/util/clock_source.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" #include "mongo/util/system_tick_source.h" diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp index a495ab7a429..d640bbf8113 100644 --- a/src/mongo/db/ops/write_ops_exec.cpp +++ b/src/mongo/db/ops/write_ops_exec.cpp @@ -77,7 +77,7 @@ #include "mongo/rpc/get_status_from_command_result.h" #include "mongo/s/cannot_implicitly_create_collection_info.h" #include "mongo/s/would_change_owning_shard_exception.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/log_and_backoff.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/pipeline/document_source_cursor.cpp b/src/mongo/db/pipeline/document_source_cursor.cpp index 2d5f131d190..eb01db2a2ad 100644 --- a/src/mongo/db/pipeline/document_source_cursor.cpp +++ b/src/mongo/db/pipeline/document_source_cursor.cpp @@ -40,7 +40,7 @@ #include "mongo/db/query/explain.h" #include "mongo/db/query/find_common.h" #include "mongo/db/storage/storage_options.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/pipeline/pipeline.cpp b/src/mongo/db/pipeline/pipeline.cpp index 81c9ee10b6b..7642b1ef49a 100644 --- a/src/mongo/db/pipeline/pipeline.cpp +++ b/src/mongo/db/pipeline/pipeline.cpp @@ -50,7 +50,7 @@ #include "mongo/db/pipeline/document_source_unwind.h" #include "mongo/db/pipeline/expression.h" #include "mongo/db/pipeline/expression_context.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/str.h" namespace mongo { diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp index 8cc25ffea1c..bf2d41c52a8 100644 --- a/src/mongo/db/query/find.cpp +++ b/src/mongo/db/query/find.cpp @@ -65,7 +65,7 @@ #include "mongo/db/views/view_catalog.h" #include "mongo/s/chunk_version.h" #include "mongo/s/stale_exception.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" #include "mongo/util/str.h" diff --git a/src/mongo/db/query/find_common.h b/src/mongo/db/query/find_common.h index 31c6b010692..a0a4f747cda 100644 --- a/src/mongo/db/query/find_common.h +++ b/src/mongo/db/query/find_common.h @@ -29,7 +29,7 @@ #include "mongo/bson/bsonobj.h" #include "mongo/db/operation_context.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { diff --git a/src/mongo/db/query/plan_executor_impl.cpp b/src/mongo/db/query/plan_executor_impl.cpp index d8c964f842d..3d0629d5d30 100644 --- a/src/mongo/db/query/plan_executor_impl.cpp +++ b/src/mongo/db/query/plan_executor_impl.cpp @@ -56,7 +56,7 @@ #include "mongo/db/query/plan_yield_policy.h" #include "mongo/db/repl/replication_coordinator.h" #include "mongo/db/service_context.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" #include "mongo/util/stacktrace.h" diff --git a/src/mongo/db/query/plan_yield_policy.cpp b/src/mongo/db/query/plan_yield_policy.cpp index 3200f343239..856d15c8b4c 100644 --- a/src/mongo/db/query/plan_yield_policy.cpp +++ b/src/mongo/db/query/plan_yield_policy.cpp @@ -37,7 +37,7 @@ #include "mongo/db/operation_context.h" #include "mongo/db/query/query_knobs_gen.h" #include "mongo/db/service_context.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/scopeguard.h" #include "mongo/util/time_support.h" diff --git a/src/mongo/db/repl/apply_ops.cpp b/src/mongo/db/repl/apply_ops.cpp index 34f241999b0..fdc1d412f6d 100644 --- a/src/mongo/db/repl/apply_ops.cpp +++ b/src/mongo/db/repl/apply_ops.cpp @@ -56,7 +56,7 @@ #include "mongo/db/session_catalog_mongod.h" #include "mongo/db/transaction_participant.h" #include "mongo/rpc/get_status_from_command_result.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/repl/collection_cloner.cpp b/src/mongo/db/repl/collection_cloner.cpp index 62f601affd9..ee1d25accbb 100644 --- a/src/mongo/db/repl/collection_cloner.cpp +++ b/src/mongo/db/repl/collection_cloner.cpp @@ -49,7 +49,7 @@ #include "mongo/rpc/get_status_from_command_result.h" #include "mongo/util/assert_util.h" #include "mongo/util/destructor_guard.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/str.h" diff --git a/src/mongo/db/repl/database_cloner.cpp b/src/mongo/db/repl/database_cloner.cpp index 55eab0a0aa4..e8f7b1d7302 100644 --- a/src/mongo/db/repl/database_cloner.cpp +++ b/src/mongo/db/repl/database_cloner.cpp @@ -45,7 +45,7 @@ #include "mongo/db/repl/storage_interface.h" #include "mongo/util/assert_util.h" #include "mongo/util/destructor_guard.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/str.h" diff --git a/src/mongo/db/repl/initial_syncer.cpp b/src/mongo/db/repl/initial_syncer.cpp index 8f19951e265..3f75689ff10 100644 --- a/src/mongo/db/repl/initial_syncer.cpp +++ b/src/mongo/db/repl/initial_syncer.cpp @@ -66,7 +66,7 @@ #include "mongo/rpc/metadata/repl_set_metadata.h" #include "mongo/util/assert_util.h" #include "mongo/util/destructor_guard.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" #include "mongo/util/str.h" diff --git a/src/mongo/db/repl/initial_syncer.h b/src/mongo/db/repl/initial_syncer.h index adc891bc5d1..da12c4027be 100644 --- a/src/mongo/db/repl/initial_syncer.h +++ b/src/mongo/db/repl/initial_syncer.h @@ -55,7 +55,7 @@ #include "mongo/platform/condition_variable.h" #include "mongo/platform/mutex.h" #include "mongo/util/concurrency/thread_pool.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/net/hostandport.h" namespace mongo { diff --git a/src/mongo/db/repl/initial_syncer_test.cpp b/src/mongo/db/repl/initial_syncer_test.cpp index 4a6a9176ac7..e1fb7d7fd48 100644 --- a/src/mongo/db/repl/initial_syncer_test.cpp +++ b/src/mongo/db/repl/initial_syncer_test.cpp @@ -63,7 +63,7 @@ #include "mongo/platform/mutex.h" #include "mongo/util/concurrency/thread_name.h" #include "mongo/util/concurrency/thread_pool.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/scopeguard.h" #include "mongo/util/str.h" diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp index edacd2c9940..3d356c7ab70 100644 --- a/src/mongo/db/repl/oplog.cpp +++ b/src/mongo/db/repl/oplog.cpp @@ -94,7 +94,7 @@ #include "mongo/scripting/engine.h" #include "mongo/util/concurrency/idle_thread_block.h" #include "mongo/util/elapsed_tracker.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/file.h" #include "mongo/util/log.h" #include "mongo/util/str.h" diff --git a/src/mongo/db/repl/oplog_applier_impl.cpp b/src/mongo/db/repl/oplog_applier_impl.cpp index 3a36fb4dba9..5f9e9a5093d 100644 --- a/src/mongo/db/repl/oplog_applier_impl.cpp +++ b/src/mongo/db/repl/oplog_applier_impl.cpp @@ -46,7 +46,7 @@ #include "mongo/db/repl/transaction_oplog_application.h" #include "mongo/db/stats/timer_stats.h" #include "mongo/platform/basic.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "third_party/murmurhash3/MurmurHash3.h" diff --git a/src/mongo/db/repl/oplog_fetcher.cpp b/src/mongo/db/repl/oplog_fetcher.cpp index d38f05bae8e..514de02e8c8 100644 --- a/src/mongo/db/repl/oplog_fetcher.cpp +++ b/src/mongo/db/repl/oplog_fetcher.cpp @@ -41,7 +41,7 @@ #include "mongo/db/stats/timer_stats.h" #include "mongo/rpc/metadata/oplog_query_metadata.h" #include "mongo/util/assert_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/time_support.h" diff --git a/src/mongo/db/repl/oplog_fetcher.h b/src/mongo/db/repl/oplog_fetcher.h index 6bf7a0275eb..635732e8d85 100644 --- a/src/mongo/db/repl/oplog_fetcher.h +++ b/src/mongo/db/repl/oplog_fetcher.h @@ -39,7 +39,7 @@ #include "mongo/db/repl/abstract_oplog_fetcher.h" #include "mongo/db/repl/data_replicator_external_state.h" #include "mongo/db/repl/repl_set_config.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/repl_set_commands.cpp b/src/mongo/db/repl/repl_set_commands.cpp index cadbce56e30..ee1f49396a1 100644 --- a/src/mongo/db/repl/repl_set_commands.cpp +++ b/src/mongo/db/repl/repl_set_commands.cpp @@ -64,7 +64,7 @@ #include "mongo/transport/session.h" #include "mongo/transport/transport_layer.h" #include "mongo/util/decimal_counter.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/net/socket_utils.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp index 02cc3557a96..1c7603ca075 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp @@ -101,7 +101,7 @@ #include "mongo/util/assert_util.h" #include "mongo/util/concurrency/thread_pool.h" #include "mongo/util/exit.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/net/hostandport.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp index 90a7900bd4f..b049f42537b 100644 --- a/src/mongo/db/repl/replication_coordinator_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl.cpp @@ -86,7 +86,7 @@ #include "mongo/rpc/metadata/oplog_query_metadata.h" #include "mongo/rpc/metadata/repl_set_metadata.h" #include "mongo/util/assert_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" #include "mongo/util/stacktrace.h" diff --git a/src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp index 2f9344f44f9..3efb852080a 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp @@ -45,7 +45,7 @@ #include "mongo/db/repl/topology_coordinator.h" #include "mongo/executor/network_interface_mock.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include <boost/optional/optional_io.hpp> diff --git a/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp b/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp index 5670e767a90..4f97dce7ebe 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp @@ -58,7 +58,7 @@ #include "mongo/rpc/get_status_from_command_result.h" #include "mongo/rpc/metadata/repl_set_metadata.h" #include "mongo/util/assert_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/str.h" #include "mongo/util/time_support.h" diff --git a/src/mongo/db/repl/replication_coordinator_impl_reconfig_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_reconfig_test.cpp index e90146ecf34..276148da179 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_reconfig_test.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_reconfig_test.cpp @@ -42,7 +42,7 @@ #include "mongo/db/repl/replication_coordinator_test_fixture.h" #include "mongo/executor/network_interface_mock.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/repl/replication_coordinator_test_fixture.cpp b/src/mongo/db/repl/replication_coordinator_test_fixture.cpp index 27fac4a3715..d09d8bdf379 100644 --- a/src/mongo/db/repl/replication_coordinator_test_fixture.cpp +++ b/src/mongo/db/repl/replication_coordinator_test_fixture.cpp @@ -53,7 +53,7 @@ #include "mongo/executor/thread_pool_mock.h" #include "mongo/executor/thread_pool_task_executor.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/repl/replication_info.cpp b/src/mongo/db/repl/replication_info.cpp index 9b854735676..4c784d7648e 100644 --- a/src/mongo/db/repl/replication_info.cpp +++ b/src/mongo/db/repl/replication_info.cpp @@ -59,7 +59,7 @@ #include "mongo/rpc/metadata/client_metadata.h" #include "mongo/rpc/metadata/client_metadata_ismaster.h" #include "mongo/util/decimal_counter.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/map_util.h" diff --git a/src/mongo/db/repl/roll_back_local_operations.h b/src/mongo/db/repl/roll_back_local_operations.h index b6920cc10c4..a693deadec7 100644 --- a/src/mongo/db/repl/roll_back_local_operations.h +++ b/src/mongo/db/repl/roll_back_local_operations.h @@ -38,7 +38,7 @@ #include "mongo/db/repl/oplog_entry.h" #include "mongo/db/repl/oplog_interface.h" #include "mongo/db/repl/optime.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/rs_rollback.cpp b/src/mongo/db/repl/rs_rollback.cpp index fa918ba6b46..255dedd9995 100644 --- a/src/mongo/db/repl/rs_rollback.cpp +++ b/src/mongo/db/repl/rs_rollback.cpp @@ -77,7 +77,7 @@ #include "mongo/s/client/shard_registry.h" #include "mongo/s/grid.h" #include "mongo/util/exit.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/repl/storage_interface_impl_test.cpp b/src/mongo/db/repl/storage_interface_impl_test.cpp index 378248e5316..aa3a3fa0b46 100644 --- a/src/mongo/db/repl/storage_interface_impl_test.cpp +++ b/src/mongo/db/repl/storage_interface_impl_test.cpp @@ -55,7 +55,7 @@ #include "mongo/stdx/thread.h" #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/str.h" namespace { diff --git a/src/mongo/db/repl/topology_coordinator.cpp b/src/mongo/db/repl/topology_coordinator.cpp index 77da01a202d..49c099f84a9 100644 --- a/src/mongo/db/repl/topology_coordinator.cpp +++ b/src/mongo/db/repl/topology_coordinator.cpp @@ -54,7 +54,7 @@ #include "mongo/rpc/metadata/oplog_query_metadata.h" #include "mongo/rpc/metadata/repl_set_metadata.h" #include "mongo/util/assert_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/hex.h" #include "mongo/util/log.h" #include "mongo/util/net/socket_utils.h" diff --git a/src/mongo/db/s/balancer/balancer.cpp b/src/mongo/db/s/balancer/balancer.cpp index 9a2fadb8327..0f1f30a89dc 100644 --- a/src/mongo/db/s/balancer/balancer.cpp +++ b/src/mongo/db/s/balancer/balancer.cpp @@ -54,7 +54,7 @@ #include "mongo/s/shard_util.h" #include "mongo/util/concurrency/idle_thread_block.h" #include "mongo/util/exit.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/timer.h" #include "mongo/util/version.h" diff --git a/src/mongo/db/s/balancer/balancer_policy.cpp b/src/mongo/db/s/balancer/balancer_policy.cpp index f512f77ca6a..6b3fb9d78ba 100644 --- a/src/mongo/db/s/balancer/balancer_policy.cpp +++ b/src/mongo/db/s/balancer/balancer_policy.cpp @@ -38,7 +38,7 @@ #include "mongo/db/s/balancer/type_migration.h" #include "mongo/s/catalog/type_shard.h" #include "mongo/s/catalog/type_tags.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/str.h" diff --git a/src/mongo/db/s/collection_sharding_state.cpp b/src/mongo/db/s/collection_sharding_state.cpp index 687c9a877b1..5fc2a88d16a 100644 --- a/src/mongo/db/s/collection_sharding_state.cpp +++ b/src/mongo/db/s/collection_sharding_state.cpp @@ -37,7 +37,7 @@ #include "mongo/db/s/operation_sharding_state.h" #include "mongo/db/s/sharded_connection_info.h" #include "mongo/s/stale_exception.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/string_map.h" diff --git a/src/mongo/db/s/config/configsvr_drop_collection_command.cpp b/src/mongo/db/s/config/configsvr_drop_collection_command.cpp index 06970e7ecf3..24717899952 100644 --- a/src/mongo/db/s/config/configsvr_drop_collection_command.cpp +++ b/src/mongo/db/s/config/configsvr_drop_collection_command.cpp @@ -44,7 +44,7 @@ #include "mongo/s/cluster_commands_helpers.h" #include "mongo/s/grid.h" #include "mongo/s/stale_exception.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp b/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp index 00287e86410..577240cb5f8 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp @@ -53,7 +53,7 @@ #include "mongo/s/config_server_test_fixture.h" #include "mongo/s/database_version_helpers.h" #include "mongo/s/write_ops/batched_command_response.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp b/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp index 461ab7fd2bf..82f6cad21af 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp @@ -50,7 +50,7 @@ #include "mongo/s/client/shard_registry.h" #include "mongo/s/grid.h" #include "mongo/s/shard_key_pattern.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/str.h" diff --git a/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp b/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp index 28122a3a3da..3bdf40442f0 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp @@ -72,7 +72,7 @@ #include "mongo/s/write_ops/batched_command_request.h" #include "mongo/s/write_ops/batched_command_response.h" #include "mongo/transport/service_entry_point.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" #include "mongo/util/str.h" diff --git a/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp b/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp index 14781634e42..4e737b23027 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp @@ -74,7 +74,7 @@ #include "mongo/s/shard_util.h" #include "mongo/s/write_ops/batched_command_request.h" #include "mongo/s/write_ops/batched_command_response.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" #include "mongo/util/str.h" diff --git a/src/mongo/db/s/database_sharding_state.cpp b/src/mongo/db/s/database_sharding_state.cpp index 643c36d9dcd..9580cf6026a 100644 --- a/src/mongo/db/s/database_sharding_state.cpp +++ b/src/mongo/db/s/database_sharding_state.cpp @@ -37,7 +37,7 @@ #include "mongo/db/s/operation_sharding_state.h" #include "mongo/s/database_version_helpers.h" #include "mongo/s/stale_exception.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/s/metadata_manager.cpp b/src/mongo/db/s/metadata_manager.cpp index 52f606b4031..5c710c48603 100644 --- a/src/mongo/db/s/metadata_manager.cpp +++ b/src/mongo/db/s/metadata_manager.cpp @@ -43,7 +43,7 @@ #include "mongo/db/s/collection_sharding_state.h" #include "mongo/s/grid.h" #include "mongo/util/assert_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/time_support.h" diff --git a/src/mongo/db/s/migration_destination_manager.cpp b/src/mongo/db/s/migration_destination_manager.cpp index 946e6575468..eee35a80cca 100644 --- a/src/mongo/db/s/migration_destination_manager.cpp +++ b/src/mongo/db/s/migration_destination_manager.cpp @@ -64,7 +64,7 @@ #include "mongo/s/shard_key_pattern.h" #include "mongo/stdx/chrono.h" #include "mongo/util/concurrency/notification.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/producer_consumer_queue.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/s/migration_source_manager.cpp b/src/mongo/db/s/migration_source_manager.cpp index 56d84023c24..f8e9d15e96b 100644 --- a/src/mongo/db/s/migration_source_manager.cpp +++ b/src/mongo/db/s/migration_source_manager.cpp @@ -63,7 +63,7 @@ #include "mongo/util/duration.h" #include "mongo/util/elapsed_tracker.h" #include "mongo/util/exit.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/s/move_chunk_command.cpp b/src/mongo/db/s/move_chunk_command.cpp index 24c0023a6c4..8afc52f0a7f 100644 --- a/src/mongo/db/s/move_chunk_command.cpp +++ b/src/mongo/db/s/move_chunk_command.cpp @@ -48,7 +48,7 @@ #include "mongo/s/request_types/migration_secondary_throttle_options.h" #include "mongo/s/request_types/move_chunk_request.h" #include "mongo/util/concurrency/notification.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/s/shard_filtering_metadata_refresh.cpp b/src/mongo/db/s/shard_filtering_metadata_refresh.cpp index 9042fba9b5d..5926ddcb456 100644 --- a/src/mongo/db/s/shard_filtering_metadata_refresh.cpp +++ b/src/mongo/db/s/shard_filtering_metadata_refresh.cpp @@ -44,7 +44,7 @@ #include "mongo/db/s/sharding_statistics.h" #include "mongo/s/catalog_cache.h" #include "mongo/s/grid.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/s/shard_server_catalog_cache_loader.cpp b/src/mongo/db/s/shard_server_catalog_cache_loader.cpp index a974104d1f4..ee2230b6333 100644 --- a/src/mongo/db/s/shard_server_catalog_cache_loader.cpp +++ b/src/mongo/db/s/shard_server_catalog_cache_loader.cpp @@ -46,7 +46,7 @@ #include "mongo/s/catalog/type_shard_database.h" #include "mongo/s/client/shard_registry.h" #include "mongo/s/grid.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/s/transaction_coordinator.cpp b/src/mongo/db/s/transaction_coordinator.cpp index 3d3e392980a..9393168a86b 100644 --- a/src/mongo/db/s/transaction_coordinator.cpp +++ b/src/mongo/db/s/transaction_coordinator.cpp @@ -38,7 +38,7 @@ #include "mongo/db/s/wait_for_majority_service.h" #include "mongo/db/server_options.h" #include "mongo/s/grid.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/s/transaction_coordinator.h b/src/mongo/db/s/transaction_coordinator.h index 68745a3e540..c01b4133cf8 100644 --- a/src/mongo/db/s/transaction_coordinator.h +++ b/src/mongo/db/s/transaction_coordinator.h @@ -32,7 +32,7 @@ #include <vector> #include "mongo/db/s/transaction_coordinator_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { diff --git a/src/mongo/db/s/transaction_coordinator_futures_util.cpp b/src/mongo/db/s/transaction_coordinator_futures_util.cpp index 05061af7fbe..5f19b0eeb46 100644 --- a/src/mongo/db/s/transaction_coordinator_futures_util.cpp +++ b/src/mongo/db/s/transaction_coordinator_futures_util.cpp @@ -39,7 +39,7 @@ #include "mongo/rpc/get_status_from_command_result.h" #include "mongo/s/grid.h" #include "mongo/transport/service_entry_point.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/s/transaction_coordinator_util.cpp b/src/mongo/db/s/transaction_coordinator_util.cpp index c98a1c25775..7d98befd9d2 100644 --- a/src/mongo/db/s/transaction_coordinator_util.cpp +++ b/src/mongo/db/s/transaction_coordinator_util.cpp @@ -44,7 +44,7 @@ #include "mongo/db/s/transaction_coordinator_worker_curop_repository.h" #include "mongo/db/write_concern.h" #include "mongo/rpc/get_status_from_command_result.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/server_options_helpers.cpp b/src/mongo/db/server_options_helpers.cpp index a9d4badc2c6..9ff88f5c9ef 100644 --- a/src/mongo/db/server_options_helpers.cpp +++ b/src/mongo/db/server_options_helpers.cpp @@ -51,7 +51,7 @@ #include "mongo/logger/message_event_utf8_encoder.h" #include "mongo/transport/message_compressor_registry.h" #include "mongo/util/cmdline_utils/censor_cmdline.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/map_util.h" #include "mongo/util/net/sock.h" diff --git a/src/mongo/db/server_options_server_helpers.cpp b/src/mongo/db/server_options_server_helpers.cpp index 0dfe6e1f78a..4cf1a4164da 100644 --- a/src/mongo/db/server_options_server_helpers.cpp +++ b/src/mongo/db/server_options_server_helpers.cpp @@ -50,7 +50,7 @@ #include "mongo/logger/message_event_utf8_encoder.h" #include "mongo/transport/message_compressor_registry.h" #include "mongo/util/cmdline_utils/censor_cmdline.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/map_util.h" #include "mongo/util/net/sock.h" diff --git a/src/mongo/db/service_entry_point_common.cpp b/src/mongo/db/service_entry_point_common.cpp index 1f38b66d6d9..182509fa32a 100644 --- a/src/mongo/db/service_entry_point_common.cpp +++ b/src/mongo/db/service_entry_point_common.cpp @@ -90,7 +90,7 @@ #include "mongo/rpc/metadata/tracking_metadata.h" #include "mongo/rpc/op_msg.h" #include "mongo/rpc/reply_builder_interface.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/db/service_entry_point_common.h b/src/mongo/db/service_entry_point_common.h index b41c0ef2c55..2fa1412c3b2 100644 --- a/src/mongo/db/service_entry_point_common.h +++ b/src/mongo/db/service_entry_point_common.h @@ -34,7 +34,7 @@ #include "mongo/db/dbmessage.h" #include "mongo/db/operation_context.h" #include "mongo/rpc/message.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/polymorphic_scoped.h" namespace mongo { diff --git a/src/mongo/db/snapshot_window_util.cpp b/src/mongo/db/snapshot_window_util.cpp index c06bb078d5e..eaf8f9f45cc 100644 --- a/src/mongo/db/snapshot_window_util.cpp +++ b/src/mongo/db/snapshot_window_util.cpp @@ -40,7 +40,7 @@ #include "mongo/db/storage/storage_engine.h" #include "mongo/platform/mutex.h" #include "mongo/util/concurrency/with_lock.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/storage/flow_control.cpp b/src/mongo/db/storage/flow_control.cpp index c6976fd77b2..cf804c25971 100644 --- a/src/mongo/db/storage/flow_control.cpp +++ b/src/mongo/db/storage/flow_control.cpp @@ -45,7 +45,7 @@ #include "mongo/db/server_options.h" #include "mongo/db/storage/flow_control_parameters_gen.h" #include "mongo/util/background.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.cpp index 4cb08f0aa03..c5533e62edd 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.cpp @@ -33,7 +33,7 @@ #include "mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.h b/src/mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.h index 8ce0a079bd4..3b9cb06044a 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.h @@ -33,7 +33,7 @@ #include "mongo/db/prepare_conflict_tracker.h" #include "mongo/db/storage/wiredtiger/wiredtiger_record_store.h" #include "mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h index 99c0b70fb78..cf82a514969 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h @@ -46,7 +46,7 @@ #include "mongo/platform/condition_variable.h" #include "mongo/platform/mutex.h" #include "mongo/stdx/thread.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" /** * Either executes the specified operation and returns it's value or randomly throws a write diff --git a/src/mongo/db/storage/write_unit_of_work.cpp b/src/mongo/db/storage/write_unit_of_work.cpp index 8bddf4e9c59..f09cd50cd24 100644 --- a/src/mongo/db/storage/write_unit_of_work.cpp +++ b/src/mongo/db/storage/write_unit_of_work.cpp @@ -33,7 +33,6 @@ #include "mongo/db/operation_context.h" #include "mongo/util/fail_point.h" -#include "mongo/util/fail_point_service.h" #include "mongo/util/time_support.h" namespace mongo { diff --git a/src/mongo/db/transaction_participant.cpp b/src/mongo/db/transaction_participant.cpp index 7e1a2cec1e8..65613550dc8 100644 --- a/src/mongo/db/transaction_participant.cpp +++ b/src/mongo/db/transaction_participant.cpp @@ -63,7 +63,7 @@ #include "mongo/db/stats/fill_locker_info.h" #include "mongo/db/transaction_history_iterator.h" #include "mongo/db/transaction_participant_gen.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/net/socket_utils.h" diff --git a/src/mongo/db/transaction_participant_test.cpp b/src/mongo/db/transaction_participant_test.cpp index 65e94f4355b..3dca2998ae5 100644 --- a/src/mongo/db/transaction_participant_test.cpp +++ b/src/mongo/db/transaction_participant_test.cpp @@ -56,7 +56,7 @@ #include "mongo/unittest/death_test.h" #include "mongo/unittest/unittest.h" #include "mongo/util/clock_source_mock.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/net/socket_utils.h" #include "mongo/util/tick_source_mock.h" diff --git a/src/mongo/db/views/view_catalog.cpp b/src/mongo/db/views/view_catalog.cpp index ef49919f3e0..86e1eb7dd2e 100644 --- a/src/mongo/db/views/view_catalog.cpp +++ b/src/mongo/db/views/view_catalog.cpp @@ -55,7 +55,7 @@ #include "mongo/db/views/resolved_view.h" #include "mongo/db/views/view.h" #include "mongo/db/views/view_graph.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/db/write_concern.cpp b/src/mongo/db/write_concern.cpp index 70b9e22dbb3..8f05f50e370 100644 --- a/src/mongo/db/write_concern.cpp +++ b/src/mongo/db/write_concern.cpp @@ -46,7 +46,7 @@ #include "mongo/db/storage/storage_engine.h" #include "mongo/db/write_concern_options.h" #include "mongo/rpc/protocol.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/dbtests/query_stage_collscan.cpp b/src/mongo/dbtests/query_stage_collscan.cpp index d067cdd9878..e5d4e1be7ec 100644 --- a/src/mongo/dbtests/query_stage_collscan.cpp +++ b/src/mongo/dbtests/query_stage_collscan.cpp @@ -50,7 +50,7 @@ #include "mongo/db/storage/record_store.h" #include "mongo/dbtests/dbtests.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace query_stage_collection_scan { diff --git a/src/mongo/dbtests/query_stage_count_scan.cpp b/src/mongo/dbtests/query_stage_count_scan.cpp index bba51c5fe00..53390fca861 100644 --- a/src/mongo/dbtests/query_stage_count_scan.cpp +++ b/src/mongo/dbtests/query_stage_count_scan.cpp @@ -44,8 +44,6 @@ #include "mongo/db/matcher/expression_parser.h" #include "mongo/dbtests/dbtests.h" #include "mongo/util/fail_point.h" -#include "mongo/util/fail_point_registry.h" -#include "mongo/util/fail_point_service.h" namespace QueryStageCountScan { diff --git a/src/mongo/executor/network_interface.h b/src/mongo/executor/network_interface.h index 09a7fdaeb75..ffb203221c9 100644 --- a/src/mongo/executor/network_interface.h +++ b/src/mongo/executor/network_interface.h @@ -35,7 +35,7 @@ #include "mongo/executor/task_executor.h" #include "mongo/transport/baton.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/functional.h" #include "mongo/util/future.h" diff --git a/src/mongo/executor/scoped_task_executor.h b/src/mongo/executor/scoped_task_executor.h index bcdd49e4151..1582e654002 100644 --- a/src/mongo/executor/scoped_task_executor.h +++ b/src/mongo/executor/scoped_task_executor.h @@ -37,7 +37,7 @@ #include "mongo/platform/condition_variable.h" #include "mongo/platform/mutex.h" #include "mongo/stdx/unordered_map.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { diff --git a/src/mongo/executor/thread_pool_task_executor.cpp b/src/mongo/executor/thread_pool_task_executor.cpp index 84153871128..8573e31d4a1 100644 --- a/src/mongo/executor/thread_pool_task_executor.cpp +++ b/src/mongo/executor/thread_pool_task_executor.cpp @@ -45,7 +45,7 @@ #include "mongo/platform/atomic_word.h" #include "mongo/transport/baton.h" #include "mongo/util/concurrency/thread_pool_interface.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/time_support.h" diff --git a/src/mongo/executor/thread_pool_task_executor.h b/src/mongo/executor/thread_pool_task_executor.h index 35dca3ce6b7..445c5fc610d 100644 --- a/src/mongo/executor/thread_pool_task_executor.h +++ b/src/mongo/executor/thread_pool_task_executor.h @@ -37,7 +37,7 @@ #include "mongo/platform/mutex.h" #include "mongo/stdx/thread.h" #include "mongo/transport/baton.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { diff --git a/src/mongo/executor/thread_pool_task_executor_test.cpp b/src/mongo/executor/thread_pool_task_executor_test.cpp index fb7330ca3ee..779b025bb20 100644 --- a/src/mongo/executor/thread_pool_task_executor_test.cpp +++ b/src/mongo/executor/thread_pool_task_executor_test.cpp @@ -43,7 +43,7 @@ #include "mongo/executor/thread_pool_task_executor_test_fixture.h" #include "mongo/unittest/barrier.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" namespace mongo { namespace executor { diff --git a/src/mongo/s/catalog/replset_dist_lock_manager.cpp b/src/mongo/s/catalog/replset_dist_lock_manager.cpp index 145b3423214..a7c5d6221b8 100644 --- a/src/mongo/s/catalog/replset_dist_lock_manager.cpp +++ b/src/mongo/s/catalog/replset_dist_lock_manager.cpp @@ -47,7 +47,7 @@ #include "mongo/stdx/chrono.h" #include "mongo/util/concurrency/idle_thread_block.h" #include "mongo/util/concurrency/thread_name.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/str.h" #include "mongo/util/time_support.h" diff --git a/src/mongo/s/catalog/sharding_catalog_client_impl.cpp b/src/mongo/s/catalog/sharding_catalog_client_impl.cpp index ddb160f3ceb..4776fed9ed3 100644 --- a/src/mongo/s/catalog/sharding_catalog_client_impl.cpp +++ b/src/mongo/s/catalog/sharding_catalog_client_impl.cpp @@ -68,7 +68,7 @@ #include "mongo/s/write_ops/batched_command_request.h" #include "mongo/s/write_ops/batched_command_response.h" #include "mongo/util/assert_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/net/hostandport.h" #include "mongo/util/str.h" diff --git a/src/mongo/s/commands/cluster_command_test_fixture.cpp b/src/mongo/s/commands/cluster_command_test_fixture.cpp index 504fe0602e3..053b66d0786 100644 --- a/src/mongo/s/commands/cluster_command_test_fixture.cpp +++ b/src/mongo/s/commands/cluster_command_test_fixture.cpp @@ -42,7 +42,7 @@ #include "mongo/db/logical_session_cache_noop.h" #include "mongo/db/logical_time_validator.h" #include "mongo/s/cluster_last_error_info.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/tick_source_mock.h" diff --git a/src/mongo/s/commands/cluster_refine_collection_shard_key_cmd.cpp b/src/mongo/s/commands/cluster_refine_collection_shard_key_cmd.cpp index ede2821a364..1bb76a72d16 100644 --- a/src/mongo/s/commands/cluster_refine_collection_shard_key_cmd.cpp +++ b/src/mongo/s/commands/cluster_refine_collection_shard_key_cmd.cpp @@ -35,7 +35,7 @@ #include "mongo/db/commands.h" #include "mongo/s/grid.h" #include "mongo/s/request_types/refine_collection_shard_key_gen.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/s/commands/commands_public.cpp b/src/mongo/s/commands/commands_public.cpp index 20782145cfa..1c20246854e 100644 --- a/src/mongo/s/commands/commands_public.cpp +++ b/src/mongo/s/commands/commands_public.cpp @@ -46,7 +46,7 @@ #include "mongo/s/grid.h" #include "mongo/s/query/store_possible_cursor.h" #include "mongo/s/request_types/rename_collection_gen.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/timer.h" diff --git a/src/mongo/s/commands/document_shard_key_update_util.cpp b/src/mongo/s/commands/document_shard_key_update_util.cpp index 735e2804115..d576e496ea6 100644 --- a/src/mongo/s/commands/document_shard_key_update_util.cpp +++ b/src/mongo/s/commands/document_shard_key_update_util.cpp @@ -37,7 +37,7 @@ #include "mongo/s/write_ops/batched_command_request.h" #include "mongo/s/write_ops/batched_command_response.h" #include "mongo/s/write_ops/cluster_write.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/str.h" diff --git a/src/mongo/s/commands/strategy.cpp b/src/mongo/s/commands/strategy.cpp index 802a1d69ab2..3bcb77f840c 100644 --- a/src/mongo/s/commands/strategy.cpp +++ b/src/mongo/s/commands/strategy.cpp @@ -79,7 +79,7 @@ #include "mongo/s/session_catalog_router.h" #include "mongo/s/stale_exception.h" #include "mongo/s/transaction_router.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" #include "mongo/util/str.h" diff --git a/src/mongo/s/config_server_catalog_cache_loader.cpp b/src/mongo/s/config_server_catalog_cache_loader.cpp index c4a02e89514..792a8e70489 100644 --- a/src/mongo/s/config_server_catalog_cache_loader.cpp +++ b/src/mongo/s/config_server_catalog_cache_loader.cpp @@ -40,7 +40,7 @@ #include "mongo/s/catalog/sharding_catalog_client.h" #include "mongo/s/database_version_helpers.h" #include "mongo/s/grid.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/s/query/cluster_find.cpp b/src/mongo/s/query/cluster_find.cpp index c466bc35329..50bae7cc142 100644 --- a/src/mongo/s/query/cluster_find.cpp +++ b/src/mongo/s/query/cluster_find.cpp @@ -63,7 +63,7 @@ #include "mongo/s/query/store_possible_cursor.h" #include "mongo/s/stale_exception.h" #include "mongo/s/transaction_router.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" diff --git a/src/mongo/s/transaction_router.cpp b/src/mongo/s/transaction_router.cpp index b9a77045d82..5dc3d536460 100644 --- a/src/mongo/s/transaction_router.cpp +++ b/src/mongo/s/transaction_router.cpp @@ -50,7 +50,7 @@ #include "mongo/s/multi_statement_transaction_requests_sender.h" #include "mongo/s/router_transactions_metrics.h" #include "mongo/util/assert_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/net/socket_utils.h" diff --git a/src/mongo/s/transaction_router_test.cpp b/src/mongo/s/transaction_router_test.cpp index 12c753aba15..8a2ab13aefb 100644 --- a/src/mongo/s/transaction_router_test.cpp +++ b/src/mongo/s/transaction_router_test.cpp @@ -50,7 +50,7 @@ #include "mongo/unittest/death_test.h" #include "mongo/unittest/unittest.h" #include "mongo/util/clock_source_mock.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/net/socket_utils.h" #include "mongo/util/tick_source_mock.h" diff --git a/src/mongo/scripting/engine.cpp b/src/mongo/scripting/engine.cpp index 67edb2ca277..8c4a500cdfe 100644 --- a/src/mongo/scripting/engine.cpp +++ b/src/mongo/scripting/engine.cpp @@ -41,7 +41,7 @@ #include "mongo/db/operation_context.h" #include "mongo/db/service_context.h" #include "mongo/scripting/dbdirectclient_factory.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/file.h" #include "mongo/util/log.h" #include "mongo/util/text.h" diff --git a/src/mongo/shell/shell_utils.cpp b/src/mongo/shell/shell_utils.cpp index fc9f9e4d420..c7834d5a060 100644 --- a/src/mongo/shell/shell_utils.cpp +++ b/src/mongo/shell/shell_utils.cpp @@ -58,7 +58,7 @@ #include "mongo/shell/shell_options.h" #include "mongo/shell/shell_utils_extended.h" #include "mongo/shell/shell_utils_launcher.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/processinfo.h" #include "mongo/util/quick_exit.h" diff --git a/src/mongo/transport/transport_layer_asio.h b/src/mongo/transport/transport_layer_asio.h index fef6aeecea9..67ffbc11f0f 100644 --- a/src/mongo/transport/transport_layer_asio.h +++ b/src/mongo/transport/transport_layer_asio.h @@ -41,7 +41,7 @@ #include "mongo/stdx/thread.h" #include "mongo/transport/transport_layer.h" #include "mongo/transport/transport_mode.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/net/hostandport.h" #include "mongo/util/net/ssl_options.h" #include "mongo/util/net/ssl_types.h" diff --git a/src/mongo/transport/transport_layer_asio_integration_test.cpp b/src/mongo/transport/transport_layer_asio_integration_test.cpp index b9bfa10df5e..a180b93359f 100644 --- a/src/mongo/transport/transport_layer_asio_integration_test.cpp +++ b/src/mongo/transport/transport_layer_asio_integration_test.cpp @@ -42,7 +42,7 @@ #include "mongo/transport/transport_layer_asio.h" #include "mongo/unittest/integration_test.h" #include "mongo/unittest/unittest.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "asio.hpp" diff --git a/src/mongo/util/SConscript b/src/mongo/util/SConscript index 4d98e0b3e9d..406b7594a8d 100644 --- a/src/mongo/util/SConscript +++ b/src/mongo/util/SConscript @@ -146,8 +146,6 @@ env.Library( target="fail_point", source=[ "fail_point.cpp", - "fail_point_registry.cpp", - "fail_point_service.cpp", env.Idlc('fail_point_server_parameter.idl')[0], ], LIBDEPS=[ diff --git a/src/mongo/util/diagnostic_info.h b/src/mongo/util/diagnostic_info.h index 1e578cecd80..4c4eb15c7ea 100644 --- a/src/mongo/util/diagnostic_info.h +++ b/src/mongo/util/diagnostic_info.h @@ -33,7 +33,7 @@ #include "mongo/db/client.h" #include "mongo/platform/condition_variable.h" #include "mongo/platform/mutex.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/time_support.h" namespace mongo { diff --git a/src/mongo/util/fail_point.cpp b/src/mongo/util/fail_point.cpp index 389a809ef23..60050da7055 100644 --- a/src/mongo/util/fail_point.cpp +++ b/src/mongo/util/fail_point.cpp @@ -28,22 +28,36 @@ */ #define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kControl +#include "mongo/platform/basic.h" #include "mongo/util/fail_point.h" +#include <fmt/format.h> #include <memory> +#include "mongo/base/init.h" +#include "mongo/bson/json.h" #include "mongo/bson/util/bson_extract.h" #include "mongo/platform/random.h" #include "mongo/stdx/thread.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/assert_util.h" +#include "mongo/util/fail_point_server_parameter_gen.h" #include "mongo/util/log.h" -#include "mongo/util/str.h" #include "mongo/util/time_support.h" namespace mongo { namespace { +using namespace fmt::literals; + +MONGO_FAIL_POINT_DEFINE(dummy); // used by tests in jstests/fail_point + +MONGO_INITIALIZER_GENERAL(AllFailPointsRegistered, (), ()) +(InitializerContext* context) { + globalFailPointRegistry().freeze(); + return Status::OK(); +} + /** * Type representing the per-thread PRNG used by fail-points. */ @@ -80,7 +94,7 @@ void FailPoint::setThreadPRNGSeed(int32_t seed) { FailPoint::FailPoint() = default; -void FailPoint::shouldFailCloseBlock() { +void FailPoint::_shouldFailCloseBlock() { _fpInfo.subtractAndFetch(1); } @@ -96,7 +110,7 @@ void FailPoint::setMode(Mode mode, ValType val, BSONObj extra) { stdx::lock_guard<Latch> scoped(_modMutex); // Step 1 - disable(); + _disable(); // Step 2 while (_fpInfo.load() != 0) { @@ -109,23 +123,23 @@ void FailPoint::setMode(Mode mode, ValType val, BSONObj extra) { _data = std::move(extra); if (_mode != off) { - enable(); + _enable(); } } -const BSONObj& FailPoint::getData() const { +const BSONObj& FailPoint::_getData() const { return _data; } -void FailPoint::enable() { +void FailPoint::_enable() { _fpInfo.fetchAndBitOr(kActiveBit); } -void FailPoint::disable() { +void FailPoint::_disable() { _fpInfo.fetchAndBitAnd(~kActiveBit); } -FailPoint::RetCode FailPoint::slowShouldFailOpenBlock( +FailPoint::RetCode FailPoint::_slowShouldFailOpenBlock( std::function<bool(const BSONObj&)> cb) noexcept { ValType localFpInfo = _fpInfo.addAndFetch(1); @@ -133,7 +147,7 @@ FailPoint::RetCode FailPoint::slowShouldFailOpenBlock( return slowOff; } - if (cb && !cb(getData())) { + if (cb && !cb(_getData())) { return userIgnored; } @@ -149,7 +163,7 @@ FailPoint::RetCode FailPoint::slowShouldFailOpenBlock( } case nTimes: { if (_timesOrPeriod.subtractAndFetch(1) <= 0) - disable(); + _disable(); return slowOn; } @@ -181,7 +195,7 @@ StatusWith<FailPoint::ModeOptions> FailPoint::parseBSON(const BSONObj& obj) { } else if (modeStr == "alwaysOn") { mode = FailPoint::alwaysOn; } else { - return {ErrorCodes::BadValue, str::stream() << "unknown mode: " << modeStr}; + return {ErrorCodes::BadValue, "unknown mode: {}"_format(modeStr)}; } } else if (modeElem.type() == Object) { const BSONObj modeObj(modeElem.Obj()); @@ -232,14 +246,14 @@ StatusWith<FailPoint::ModeOptions> FailPoint::parseBSON(const BSONObj& obj) { const double activationProbability = modeObj["activationProbability"].numberDouble(); if (activationProbability < 0 || activationProbability > 1) { return {ErrorCodes::BadValue, - str::stream() << "activationProbability must be between 0.0 and 1.0; found " - << activationProbability}; + "activationProbability must be between 0.0 and 1.0; " + "found {}"_format(activationProbability)}; } val = static_cast<int32_t>(std::numeric_limits<int32_t>::max() * activationProbability); } else { - return { - ErrorCodes::BadValue, - "'mode' must be one of 'off', 'alwaysOn', 'times', and 'activationProbability'"}; + return {ErrorCodes::BadValue, + "'mode' must be one of 'off', 'alwaysOn', '{times:n}', '{skip:n}' or " + "'{activationProbability:p}'"}; } } else { return {ErrorCodes::TypeMismatch, "'mode' must be a string or JSON object"}; @@ -265,4 +279,98 @@ BSONObj FailPoint::toBSON() const { return builder.obj(); } + +FailPointRegisterer::FailPointRegisterer(const std::string& name, FailPoint* fp) { + uassertStatusOK(globalFailPointRegistry().add(name, fp)); +} + +FailPointRegistry& globalFailPointRegistry() { + static auto& p = *new FailPointRegistry(); + return p; +} + +void setGlobalFailPoint(const std::string& failPointName, const BSONObj& cmdObj) { + FailPoint* failPoint = globalFailPointRegistry().find(failPointName); + if (failPoint == nullptr) + uasserted(ErrorCodes::FailPointSetFailed, failPointName + " not found"); + failPoint->setMode(uassertStatusOK(FailPoint::parseBSON(cmdObj))); + warning() << "failpoint: " << failPointName << " set to: " << failPoint->toBSON(); +} + +FailPointEnableBlock::FailPointEnableBlock(std::string failPointName) + : FailPointEnableBlock(std::move(failPointName), {}) {} + +FailPointEnableBlock::FailPointEnableBlock(std::string failPointName, BSONObj data) + : _failPointName(std::move(failPointName)) { + _failPoint = globalFailPointRegistry().find(_failPointName); + invariant(_failPoint != nullptr); + _failPoint->setMode(FailPoint::alwaysOn, 0, std::move(data)); + warning() << "failpoint: " << _failPointName << " set to: " << _failPoint->toBSON(); +} + +FailPointEnableBlock::~FailPointEnableBlock() { + _failPoint->setMode(FailPoint::off); + warning() << "failpoint: " << _failPointName << " set to: " << _failPoint->toBSON(); +} + +FailPointRegistry::FailPointRegistry() : _frozen(false) {} + +Status FailPointRegistry::add(const std::string& name, FailPoint* failPoint) { + if (_frozen) { + return {ErrorCodes::CannotMutateObject, "Registry is already frozen"}; + } + auto [pos, ok] = _fpMap.insert({name, failPoint}); + if (!ok) { + return {ErrorCodes::Error(51006), "Fail point already registered: {}"_format(name)}; + } + return Status::OK(); +} + +FailPoint* FailPointRegistry::find(const std::string& name) const { + auto iter = _fpMap.find(name); + return (iter == _fpMap.end()) ? nullptr : iter->second; +} + +void FailPointRegistry::freeze() { + _frozen = true; +} + +void FailPointRegistry::registerAllFailPointsAsServerParameters() { + for (const auto& [name, ptr] : _fpMap) { + // Intentionally leaked. + new FailPointServerParameter(name, ServerParameterType::kStartupOnly); + } +} + +static constexpr auto kFailPointServerParameterPrefix = "failpoint."_sd; + +FailPointServerParameter::FailPointServerParameter(StringData name, ServerParameterType spt) + : ServerParameter("{}{}"_format(kFailPointServerParameterPrefix, name), spt), + _data(globalFailPointRegistry().find(name.toString())) { + invariant(name != "failpoint.*", "Failpoint prototype was auto-registered from IDL"); + invariant(_data != nullptr, "Unknown failpoint: {}"_format(name)); +} + +void FailPointServerParameter::append(OperationContext* opCtx, + BSONObjBuilder& b, + const std::string& name) { + b << name << _data->toBSON(); +} + +Status FailPointServerParameter::setFromString(const std::string& str) { + BSONObj failPointOptions; + try { + failPointOptions = fromjson(str); + } catch (DBException& ex) { + return ex.toStatus(); + } + + auto swParsedOptions = FailPoint::parseBSON(failPointOptions); + if (!swParsedOptions.isOK()) { + return swParsedOptions.getStatus(); + } + _data->setMode(std::move(swParsedOptions.getValue())); + return Status::OK(); +} + } // namespace mongo diff --git a/src/mongo/util/fail_point.h b/src/mongo/util/fail_point.h index daf39bcba49..c5c12e62c23 100644 --- a/src/mongo/util/fail_point.h +++ b/src/mongo/util/fail_point.h @@ -30,48 +30,78 @@ #pragma once #include <functional> +#include <string> +#include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/db/jsobj.h" #include "mongo/db/operation_context.h" #include "mongo/platform/atomic_word.h" #include "mongo/platform/mutex.h" +#include "mongo/stdx/unordered_map.h" namespace mongo { /** - * A simple thread-safe fail point implementation that can be activated and - * deactivated, as well as embed temporary data into it. * - * The fail point has a static instance, which is represented by a FailPoint - * object, and dynamic instance, represented by FailPoint::Scoped handles. + * A FailPoint is a hook mechanism allowing testing behavior to occur at prearranged + * execution points in the server code. They can be activated and deactivated, and + * configured to hold data. + * + * A FailPoint is usually defined by the MONGO_FAIL_POINT_DEFINE(name) macro, + * which arranges for it to be added to the global failpoint registry. * * Sample use: - * // Declared somewhere: - * FailPoint makeBadThingsHappen; * - * // Somewhere in the code - * return false || MONGO_unlikely(makeBadThingsHappen.shouldFail()); + * // Defined somewhere: + * MONGO_FAIL_POINT_DEFINE(failPoint); + * + * bool somewhereInTheCode() { + * ... do some stuff ... + * // The failpoint artificially changes the return value of this function when active. + * if (MONGO_unlikely(failPoint.shouldFail())) + * return false; + * return true; + * } * - * or + * - or to implement more complex scenarios, use execute/executeIf - * - * // Somewhere in the code - * makeBadThingsHappen.execute([&](const BSONObj& data) { - * // Do something - * }); + * bool somewhereInTheCode() { + * failPoint.execute([&](const BSONObj& data) { + * // The bad things happen here, and can read the injected 'data'. + * }); + * return true; + * } * - * // Another way to do it, where lambda isn't suitable, e.g. to cause an early return - * // of the enclosing function. - * if (auto sfp = makeBadThingsHappen.scoped(); MONGO_unlikely(sfp.isActive())) { - * const BSONObj& data = sfp.getData(); - * // Do something, including break, continue, return, etc... + * // scoped() is another way to do it, where lambda isn't suitable, e.g. to cause + * // a return/continue/break to control the enclosing function. + * for (auto& user : users) { + * // The failpoint can be activated and given a user name, to skip that user. + * if (auto sfp = failPoint.scoped(); MONGO_unlikely(sfp.isActive())) { + * if (sfp.getData()["user"] == user.name()) { + * continue; + * } + * } + * processOneUser(user); * } * - * Invariants: + * // Rendered compactly with scopedIf where the data serves as an activation filter. + * for (auto& user : users) { + * if (MONGO_unlikely(failPoint.scopedIf([&](auto&& o) { + * return o["user"] == user.name(); + * }).isActive())) { + * continue; + * } + * processOneUser(user); + * } + * + * The `scopedIf` and `executeIf` members have an advantage over `scoped` and `execute`. They + * only affect the `FailPoint` activation counters (relevant to the `nTimes` and `skip` modes) + * if the predicate is true. + * + * A FailPoint can be configured remotely by a database command. + * See `src/mongo/db/commands/fail_point_cmd.cpp`. * - * 1. Always refer to _fpInfo first to check if failPoint is active or not before - * entering fail point or modifying fail point. - * 2. Client visible fail point states are read-only when active. */ class FailPoint { private: @@ -88,11 +118,18 @@ public: }; /** - * Helper class for making sure that FailPoint#shouldFailCloseBlock is called when - * FailPoint#shouldFailOpenBlock was called. - * + * An object representing an active FailPoint's interaction with the code it is + * instrumenting. It holds reference to its associated FailPoint, ensuring + * that FailPoint's state doesn't change while a Scoped is attached to it. + * If `isActive()`, then `getData()` may be called to retrieve injected data. * Users don't create these. They are only used within the execute and executeIf * functions and returned by the scoped() and scopedIf() functions. + * + * Ex: + * if (auto scoped = failPoint.scoped(); scoped.isActive()) { + * const BSONObj& data = scoped.getData(); + * // failPoint injects some behavior, informed by `data`. + * } */ class Scoped { public: @@ -103,7 +140,7 @@ public: ~Scoped() { if (_holdsRef) { - _failPoint->shouldFailCloseBlock(); + _failPoint->_shouldFailCloseBlock(); } } @@ -125,7 +162,7 @@ public: const BSONObj& getData() const { // Assert when attempting to get data without holding a ref. fassert(16445, _holdsRef); - return _failPoint->getData(); + return _failPoint->_getData(); } private: @@ -141,7 +178,18 @@ public: static void setThreadPRNGSeed(int32_t seed); /** - * Parses the {Mode, ValType, BSONObj} from the BSON. + * Parses the {mode, val, extra} from the BSON. + * obj = { + * mode: modeElem // required + * data: extra // optional payload to inject into the FailPoint intercept site. + * } + * where `modeElem` is one of: + * "off" + * "alwaysOn" + * {"times" : val} // active for the next val calls + * {"skip" : val} // skip calls, activate on and after call number (val+1). + * {"activationProbability" : val} // val is in interval [0.0, 1.0] + * } */ static StatusWith<ModeOptions> parseBSON(const BSONObj& obj); @@ -151,22 +199,25 @@ public: FailPoint& operator=(const FailPoint&) = delete; /** - * Note: This is not side-effect free - it can change the state to OFF after calling. - * Note: see `executeIf` for information on `pred`. + * Returns true if fail point is active. + * + * Calls to `shouldFail` can have side effects. For example they affect the counters + * kept to manage the `skip` or `nTimes` modes (See `setMode`). * - * Calls to shouldFail should be placed inside MONGO_unlikely for performance. + * See `executeIf` for information on `pred`. * - * @return true if fail point is active. + * Calls to `shouldFail` should be placed inside MONGO_unlikely for performance. + * if (MONGO_unlikely(failpoint.shouldFail())) ... */ template <typename Pred> bool shouldFail(Pred&& pred) { - RetCode ret = shouldFailOpenBlock(std::forward<Pred>(pred)); + RetCode ret = _shouldFailOpenBlock(std::forward<Pred>(pred)); if (MONGO_likely(ret == fastOff)) { return false; } - shouldFailCloseBlock(); + _shouldFailCloseBlock(); return ret == slowOn; } @@ -175,22 +226,20 @@ public: } /** - * Changes the settings of this fail point. This will turn off the fail point - * and waits for all dynamic instances referencing this fail point to go away before - * actually modifying the settings. + * Changes the settings of this fail point. This will turn off the FailPoint and + * wait for all references on this FailPoint to go away before modifying it. * - * @param mode the new mode for this fail point. - * @param val the value that can have different usage depending on the mode: + * @param mode new mode + * @param val unsigned having different interpretations depending on the mode: * * - off, alwaysOn: ignored * - random: static_cast<int32_t>(std::numeric_limits<int32_t>::max() * p), where * where p is the probability that any given evaluation of the failpoint should * activate. * - nTimes: the number of times this fail point will be active when - * #shouldFail or #shouldFailOpenBlock is called. - * - skip: the number of times this failpoint will be inactive when - * #shouldFail or #shouldFailOpenBlock is called. After this number is reached, the - * failpoint will always be active. + * #shouldFail/#execute/#scoped are called. + * - skip: will become active and remain active after + * #shouldFail/#execute/#scoped are called this number of times. * * @param extra arbitrary BSON object that can be stored to this fail point * that can be referenced afterwards with #getData. Defaults to an empty @@ -208,18 +257,24 @@ public: /** * Create a Scoped from this FailPoint. - * Use the Scoped object to access failpoint data. + * The returned Scoped object will be active if the failpoint is active. + * If it's active, the returned object can be used to access FailPoint data. */ Scoped scoped() { return scopedIf(nullptr); } /** - * Create a Scoped from this FailPoint, only active when `pred(payload)` is true. - * See `executeIf`. Use the Scoped object to access failpoint data. + * Create a Scoped from this FailPoint. + * If `pred(payload)` is true, then the returned Scoped object is active and the + * FailPoint's activation count is altered (relevant to e.g. the `nTimes` mode). If the + * predicate is false, an inactive Scoped is returned and this FailPoint's mode is not + * modified at all. + * If it's active, the returned object can be used to access FailPoint data. + * The `pred` should be callable like a `bool pred(const BSONObj&)`. */ template <typename Pred> Scoped scopedIf(Pred&& pred) { - return Scoped(this, shouldFailOpenBlock(std::forward<Pred>(pred))); + return Scoped(this, _shouldFailOpenBlock(std::forward<Pred>(pred))); } template <typename F> @@ -228,9 +283,11 @@ public: } /** - * The predicate `pred` should behave like a `bool pred(const BSONObj& payload)`. - * If `pred(payload)`, then `f(payload)` is executed. Otherwise, `f` is not - * executed and this FailPoint's mode is not altered (e.g. `nTimes` isn't consumed). + * If `pred(payload)` is true, then `f(payload)` is executed and the FailPoint's + * activation count is altered (relevant to e.g. the `nTimes` mode). Otherwise, `f` + * is not executed and this FailPoint's mode is not altered (e.g. `nTimes` isn't + * consumed). + * The `pred` should be callable like a `bool pred(const BSONObj&)`. */ template <typename F, typename Pred> void executeIf(F&& f, Pred&& pred) { @@ -240,12 +297,21 @@ public: } } + /** + * Take 100msec pauses for as long as the FailPoint is active. + * This uses `shouldFail()` and therefore affects FailPoint counters. + */ void pauseWhileSet() { while (MONGO_unlikely(shouldFail())) { sleepmillis(100); } } + /** + * Like `pauseWhileSet`, but interruptible via the `opCtx->sleepFor` mechanism. See + * `mongo::Interruptible::sleepFor` (Interruptible is a base class of + * OperationContext). + */ void pauseWhileSet(OperationContext* opCtx) { while (MONGO_unlikely(shouldFail())) { opCtx->sleepFor(Milliseconds(100)); @@ -253,8 +319,8 @@ public: } private: - void enable(); - void disable(); + void _enable(); + void _disable(); /** * Checks whether fail point is active and increments the reference counter without @@ -269,37 +335,37 @@ private: * fastOff if its disabled and doesn't need to be closed */ template <typename Pred> - RetCode shouldFailOpenBlock(Pred&& pred) { + RetCode _shouldFailOpenBlock(Pred&& pred) { if (MONGO_likely((_fpInfo.loadRelaxed() & kActiveBit) == 0)) { return fastOff; } - return slowShouldFailOpenBlock(std::forward<Pred>(pred)); + return _slowShouldFailOpenBlock(std::forward<Pred>(pred)); } - RetCode shouldFailOpenBlock() { - return shouldFailOpenBlock(nullptr); + RetCode _shouldFailOpenBlock() { + return _shouldFailOpenBlock(nullptr); } /** * Decrements the reference counter. - * @see #shouldFailOpenBlock + * @see #_shouldFailOpenBlock */ - void shouldFailCloseBlock(); + void _shouldFailCloseBlock(); /** - * slow path for #shouldFailOpenBlock + * slow path for #_shouldFailOpenBlock * * If a callable is passed, and returns false, this will return userIgnored and avoid altering * the mode in any way. The argument is the fail point payload. */ - RetCode slowShouldFailOpenBlock(std::function<bool(const BSONObj&)> cb) noexcept; + RetCode _slowShouldFailOpenBlock(std::function<bool(const BSONObj&)> cb) noexcept; /** * @return the stored BSONObj in this fail point. Note that this cannot be safely * read if this fail point is off. */ - const BSONObj& getData() const; + const BSONObj& _getData() const; static const ValType kActiveBit = 1 << 31; @@ -317,4 +383,82 @@ private: mutable Mutex _modMutex = MONGO_MAKE_LATCH("FailPoint::_modMutex"); }; +class FailPointRegistry { +public: + FailPointRegistry(); + + /** + * Adds a new fail point to this registry. Duplicate names are not allowed. + * + * @return the status code under these circumstances: + * OK - if successful. + * 51006 - if the given name already exists in this registry. + * CannotMutateObject - if this registry is already frozen. + */ + Status add(const std::string& name, FailPoint* failPoint); + + /** + * @return a registered FailPoint, or nullptr if it was not registered. + */ + FailPoint* find(const std::string& name) const; + + /** + * Freezes this registry from being modified. + */ + void freeze(); + + /** + * Creates a new FailPointServerParameter for each failpoint in the registry. This allows the + * failpoint to be set on the command line via --setParameter, but is only allowed when + * running with '--setParameter enableTestCommands=1'. + */ + void registerAllFailPointsAsServerParameters(); + +private: + bool _frozen; + stdx::unordered_map<std::string, FailPoint*> _fpMap; +}; + +/** + * A scope guard that enables a named FailPoint on construction and disables it on destruction. + */ +class FailPointEnableBlock { +public: + explicit FailPointEnableBlock(std::string failPointName); + FailPointEnableBlock(std::string failPointName, BSONObj cmdObj); + ~FailPointEnableBlock(); + +private: + std::string _failPointName; + FailPoint* _failPoint; +}; + +/** + * Set a fail point in the global registry to a given value via BSON + * @throw DBException corresponding to ErrorCodes::FailPointSetFailed if no failpoint + * called failPointName exists. + */ +void setGlobalFailPoint(const std::string& failPointName, const BSONObj& cmdObj); + +/** + * Registration object for FailPoint. Its static-initializer registers FailPoint `fp` + * into the `globalFailPointRegistry()` under the specified `name`. + */ +class FailPointRegisterer { +public: + FailPointRegisterer(const std::string& name, FailPoint* fp); +}; + +FailPointRegistry& globalFailPointRegistry(); + +/** + * Convenience macro for defining a fail point and registering it. + * Must be used at namespace scope, not at local (inside a function) or class scope. + * Never use in header files, only .cpp files. + */ +#define MONGO_FAIL_POINT_DEFINE(fp) \ + ::mongo::FailPoint fp; \ + ::mongo::FailPointRegisterer fp##failPointRegisterer(#fp, &fp); + + } // namespace mongo diff --git a/src/mongo/util/fail_point_registry.cpp b/src/mongo/util/fail_point_registry.cpp deleted file mode 100644 index f4dfb627a36..00000000000 --- a/src/mongo/util/fail_point_registry.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Copyright (C) 2018-present MongoDB, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the Server Side Public License, version 1, - * as published by MongoDB, Inc. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * Server Side Public License for more details. - * - * You should have received a copy of the Server Side Public License - * along with this program. If not, see - * <http://www.mongodb.com/licensing/server-side-public-license>. - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the Server Side Public License in all respects for - * all of the code used other than as permitted herein. If you modify file(s) - * with this exception, you may extend this exception to your version of the - * file(s), but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. If you delete this - * exception statement from all source files in the program, then also delete - * it in the license file. - */ - -#include "mongo/util/fail_point_registry.h" - -#include <fmt/format.h> - -#include "mongo/bson/json.h" -#include "mongo/util/fail_point_server_parameter_gen.h" -#include "mongo/util/fail_point_service.h" - -namespace mongo { - -using namespace fmt::literals; - -FailPointRegistry::FailPointRegistry() : _frozen(false) {} - -Status FailPointRegistry::add(const std::string& name, FailPoint* failPoint) { - if (_frozen) { - return {ErrorCodes::CannotMutateObject, "Registry is already frozen"}; - } - auto [pos, ok] = _fpMap.insert({name, failPoint}); - if (!ok) { - return {ErrorCodes::Error(51006), "Fail point already registered: {}"_format(name)}; - } - return Status::OK(); -} - -FailPoint* FailPointRegistry::find(const std::string& name) const { - auto iter = _fpMap.find(name); - return (iter == _fpMap.end()) ? nullptr : iter->second; -} - -void FailPointRegistry::freeze() { - _frozen = true; -} - -void FailPointRegistry::registerAllFailPointsAsServerParameters() { - for (const auto& [name, ptr] : _fpMap) { - // Intentionally leaked. - new FailPointServerParameter(name, ServerParameterType::kStartupOnly); - } -} - -static constexpr auto kFailPointServerParameterPrefix = "failpoint."_sd; - -FailPointServerParameter::FailPointServerParameter(StringData name, ServerParameterType spt) - : ServerParameter("{}{}"_format(kFailPointServerParameterPrefix, name), spt), - _data(globalFailPointRegistry().find(name.toString())) { - invariant(name != "failpoint.*", "Failpoint prototype was auto-registered from IDL"); - invariant(_data != nullptr, "Unknown failpoint: {}"_format(name)); -} - -void FailPointServerParameter::append(OperationContext* opCtx, - BSONObjBuilder& b, - const std::string& name) { - b << name << _data->toBSON(); -} - -Status FailPointServerParameter::setFromString(const std::string& str) { - BSONObj failPointOptions; - try { - failPointOptions = fromjson(str); - } catch (DBException& ex) { - return ex.toStatus(); - } - - auto swParsedOptions = FailPoint::parseBSON(failPointOptions); - if (!swParsedOptions.isOK()) { - return swParsedOptions.getStatus(); - } - _data->setMode(std::move(swParsedOptions.getValue())); - return Status::OK(); -} -} // namespace mongo diff --git a/src/mongo/util/fail_point_registry.h b/src/mongo/util/fail_point_registry.h deleted file mode 100644 index 7a77b47faba..00000000000 --- a/src/mongo/util/fail_point_registry.h +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Copyright (C) 2018-present MongoDB, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the Server Side Public License, version 1, - * as published by MongoDB, Inc. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * Server Side Public License for more details. - * - * You should have received a copy of the Server Side Public License - * along with this program. If not, see - * <http://www.mongodb.com/licensing/server-side-public-license>. - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the Server Side Public License in all respects for - * all of the code used other than as permitted herein. If you modify file(s) - * with this exception, you may extend this exception to your version of the - * file(s), but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. If you delete this - * exception statement from all source files in the program, then also delete - * it in the license file. - */ - -/** - * Should NOT be included by other header files. Include only in source files. - */ - -#pragma once - -#include "mongo/base/status.h" -#include "mongo/stdx/unordered_map.h" -#include "mongo/util/fail_point.h" - -namespace mongo { -/** - * Class for storing FailPoint instances. - */ -class FailPointRegistry { -public: - FailPointRegistry(); - - /** - * Adds a new fail point to this registry. Duplicate names are not allowed. - * - * @return the status code under these circumstances: - * OK - if successful. - * 51006 - if the given name already exists in this registry. - * CannotMutateObject - if this registry is already frozen. - */ - Status add(const std::string& name, FailPoint* failPoint); - - /** - * @return the fail point object registered, or nullptr if it was not registered. - */ - FailPoint* find(const std::string& name) const; - - /** - * Freezes this registry from being modified. - */ - void freeze(); - - /** - * Creates a new FailPointServerParameter for each failpoint in the registry. This allows the - * failpoint to be set on the command line via --setParameter, but is only allowed when - * running with '--setParameter enableTestCommands=1'. - */ - void registerAllFailPointsAsServerParameters(); - -private: - bool _frozen; - stdx::unordered_map<std::string, FailPoint*> _fpMap; -}; -} // namespace mongo diff --git a/src/mongo/util/fail_point_service.cpp b/src/mongo/util/fail_point_service.cpp deleted file mode 100644 index 44d8c69ae65..00000000000 --- a/src/mongo/util/fail_point_service.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Copyright (C) 2018-present MongoDB, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the Server Side Public License, version 1, - * as published by MongoDB, Inc. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * Server Side Public License for more details. - * - * You should have received a copy of the Server Side Public License - * along with this program. If not, see - * <http://www.mongodb.com/licensing/server-side-public-license>. - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the Server Side Public License in all respects for - * all of the code used other than as permitted herein. If you modify file(s) - * with this exception, you may extend this exception to your version of the - * file(s), but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. If you delete this - * exception statement from all source files in the program, then also delete - * it in the license file. - */ - -#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommand - -#include "mongo/platform/basic.h" - -#include "mongo/util/fail_point_service.h" - -#include "mongo/util/assert_util.h" -#include "mongo/util/log.h" - -namespace mongo { - -MONGO_FAIL_POINT_DEFINE(dummy); // used by tests in jstests/fail_point - -MONGO_INITIALIZER_GROUP(FailPointRegistry, (), ("BeginStartupOptionHandling")); - -MONGO_INITIALIZER_GENERAL(AllFailPointsRegistered, (), ()) -(InitializerContext* context) { - globalFailPointRegistry().freeze(); - return Status::OK(); -} - -FailPointRegistry& globalFailPointRegistry() { - static auto& p = *new FailPointRegistry(); - return p; -} - -void setGlobalFailPoint(const std::string& failPointName, const BSONObj& cmdObj) { - FailPoint* failPoint = globalFailPointRegistry().find(failPointName); - - if (failPoint == nullptr) - uasserted(ErrorCodes::FailPointSetFailed, failPointName + " not found"); - - failPoint->setMode(uassertStatusOK(FailPoint::parseBSON(cmdObj))); - warning() << "failpoint: " << failPointName << " set to: " << failPoint->toBSON(); -} - -FailPointEnableBlock::FailPointEnableBlock(const std::string& failPointName) - : _failPointName(failPointName) { - _failPoint = globalFailPointRegistry().find(failPointName); - invariant(_failPoint != nullptr); - _failPoint->setMode(FailPoint::alwaysOn); - warning() << "failpoint: " << failPointName << " set to: " << _failPoint->toBSON(); -} - -FailPointEnableBlock::FailPointEnableBlock(const std::string& failPointName, const BSONObj& data) - : _failPointName(failPointName) { - _failPoint = globalFailPointRegistry().find(failPointName); - invariant(_failPoint != nullptr); - _failPoint->setMode(FailPoint::alwaysOn, 0, data); - warning() << "failpoint: " << failPointName << " set to: " << _failPoint->toBSON(); -} - - -FailPointEnableBlock::~FailPointEnableBlock() { - _failPoint->setMode(FailPoint::off); - warning() << "failpoint: " << _failPointName << " set to: " << _failPoint->toBSON(); -} - -} // namespace mongo diff --git a/src/mongo/util/fail_point_service.h b/src/mongo/util/fail_point_service.h deleted file mode 100644 index 8f7f3261b13..00000000000 --- a/src/mongo/util/fail_point_service.h +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (C) 2018-present MongoDB, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the Server Side Public License, version 1, - * as published by MongoDB, Inc. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * Server Side Public License for more details. - * - * You should have received a copy of the Server Side Public License - * along with this program. If not, see - * <http://www.mongodb.com/licensing/server-side-public-license>. - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the Server Side Public License in all respects for - * all of the code used other than as permitted herein. If you modify file(s) - * with this exception, you may extend this exception to your version of the - * file(s), but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. If you delete this - * exception statement from all source files in the program, then also delete - * it in the license file. - */ - -#pragma once - -#include "mongo/base/init.h" -#include "mongo/util/assert_util.h" -#include "mongo/util/fail_point.h" -#include "mongo/util/fail_point_registry.h" - -namespace mongo { - -FailPointRegistry& globalFailPointRegistry(); - -/** - * Set a fail point in the global registry to a given value via BSON - * @throw DBException If no failpoint called failPointName exists. - */ -void setGlobalFailPoint(const std::string& failPointName, const BSONObj& cmdObj); - -struct FailPointRegisterer { - FailPointRegisterer(const std::string& name, FailPoint* fp) { - uassertStatusOK(globalFailPointRegistry().add(name, fp)); - } -}; - -/** - * Convenience macro for defining a fail point. Must be used at namespace scope. - * Note: that means never at local scope (inside functions) or class scope. - * NOTE: Never use in header files, only sources. - */ -#define MONGO_FAIL_POINT_DEFINE(fp) \ - ::mongo::FailPoint fp; \ - ::mongo::FailPointRegisterer fp##failPointRegisterer(#fp, &fp); - -/** - * Convenience class for enabling a failpoint and disabling it as this goes out of scope. - */ -class FailPointEnableBlock { -public: - explicit FailPointEnableBlock(const std::string& failPointName); - FailPointEnableBlock(const std::string& failPointName, const BSONObj& cmdObj); - ~FailPointEnableBlock(); - -private: - FailPoint* _failPoint; - const std::string _failPointName; -}; - -} // namespace mongo diff --git a/src/mongo/util/fail_point_test.cpp b/src/mongo/util/fail_point_test.cpp index a99d7132a40..af15040e0b3 100644 --- a/src/mongo/util/fail_point_test.cpp +++ b/src/mongo/util/fail_point_test.cpp @@ -40,7 +40,6 @@ #include "mongo/stdx/thread.h" #include "mongo/unittest/unittest.h" #include "mongo/util/fail_point.h" -#include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" #include "mongo/util/time_support.h" diff --git a/src/mongo/util/net/sock.cpp b/src/mongo/util/net/sock.cpp index bd183130d5a..39210d57a40 100644 --- a/src/mongo/util/net/sock.cpp +++ b/src/mongo/util/net/sock.cpp @@ -60,7 +60,7 @@ #include "mongo/util/background.h" #include "mongo/util/concurrency/value.h" #include "mongo/util/debug_util.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/hex.h" #include "mongo/util/log.h" #include "mongo/util/net/private/socket_poll.h" diff --git a/src/mongo/util/net/sock_test.cpp b/src/mongo/util/net/sock_test.cpp index 0d6d4c69017..10cc799d05d 100644 --- a/src/mongo/util/net/sock_test.cpp +++ b/src/mongo/util/net/sock_test.cpp @@ -41,7 +41,7 @@ #include "mongo/stdx/thread.h" #include "mongo/unittest/unittest.h" #include "mongo/util/concurrency/notification.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/net/socket_exception.h" namespace { diff --git a/src/mongo/util/net/ssl/detail/io.hpp b/src/mongo/util/net/ssl/detail/io.hpp index f6ff6edd1d8..90453c3d8e8 100644 --- a/src/mongo/util/net/ssl/detail/io.hpp +++ b/src/mongo/util/net/ssl/detail/io.hpp @@ -18,7 +18,7 @@ #include "asio/detail/config.hpp" #include "asio/write.hpp" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #include "mongo/util/net/ssl/detail/engine.hpp" #include "mongo/util/net/ssl/detail/stream_core.hpp" diff --git a/src/mongo/util/net/ssl_stream.cpp b/src/mongo/util/net/ssl_stream.cpp index 1aeb82d2189..df8bf56770f 100644 --- a/src/mongo/util/net/ssl_stream.cpp +++ b/src/mongo/util/net/ssl_stream.cpp @@ -31,7 +31,7 @@ #include "mongo/config.h" -#include "mongo/util/fail_point_service.h" +#include "mongo/util/fail_point.h" #ifdef MONGO_CONFIG_SSL #include "mongo/util/net/ssl/impl/src.hpp" |