Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.20.3
-
None
-
Any
-
Reviewed
Description
doReconstructionLog doesn't handle empty files correctly:
FileStatus stat = this.fs.getFileStatus(reconstructionLog); if (stat.getLen() <= 0) { LOG.warn("Passed reconstruction log " + reconstructionLog + " is zero-length. Deleting existing file"); fs.delete(reconstructionLog, false); return -1; }
Notice it actually compares the length of the array instead of the file length.
It should call getLen() and delete the file afterwards
FileStatus stat = this.fs.getFileStatus(reconstructionLog); if (stat.getLen() <= 0) { LOG.warn("Passed reconstruction log " + reconstructionLog + " is zero-length. Deleting existing file"); fs.delete(reconstructionLog, false); return -1; }
Also. This is a situation that shouldn't happen as an empty oldlogfile.log should be deleted when HMaster does the split in HLog.splitLog().
I couldn't figure what would make it leave it there as I also see in the logs that other empty logs are deleted. This might expose a thornier situation.
Attachments
Attachments
Issue Links
- relates to
-
HBASE-1994 Master will lose hlog entries while splitting if region has empty oldlogfile.log
- Closed