AHeise commented on a change in pull request #12353:
URL: https://github.com/apache/flink/pull/12353#discussion_r432967285



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/BroadcastRecordWriter.java
##########
@@ -130,7 +132,7 @@ public BufferBuilder requestNewBufferBuilder(int 
targetChannel) throws IOExcepti
 
                BufferBuilder builder = 
super.requestNewBufferBuilder(targetChannel);
                if (randomTriggered) {
-                       addBufferConsumer(builder.createBufferConsumer(), 
targetChannel);
+                       addBufferConsumer(randomConsumer = 
builder.createBufferConsumer(), targetChannel);

Review comment:
       Alternatively, we "just" need to add a specific API that copies a 
`BufferConsumer` but set the positionMarker to that of a given `BufferBuilder`.
   
   ```
        public BufferConsumer copyAndSync(BufferBuilder builder) {
                return new BufferConsumer(buffer.retainBuffer(), 
builder.positionMarker,
                        builder.positionMarker.cachedPosition);
        }
   ```




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

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


Reply via email to