HBASE-12209 NPE in HRegionServer#getLastSequenceId

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

View File

@ -2110,11 +2110,23 @@ public class HRegionServer extends HasThread implements
try {
GetLastFlushedSequenceIdRequest req = RequestConverter
.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();
} catch (ServiceException e) {
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;
}