]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonClient: provide config to target specific rank
authorPatrick Donnelly <pdonnell@redhat.com>
Mon, 17 Jul 2023 15:37:07 +0000 (11:37 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 21 Jul 2023 14:09:04 +0000 (10:09 -0400)
This is useful for benchmarks particularly that require consistent rank
choice (i.e. leader).

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/common/options/global.yaml.in
src/mon/MonClient.cc

index 3a3a4a1372916bf656eeb4beecaa9b15e4d37db7..37f9ccce52eb23f77b1403c2ee61b8001b4d5577 100644 (file)
@@ -2234,6 +2234,14 @@ options:
   level: advanced
   default: 3
   with_legacy: true
+- name: mon_client_target_rank
+  type: int
+  level: advanced
+  default: -1
+  min: -1
+  flags:
+  - runtime
+  fmt_desc: automatically target mon rank for client communication
 # try new mon every N seconds until we connect
 - name: mon_client_hunt_interval
   type: float
index 57c70309dfd83940394439707dcd6bdfafd86c3a..752f3b2fb7db7a1e3c4ea383f4b3cf62e602177e 100644 (file)
@@ -749,6 +749,10 @@ void MonClient::_reopen_session(int rank)
 
   _start_hunting();
 
+  if (rank == -1) {
+    rank = cct->_conf.get_val<int64_t>("mon_client_target_rank");
+  }
+
   if (rank >= 0) {
     _add_conn(rank);
   } else {