len548 commented on code in PR #11384:
URL: https://github.com/apache/ozone/pull/11384#discussion_r4469643024


##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java:
##########
@@ -433,19 +413,36 @@ public void watchForCommit(boolean bufferFull) throws 
IOException {
    * @param close whether putBlock is happening as part of closing the stream
    */
   public void executePutBlock(boolean sync, boolean close) throws IOException {
+    if (!pendingFlush.hasBuffersForPutBlock()) {
+      if (!close && !(sync && putBlockWithoutRaft)) {
+        return;
+      }
+      executePutBlock(null, sync, close);
+      return;
+    }
+    executePutBlock(pendingFlush.seal(), sync, close);
+  }

Review Comment:
   Thank you for the review! I agree with your approach. Applied the following:
   - Moved writtenDataLength and totalDataFlushedLength back onto 
`BlockDataStreamOutput`.
   - Dropped FlushBatch, seal(), and the 3-arg executePutBlock.
   - Moved chunk-future wait/clear into PendingFlush.waitForChunkFutures();
   - Split addChunk() in `PendingFlush` into addBuffer() and addChunkFuture() 
so that it helps matching master’s ordering instead of bundling both in 
addChunk().
   
   When you have a chance, please take another look. 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