HDFS-11476. Fix NPE in FsDatasetImpl#checkAndUpdate. Contributed by Xiaobing Zhou.
This commit is contained in:
parent
2148b83993
commit
ac5ae0065a
|
@ -2282,12 +2282,14 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
|
|||
if (memBlockInfo.getGenerationStamp() != diskGS) {
|
||||
File memMetaFile = FsDatasetUtil.getMetaFile(diskFile,
|
||||
memBlockInfo.getGenerationStamp());
|
||||
if (memMetaFile.exists()) {
|
||||
if (memMetaFile.compareTo(diskMetaFile) != 0) {
|
||||
LOG.warn("Metadata file in memory "
|
||||
if (fileIoProvider.exists(vol, memMetaFile)) {
|
||||
String warningPrefix = "Metadata file in memory "
|
||||
+ memMetaFile.getAbsolutePath()
|
||||
+ " does not match file found by scan "
|
||||
+ (diskMetaFile == null? null: diskMetaFile.getAbsolutePath()));
|
||||
+ " does not match file found by scan ";
|
||||
if (!diskMetaFileExists) {
|
||||
LOG.warn(warningPrefix + "null");
|
||||
} else if (memMetaFile.compareTo(diskMetaFile) != 0) {
|
||||
LOG.warn(warningPrefix + diskMetaFile.getAbsolutePath());
|
||||
}
|
||||
} else {
|
||||
// Metadata file corresponding to block in memory is missing
|
||||
|
|
Loading…
Reference in New Issue