hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject git commit: HBASE-11396 Invalid meta entries can lead to unstartable master (Craig Condit)
Date Tue, 24 Jun 2014 22:47:06 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 01d5e7626 -> ac5318900


HBASE-11396 Invalid meta entries can lead to unstartable master (Craig Condit)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/ac531890
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ac531890
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ac531890

Branch: refs/heads/0.98
Commit: ac531890044f3997bc224e4cb0423e20e338f5d0
Parents: 01d5e76
Author: Ted Yu <tedyu@apache.org>
Authored: Tue Jun 24 22:46:49 2014 +0000
Committer: Ted Yu <tedyu@apache.org>
Committed: Tue Jun 24 22:46:49 2014 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hbase/HRegionInfo.java  | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ac531890/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java
index 78e175d..afd1d04 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java
@@ -1056,8 +1056,13 @@ public class HRegionInfo implements Comparable<HRegionInfo> {
     cell = r.getColumnLatestCell(HConstants.CATALOG_FAMILY,
       HConstants.STARTCODE_QUALIFIER);
     if (cell == null || cell.getValueLength() == 0) return null;
-    return ServerName.valueOf(hostAndPort,
-        Bytes.toLong(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength()));
+    try {
+      return ServerName.valueOf(hostAndPort,
+          Bytes.toLong(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength()));
+    } catch (IllegalArgumentException e) {
+      LOG.error("Ignoring invalid region for server " + hostAndPort + "; cell=" + cell, e);
+      return null;
+    }
   }
 
   /**


Mime
View raw message