HBASE-22376 master can fail to start w/NPE if lastflushedseqids file is empty
Signed-off-by: Peter Somogyi <psomogyi@apache.org>
This commit is contained in:
parent
420fbba6ae
commit
3641e7a97d
|
@ -1007,7 +1007,7 @@ public class HMaster extends HRegionServer implements MasterServices {
|
||||||
try {
|
try {
|
||||||
this.serverManager.loadLastFlushedSequenceIds();
|
this.serverManager.loadLastFlushedSequenceIds();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.debug("Failed to load last flushed sequence id of regions"
|
LOG.info("Failed to load last flushed sequence id of regions"
|
||||||
+ " from file system", e);
|
+ " from file system", e);
|
||||||
}
|
}
|
||||||
// Set ourselves as active Master now our claim has succeeded up in zk.
|
// Set ourselves as active Master now our claim has succeeded up in zk.
|
||||||
|
|
|
@ -1126,6 +1126,10 @@ public class ServerManager {
|
||||||
try {
|
try {
|
||||||
FlushedSequenceId flushedSequenceId =
|
FlushedSequenceId flushedSequenceId =
|
||||||
FlushedSequenceId.parseDelimitedFrom(in);
|
FlushedSequenceId.parseDelimitedFrom(in);
|
||||||
|
if (flushedSequenceId == null) {
|
||||||
|
LOG.info(".lastflushedseqids found at {} is empty", lastFlushedSeqIdPath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (FlushedRegionSequenceId flushedRegionSequenceId : flushedSequenceId
|
for (FlushedRegionSequenceId flushedRegionSequenceId : flushedSequenceId
|
||||||
.getRegionSequenceIdList()) {
|
.getRegionSequenceIdList()) {
|
||||||
byte[] encodedRegionName = flushedRegionSequenceId
|
byte[] encodedRegionName = flushedRegionSequenceId
|
||||||
|
|
Loading…
Reference in New Issue