HDFS-11476. Fix NPE in FsDatasetImpl#checkAndUpdate. Contributed by Xiaobing Zhou.
(cherry picked from commit ac5ae0065a127ac150a887fa6c6f3cffd86ef733)
This commit is contained in:
parent
303ee13e3c
commit
30b43a2d4e
@ -2450,11 +2450,13 @@ public void checkAndUpdate(String bpid, long blockId, File diskFile,
|
|||||||
File memMetaFile = FsDatasetUtil.getMetaFile(diskFile,
|
File memMetaFile = FsDatasetUtil.getMetaFile(diskFile,
|
||||||
memBlockInfo.getGenerationStamp());
|
memBlockInfo.getGenerationStamp());
|
||||||
if (fileIoProvider.exists(vol, memMetaFile)) {
|
if (fileIoProvider.exists(vol, memMetaFile)) {
|
||||||
if (memMetaFile.compareTo(diskMetaFile) != 0) {
|
String warningPrefix = "Metadata file in memory "
|
||||||
LOG.warn("Metadata file in memory "
|
|
||||||
+ memMetaFile.getAbsolutePath()
|
+ memMetaFile.getAbsolutePath()
|
||||||
+ " does not match file found by scan "
|
+ " does not match file found by scan ";
|
||||||
+ (diskMetaFile == null? null: diskMetaFile.getAbsolutePath()));
|
if (!diskMetaFileExists) {
|
||||||
|
LOG.warn(warningPrefix + "null");
|
||||||
|
} else if (memMetaFile.compareTo(diskMetaFile) != 0) {
|
||||||
|
LOG.warn(warningPrefix + diskMetaFile.getAbsolutePath());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Metadata file corresponding to block in memory is missing
|
// Metadata file corresponding to block in memory is missing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user