thangTang commented on a change in pull request #1071: HBASE-23693 Split 
failure may cause region hole and data loss when use zk assign
URL: https://github.com/apache/hbase/pull/1071#discussion_r369710499
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java
 ##########
 @@ -758,8 +764,20 @@ public void regionOffline(
             // Delete the ZNode if exists
             ZKAssign.deleteNodeFailSilent(watcher, region);
             regionsToOffline.add(region);
+            PairOfSameType<HRegionInfo> daughterRegions =
+              
MetaTableAccessor.getDaughterRegionsFromParent(this.server.getConnection(), 
region);
+            if (daughterRegions != null) {
+              if (daughterRegions.getFirst() != null) {
+                
daughter2Parent.put(daughterRegions.getFirst().getEncodedName(), region);
+              }
+              if (daughterRegions.getSecond() != null) {
+                
daughter2Parent.put(daughterRegions.getSecond().getEncodedName(), region);
+              }
+            }
           } catch (KeeperException ke) {
             server.abort("Unexpected ZK exception deleting node " + region, 
ke);
+          } catch (IOException e) {
+            LOG.warn("get daughter from meta exception " + region, e);
 
 Review comment:
   > If you think it's too much work try fixing the state/split flag updates on 
this PR, then yeah, we can merge this one for now, then work on the other 
solution in a different jira/RP.
   Yeah, I hope to merge this patch first, and other work can be completed in 
new JIRA. At least it can solve the problem of data loss. In extreme scenarios, 
the region hole can be temporarily repaired by HBCK.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to