Details
Description
When BlockSender throws an exception because the meta-data cannot be found, the volume reference obtained by the thread is not released, which causes the thread trying to remove the volume to wait and fall into an infinite loop.
boolean checkVolumesRemoved() { Iterator<FsVolumeImpl> it = volumesBeingRemoved.iterator(); while (it.hasNext()) { FsVolumeImpl volume = it.next(); if (!volume.checkClosed()) { return false; } it.remove(); } return true; } boolean checkClosed() { // always be true. if (this.reference.getReferenceCount() > 0) { FsDatasetImpl.LOG.debug("The reference count for {} is {}, wait to be 0.", this, reference.getReferenceCount()); return false; } return true; }
At the same time, because the thread has been holding checkDirsLock when removing the volume, other threads trying to acquire the same lock will be permanently blocked.
Similar problems also occur in RamDiskAsyncLazyPersistService and FsDatasetAsyncDiskService.
This patch releases the three previously unreleased volume references.
Attachments
Attachments
Issue Links
- supercedes
-
HDFS-15018 DataNode doesn't shutdown although the number of failed disks reaches dfs.datanode.failed.volumes.tolerated
- Resolved
-
HDFS-15945 DataNodes with zero capacity and zero blocks should be decommissioned immediately
- Resolved
- links to