Skip to content

Commit 3106f79

Browse files
committed
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 <[email protected]>
1 parent 4ee8e59 commit 3106f79

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/mon/NVMeofGwMap.cc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -744,8 +744,14 @@ int NVMeofGwMap::blocklist_gw(
744744
{
745745
// find_already_created_gw(gw_id, group_key);
746746
NvmeGwMonState& gw_map = created_gws[group_key][gw_id];
747+
NvmeNonceVector nonces;
748+
for (auto& state_itr: gw_map.sm_state) {
749+
// to make blocklist on all clusters of the failing GW
750+
nonces.insert(nonces.end(), gw_map.nonce_map[state_itr.first].begin(),
751+
gw_map.nonce_map[state_itr.first].end());
752+
}
747753

748-
if (gw_map.nonce_map[grpid].size() > 0) {
754+
if (nonces.size() > 0) {
749755
NvmeNonceVector &nonce_vector = gw_map.nonce_map[grpid];;
750756
std::string str = "[";
751757
entity_addrvec_t addr_vect;
@@ -759,10 +765,10 @@ int NVMeofGwMap::blocklist_gw(
759765
str += it;
760766
}
761767
str += "]";
762-
bool rc = addr_vect.parse(&str[0]);
763-
dout(10) << str << " rc " << rc << " network vector: " << addr_vect
768+
bool success = addr_vect.parse(&str[0]);
769+
dout(10) << str << " parse success " << success << " network vector: " << addr_vect
764770
<< " " << addr_vect.size() << dendl;
765-
if (rc) {
771+
if (!success) {
766772
return 1;
767773
}
768774

0 commit comments

Comments
 (0)