]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/NVMeofGw*: 59592/head
authorLeonid Chernin <leonidc@il.ibm.com>
Wed, 4 Sep 2024 08:54:59 +0000 (08:54 +0000)
committerLeonid Chernin <leonidc@il.ibm.com>
Fri, 6 Sep 2024 06:44:28 +0000 (06:44 +0000)
 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>
src/mon/NVMeofGwMap.cc

index b20060c68fec829df67bd89c54de83eea9af0c28..aba18a33611343450c8b2ecdffdbf100a69ebed2 100755 (executable)
@@ -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;
     }