From: Leonid Chernin Date: Wed, 6 Nov 2024 11:04:16 +0000 (+0000) Subject: mon/nvmeofgw*: monitors publish in nvme-gw show ana group responsible X-Git-Tag: testing/wip-vshankar-testing-20241118.055430-debug~31^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c3584838cf1cc837ab37207260ed3c42b6b9d154;p=ceph-ci.git mon/nvmeofgw*: monitors publish in nvme-gw show ana group responsible for namespace rebalance Signed-off-by: Leonid Chernin --- diff --git a/src/mon/NVMeofGwMon.cc b/src/mon/NVMeofGwMon.cc index 4d2b5074b4d..9d80c23a4c1 100644 --- a/src/mon/NVMeofGwMon.cc +++ b/src/mon/NVMeofGwMon.cc @@ -66,6 +66,11 @@ void NVMeofGwMon::on_shutdown() void NVMeofGwMon::tick() { + if (++tick_ratio == 10) { + global_rebalance_index++; + dout(20) << "rebalance index " << global_rebalance_index << dendl; + tick_ratio = 0; + } if (!is_active() || !mon.is_leader()) { dout(10) << "NVMeofGwMon leader : " << mon.is_leader() << "active : " << is_active() << dendl; @@ -317,6 +322,11 @@ bool NVMeofGwMon::preprocess_command(MonOpRequestRef op) f->dump_string("group", group); if (HAVE_FEATURE(mon.get_quorum_con_features(), NVMEOFHA)) { f->dump_string("features", "LB"); + if (map.created_gws[group_key].size()) { + uint32_t index = (global_rebalance_index % + map.created_gws[group_key].size()) + 1; + f->dump_unsigned("rebalance_ana_group", index); + } } f->dump_unsigned("num gws", map.created_gws[group_key].size()); if (map.created_gws[group_key].size() == 0) { diff --git a/src/mon/NVMeofGwMon.h b/src/mon/NVMeofGwMon.h index 7fae8b766a5..2d13e153bd2 100644 --- a/src/mon/NVMeofGwMon.h +++ b/src/mon/NVMeofGwMon.h @@ -83,6 +83,9 @@ public: void check_sub(Subscription *sub); private: + // used for calculate pool & group GW responsible for rebalance + uint32_t global_rebalance_index = 1; + uint8_t tick_ratio = 0; void synchronize_last_beacon(); void process_gw_down(const NvmeGwId &gw_id, const NvmeGroupKey& group_key, bool &propose_pending,