[
https://issues.apache.org/jira/browse/HDFS-17184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xiaoqiao He resolved HDFS-17184.
--------------------------------
Fix Version/s: 3.4.0
Hadoop Flags: Reviewed
Resolution: Fixed
> Improve BlockReceiver to throws DiskOutOfSpaceException when initialize
> -----------------------------------------------------------------------
>
> Key: HDFS-17184
> URL: https://issues.apache.org/jira/browse/HDFS-17184
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: Haiyang Hu
> Assignee: Haiyang Hu
> Priority: Major
> Labels: pull-request-available
> Fix For: 3.4.0
>
>
> BlockReceiver class will receives a block and writes to its disk,
> in the constructor method, createTemporary and createRbw will execute
> chooseVolume, and DiskOutOfSpaceException may occur in chooseVolume.
> current in the processing logic, if the exception occurs will be cacth by
> BlockReceiver.java line_282 catch(IOException ioe) here, and cleanupBlock()
> will be executed here.
> since the replica of the current block has not been added to ReplicaMap,
> executing cleanupBlock will throw ReplicaNotFoundException.
> the ReplicaNotFoundException exception will overwrite the actual
> DiskOutOfSpaceException, resulting in inaccurate exception information.
> {code:java}
> BlockReceiver(final ExtendedBlock block, final StorageType storageType,
> final DataInputStream in,
> final String inAddr, final String myAddr,
> final BlockConstructionStage stage,
> final long newGs, final long minBytesRcvd, final long maxBytesRcvd,
> final String clientname, final DatanodeInfo srcDataNode,
> final DataNode datanode, DataChecksum requestedChecksum,
> CachingStrategy cachingStrategy,
> final boolean allowLazyPersist,
> final boolean pinning,
> final String storageId) throws IOException {
> try{
> ...
> } catch (ReplicaAlreadyExistsException bae) {
> throw bae;
> } catch (ReplicaNotFoundException bne) {
> throw bne;
> } catch(IOException ioe) {
> if (replicaInfo != null) {
> replicaInfo.releaseAllBytesReserved();
> }
> IOUtils.closeStream(this);
> cleanupBlock();// if ReplicaMap does not exist replica will throw
> ReplicaNotFoundException
> ...
> throw ioe;
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]