HDFS-11229. HDFS-11056 failed to close meta file. Contributed by Wei-Chiu Chuang.
(cherry picked from commit292bd78b44
) (cherry picked from commitfa3b2bee61
)
This commit is contained in:
parent
deae1f8323
commit
2123b664ca
|
@ -205,6 +205,8 @@ Release 2.7.4 - UNRELEASED
|
|||
HDFS-11180. Intermittent deadlock in NameNode when failover happens.
|
||||
(aajisaka)
|
||||
|
||||
HDFS-11229. HDFS-11056 failed to close meta file. (Wei-Chiu Chuang)
|
||||
|
||||
Release 2.7.3 - 2016-08-25
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
|
|
@ -1097,9 +1097,10 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
|
|||
int offsetInChecksum = BlockMetadataHeader.getHeaderSize() +
|
||||
(int)(onDiskLen / bytesPerChecksum * checksumSize);
|
||||
byte[] lastChecksum = new byte[checksumSize];
|
||||
RandomAccessFile raf = new RandomAccessFile(metaFile, "r");
|
||||
raf.seek(offsetInChecksum);
|
||||
raf.read(lastChecksum, 0, checksumSize);
|
||||
try (RandomAccessFile raf = new RandomAccessFile(metaFile, "r")) {
|
||||
raf.seek(offsetInChecksum);
|
||||
raf.read(lastChecksum, 0, checksumSize);
|
||||
}
|
||||
return lastChecksum;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue