Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.4.0
-
Reviewed
Description
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; } }
Attachments
Issue Links
- links to