From: Patrick Donnelly Date: Mon, 17 Jul 2023 15:37:07 +0000 (-0400) Subject: mon/MonClient: provide config to target specific rank X-Git-Tag: v19.0.0~446^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3480f96e371dc2be6acb363f76f59a943f692aef;p=ceph.git mon/MonClient: provide config to target specific rank This is useful for benchmarks particularly that require consistent rank choice (i.e. leader). Signed-off-by: Patrick Donnelly --- diff --git a/src/common/options/global.yaml.in b/src/common/options/global.yaml.in index 3a3a4a137291..37f9ccce52eb 100644 --- a/src/common/options/global.yaml.in +++ b/src/common/options/global.yaml.in @@ -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 diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 57c70309dfd8..752f3b2fb7db 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -749,6 +749,10 @@ void MonClient::_reopen_session(int rank) _start_hunting(); + if (rank == -1) { + rank = cct->_conf.get_val("mon_client_target_rank"); + } + if (rank >= 0) { _add_conn(rank); } else {