Skip to content

Commit 936d3af

Browse files
leonidcktdreyer
authored andcommitted
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 <leonidc@il.ibm.com>
1 parent f913770 commit 936d3af

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

src/mon/NVMeofGwMap.cc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,14 @@ int NVMeofGwMap::blocklist_gw(
802802
{
803803
// find_already_created_gw(gw_id, group_key);
804804
NvmeGwMonState& gw_map = created_gws[group_key][gw_id];
805+
NvmeNonceVector nonces;
806+
for (auto& state_itr: gw_map.sm_state) {
807+
// to make blocklist on all clusters of the failing GW
808+
nonces.insert(nonces.end(), gw_map.nonce_map[state_itr.first].begin(),
809+
gw_map.nonce_map[state_itr.first].end());
810+
}
805811

806-
if (gw_map.nonce_map[grpid].size() > 0) {
812+
if (nonces.size() > 0) {
807813
NvmeNonceVector &nonce_vector = gw_map.nonce_map[grpid];;
808814
std::string str = "[";
809815
entity_addrvec_t addr_vect;
@@ -817,10 +823,10 @@ int NVMeofGwMap::blocklist_gw(
817823
str += it;
818824
}
819825
str += "]";
820-
bool rc = addr_vect.parse(&str[0]);
821-
dout(10) << str << " rc " << rc << " network vector: " << addr_vect
826+
bool success = addr_vect.parse(&str[0]);
827+
dout(10) << str << " parse success " << success << " network vector: " << addr_vect
822828
<< " " << addr_vect.size() << dendl;
823-
if (rc) {
829+
if (!success) {
824830
return 1;
825831
}
826832

0 commit comments

Comments
 (0)