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

This commit is contained in:
Ted Yu 2014-06-24 22:47:56 +00:00
parent 6586728159
commit 62db371321
1 changed files with 7 additions and 2 deletions

View File

@ -1057,8 +1057,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;
}
}
/**