From 790d630d8c2cecee79101bfcf40bb0d9c1f616f0 Mon Sep 17 00:00:00 2001 From: Leonid Chernin Date: Wed, 4 Sep 2024 08:54:59 +0000 Subject: [PATCH] mon/NVMeofGw*: 1. fix blocklist bug - blockist was not called 2. originally monitor only bloklisted specific ana groups but since we allow the changing of ns ana grp on the fly for the sake of ns load balance, it is not good enough and we need to blocklist all the cluster contexts of the failing gateway Signed-off-by: Leonid Chernin (cherry picked from commit 936d3af670f491ecc0898ff0dd6b114b684db79d) --- src/mon/NVMeofGwMap.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mon/NVMeofGwMap.cc b/src/mon/NVMeofGwMap.cc index 6fe1a611fd7..7d886344244 100755 --- a/src/mon/NVMeofGwMap.cc +++ b/src/mon/NVMeofGwMap.cc @@ -802,8 +802,14 @@ int NVMeofGwMap::blocklist_gw( { // find_already_created_gw(gw_id, group_key); NvmeGwMonState& gw_map = created_gws[group_key][gw_id]; + NvmeNonceVector nonces; + for (auto& state_itr: gw_map.sm_state) { + // to make blocklist on all clusters of the failing GW + nonces.insert(nonces.end(), gw_map.nonce_map[state_itr.first].begin(), + gw_map.nonce_map[state_itr.first].end()); + } - if (gw_map.nonce_map[grpid].size() > 0) { + if (nonces.size() > 0) { NvmeNonceVector &nonce_vector = gw_map.nonce_map[grpid];; std::string str = "["; entity_addrvec_t addr_vect; @@ -817,10 +823,10 @@ int NVMeofGwMap::blocklist_gw( str += it; } str += "]"; - bool rc = addr_vect.parse(&str[0]); - dout(10) << str << " rc " << rc << " network vector: " << addr_vect + bool success = addr_vect.parse(&str[0]); + dout(10) << str << " parse success " << success << " network vector: " << addr_vect << " " << addr_vect.size() << dendl; - if (rc) { + if (!success) { return 1; } -- 2.47.3