[
https://issues.apache.org/jira/browse/HDFS-17184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17767819#comment-17767819
]
ASF GitHub Bot commented on HDFS-17184:
---------------------------------------
haiyang1987 commented on PR #6044:
URL: https://github.com/apache/hadoop/pull/6044#issuecomment-1730810583
Thanks @Hexiaoqiao help me review and merge it.
> 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]