HDFS-9661. Deadlock in DN.FsDatasetImpl between moveBlockAcrossStorage and createRbw (Contributed by ade)
(cherry picked from commit 14255786908f991fd2022480fe5575533a3dc7ce)
This commit is contained in:
parent
2131b9820d
commit
eb3dcc0739
@ -59,6 +59,9 @@ Release 2.7.3 - UNRELEASED
|
||||
HDFS-9648. TestStartup.testImageChecksum is broken by HDFS-9569's message
|
||||
change. (Wei-Chiu Chuang via Yongjun Zhang)
|
||||
|
||||
HDFS-9661. Deadlock in DN.FsDatasetImpl between moveBlockAcrossStorage and
|
||||
createRbw (ade via vinayakumarb)
|
||||
|
||||
Release 2.7.2 - UNRELEASED
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
@ -896,8 +896,11 @@ public ReplicaInfo moveBlockAcrossStorage(ExtendedBlock block,
|
||||
+ replicaInfo.getVolume().getStorageType());
|
||||
}
|
||||
|
||||
try (FsVolumeReference volumeRef = volumes.getNextVolume(
|
||||
targetStorageType, block.getNumBytes())) {
|
||||
FsVolumeReference volumeRef = null;
|
||||
synchronized (this) {
|
||||
volumeRef = volumes.getNextVolume(targetStorageType, block.getNumBytes());
|
||||
}
|
||||
try {
|
||||
File oldBlockFile = replicaInfo.getBlockFile();
|
||||
File oldMetaFile = replicaInfo.getMetaFile();
|
||||
FsVolumeImpl targetVolume = (FsVolumeImpl) volumeRef.getVolume();
|
||||
@ -916,6 +919,10 @@ public ReplicaInfo moveBlockAcrossStorage(ExtendedBlock block,
|
||||
|
||||
removeOldReplica(replicaInfo, newReplicaInfo, oldBlockFile, oldMetaFile,
|
||||
oldBlockFile.length(), oldMetaFile.length(), block.getBlockPoolId());
|
||||
} finally {
|
||||
if (volumeRef != null) {
|
||||
volumeRef.close();
|
||||
}
|
||||
}
|
||||
|
||||
// Replace the old block if any to reschedule the scanning.
|
||||
|
Loading…
x
Reference in New Issue
Block a user