HBASE-12209 NPE in HRegionServer#getLastSequenceId

This commit is contained in:
Jimmy Xiang 2014-10-08 18:22:33 -07:00
parent 0b0948920f
commit d665cbf630
1 changed files with 14 additions and 2 deletions

View File

@ -2075,11 +2075,23 @@ public class HRegionServer extends HasThread implements
try { try {
GetLastFlushedSequenceIdRequest req = RequestConverter GetLastFlushedSequenceIdRequest req = RequestConverter
.buildGetLastFlushedSequenceIdRequest(region); .buildGetLastFlushedSequenceIdRequest(region);
lastFlushedSequenceId = rssStub.getLastFlushedSequenceId(null, req) RegionServerStatusService.BlockingInterface rss = rssStub;
if (rss == null) { // Try to connect one more time
createRegionServerStatusStub();
rss = rssStub;
if (rss == null) {
// Still no luck, we tried
LOG.warn("Unable to connect to the master to check "
+ "the last flushed sequence id");
return -1l;
}
}
lastFlushedSequenceId = rss.getLastFlushedSequenceId(null, req)
.getLastFlushedSequenceId(); .getLastFlushedSequenceId();
} catch (ServiceException e) { } catch (ServiceException e) {
lastFlushedSequenceId = -1l; lastFlushedSequenceId = -1l;
LOG.warn("Unable to connect to the master to check " + "the last flushed sequence id", e); LOG.warn("Unable to connect to the master to check "
+ "the last flushed sequence id", e);
} }
return lastFlushedSequenceId; return lastFlushedSequenceId;
} }