]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonClient: allow retries to be adjusted
authorSage Weil <sage@redhat.com>
Wed, 17 Jul 2019 21:46:52 +0000 (16:46 -0500)
committerNathan Cutler <ncutler@suse.com>
Mon, 21 Oct 2019 21:47:55 +0000 (23:47 +0200)
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
(cherry picked from commit 2c8e538e8352d17f8f64c77b80e18a764540c8d0)

src/common/legacy_config_opts.h
src/common/options.cc
src/mon/MonClient.cc

index 72a0f389632a942c42887895d2d6004797fdd046..2d57f05fe415d1d12a42c1b973660a946bcd89e5 100644 (file)
@@ -343,6 +343,7 @@ OPTION(mon_client_ping_timeout, OPT_DOUBLE)   // fail if we don't hear back
 OPTION(mon_client_hunt_interval_backoff, OPT_DOUBLE) // each time we reconnect to a monitor, double our timeout
 OPTION(mon_client_hunt_interval_max_multiple, OPT_DOUBLE) // up to a max of 10*default (30 seconds)
 OPTION(mon_client_max_log_entries_per_message, OPT_INT)
+OPTION(mon_client_directed_command_retry, OPT_INT)
 OPTION(client_cache_size, OPT_INT)
 OPTION(client_cache_mid, OPT_FLOAT)
 OPTION(client_use_random_mds, OPT_BOOL)
index 22691b9ddac8391cf722d44d49a0dae6a7bdb4be..adb10c7f0930e642dff000cbc51330eb987ae4cb 100644 (file)
@@ -2235,6 +2235,10 @@ std::vector<Option> get_global_options() {
     .set_default(1000)
     .set_description(""),
 
+    Option("mon_client_directed_command_retry", Option::TYPE_INT, Option::LEVEL_DEV)
+    .set_default(2)
+    .set_description("Number of times to try sending a comamnd directed at a specific monitor"),
+
     Option("mon_max_pool_pg_num", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(65536)
     .set_description(""),
index c08d95dcdfaec5d739a10f60bf0d98a122e457cc..855ce4ec9592d3ace8e729a3c18191ae935a2103 100644 (file)
@@ -1010,7 +1010,7 @@ void MonClient::_send_command(MonCommand *r)
 
   if (r->target_rank >= 0 &&
       r->target_rank != monmap.get_rank(peer)) {
-    if (r->send_attempts > 1) {
+    if (r->send_attempts > cct->_conf->mon_client_directed_command_retry) {
       _finish_command(r, -ENXIO, "mon unavailable");
       return;
     }
@@ -1029,7 +1029,7 @@ void MonClient::_send_command(MonCommand *r)
 
   if (r->target_name.length() &&
       r->target_name != monmap.get_name(peer)) {
-    if (r->send_attempts > 1) {
+    if (r->send_attempts > cct->_conf->mon_client_directed_command_retry) {
       _finish_command(r, -ENXIO, "mon unavailable");
       return;
     }