wchevreuil commented on a change in pull request #867: HBASE-23117: Bad enum in 
hbase:meta info:state column can fail loadMeta and stop startup
URL: https://github.com/apache/hbase/pull/867#discussion_r349553189
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStateStore.java
 ##########
 @@ -352,8 +352,16 @@ public static State getRegionState(final Result r, int 
replicaId) {
     if (cell == null || cell.getValueLength() == 0) {
       return null;
     }
-    return State.valueOf(Bytes.toString(cell.getValueArray(), 
cell.getValueOffset(),
-        cell.getValueLength()));
+
+    String state = Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
+        cell.getValueLength());
+    try {
+      return State.valueOf(state);
+    }
+    catch (IllegalArgumentException e) {
+      LOG.debug("BAD value {} in hbase:meta info:state column", state);
 
 Review comment:
   Can we also log the specific region encoded name? Also, as it's an 
exceptional situation, I think log level should be WARN. We could also give 
some tip for fixing it using hbck2 _setRegionStateInMeta_ command?

----------------------------------------------------------------
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