From 3106f79f5b8cfe4bc912e68156e33eb9a7c04182 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 --- 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 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; } -- 2.47.3