Hexiaoqiao commented on code in PR #6368:
URL: https://github.com/apache/hadoop/pull/6368#discussion_r1435791414


##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java:
##########
@@ -536,8 +536,13 @@ protected void adjustChunkBoundary() {
     }
 
     if (!getStreamer().getAppendChunk()) {
-      final int psize = (int) Math
-          .min(blockSize - getStreamer().getBytesCurBlock(), writePacketSize);
+      int psize = 0;
+      if (blockSize == getStreamer().getBytesCurBlock()) {

Review Comment:
   Not think carefully, but it seems good improvement for my first feeling. cc 
@zhangshuyan0 Would you mind to take another review?
   @hfutatzhanghb it is better to add unit tests to cover this case. Thanks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to