]> 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)
committerGreg Farnum <gfarnum@redhat.com>
Wed, 21 Aug 2019 22:12:48 +0000 (15:12 -0700)
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/common/legacy_config_opts.h
src/common/options.cc
src/mon/MonClient.cc

index 88a6b94882b471ed5196a95bb8111f1366ac0f3b..b1928d74a159e8e961e2890c3625809ccda290b3 100644 (file)
@@ -334,6 +334,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 556a612eb3550ea14223ed80c893b52d09fafd4b..7d64596d9b561df5036815eb6181d69312c57195 100644 (file)
@@ -2220,6 +2220,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 d868555b520eba1a59bc57ec01d020424b91314e..11915ff237ca801d7f5da9f432ad9aecddf96949 100644 (file)
@@ -1040,7 +1040,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;
     }
@@ -1059,7 +1059,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;
     }