HBASE-25053 WAL replay should ignore 0-length files (#2437)
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
This commit is contained in:
parent
4bd9ee43a4
commit
0e71d6192a
|
@ -5372,6 +5372,11 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
|
|||
recoveredEditsDir);
|
||||
if (files != null) {
|
||||
for (FileStatus file : files) {
|
||||
// it is safe to trust the zero-length in this case because we've been through rename and
|
||||
// lease recovery in the above.
|
||||
if (isZeroLengthThenDelete(fs, file, file.getPath())) {
|
||||
continue;
|
||||
}
|
||||
seqId =
|
||||
Math.max(seqId, replayRecoveredEdits(file.getPath(), maxSeqIdInStores, reporter, fs));
|
||||
}
|
||||
|
@ -6536,6 +6541,8 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
|
|||
}
|
||||
|
||||
/**
|
||||
* make sure have been through lease recovery before get file status, so the file length can be
|
||||
* trusted.
|
||||
* @param p File to check.
|
||||
* @return True if file was zero-length (and if so, we'll delete it in here).
|
||||
* @throws IOException
|
||||
|
|
Loading…
Reference in New Issue