From ce4572c43dff7816d9a2cd1668f10db3f1f7673d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 17 Jun 2019 13:28:39 -0500 Subject: [PATCH] msg/async: add ms_blackhole_$type options Add the ability to blackhole messages sent or received from the given entity type. This will let us inject a network stall that will appear similar to a network partition of a single node from its peers. Signed-off-by: Sage Weil --- src/common/legacy_config_opts.h | 5 +++++ src/common/options.cc | 20 ++++++++++++++++++++ src/msg/async/AsyncConnection.cc | 12 ++++++++++++ src/msg/async/ProtocolV1.cc | 18 ++++++++++++++++-- src/msg/async/ProtocolV2.cc | 19 ++++++++++++++++--- 5 files changed, 69 insertions(+), 5 deletions(-) diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index bad93ac316e..f04e6112661 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -132,6 +132,11 @@ OPTION(ms_inject_delay_msg_type, OPT_STR) // the type of message to delay). OPTION(ms_inject_delay_max, OPT_DOUBLE) // seconds OPTION(ms_inject_delay_probability, OPT_DOUBLE) // range [0, 1] OPTION(ms_inject_internal_delays, OPT_DOUBLE) // seconds +OPTION(ms_blackhole_osd, OPT_BOOL) +OPTION(ms_blackhole_mon, OPT_BOOL) +OPTION(ms_blackhole_mds, OPT_BOOL) +OPTION(ms_blackhole_mgr, OPT_BOOL) +OPTION(ms_blackhole_client, OPT_BOOL) OPTION(ms_dump_on_send, OPT_BOOL) // hexdump msg to log on send OPTION(ms_dump_corrupt_message_level, OPT_INT) // debug level to hexdump undecodeable messages at OPTION(ms_async_op_threads, OPT_U64) // number of worker processing threads for async messenger created on init diff --git a/src/common/options.cc b/src/common/options.cc index 47cf024462d..774726b1b7f 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -1066,6 +1066,26 @@ std::vector