[ https://issues.apache.org/jira/browse/HDFS-17184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17763337#comment-17763337 ]
ASF GitHub Bot commented on HDFS-17184: --------------------------------------- haiyang1987 opened a new pull request, #6044: URL: https://github.com/apache/hadoop/pull/6044 ### Description of PR https://issues.apache.org/jira/browse/HDFS-17184 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. ``` 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; } }``` > In BlockReceiver constructor method need throw DiskOutOfSpaceException > ---------------------------------------------------------------------- > > 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 > > 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: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org