From: Leonid Chernin Date: Wed, 4 Sep 2024 08:54:59 +0000 (+0000) Subject: mon/NVMeofGw*: X-Git-Tag: v20.0.0~1115^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F59592%2Fhead;p=ceph.git 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 --- diff --git a/src/mon/NVMeofGwMap.cc b/src/mon/NVMeofGwMap.cc index b20060c68fec..aba18a336113 100755 --- a/src/mon/NVMeofGwMap.cc +++ b/src/mon/NVMeofGwMap.cc @@ -744,8 +744,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; @@ -759,10 +765,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; }