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


##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java:
##########
@@ -435,17 +427,18 @@ public void watchForCommit(boolean bufferFull) throws 
IOException {
   public void executePutBlock(boolean sync, boolean close) throws IOException {
     checkOpen();
     long flushPos = totalDataFlushedLength;
+    final PendingFlush flush = pendingFlush;
+    pendingFlush = new PendingFlush();
     final List<StreamBuffer> byteBufferList;
-    if (buffersForPutBlock != null) {
+    if (flush.hasBuffersForPutBlock()) {
       Objects.requireNonNull(bufferList, "bufferList == null");
-      byteBufferList = buffersForPutBlock;
-      buffersForPutBlock = null;
+      byteBufferList = flush.consumeBuffersForPutBlock();
       Objects.requireNonNull(byteBufferList, "byteBufferList == null");
     } else {
       // no data was written since the most recent putBlock
       byteBufferList = null;
     }
-    waitFuturesComplete();
+    waitFuturesComplete(flush);

Review Comment:
   That is a good catch! Fixed it and added the test.



-- 
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