rkhachatryan commented on a change in pull request #11507: [FLINK-16587] Add 
basic CheckpointBarrierHandler for unaligned checkpoint
URL: https://github.com/apache/flink/pull/11507#discussion_r407984986
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/RemoteInputChannel.java
 ##########
 @@ -523,15 +557,18 @@ public void onBuffer(Buffer buffer, int sequenceNumber, 
int backlog) throws IOEx
                                        return;
                                }
 
-                               if (expectedSequenceNumber != sequenceNumber) {
-                                       onError(new 
BufferReorderingException(expectedSequenceNumber, sequenceNumber));
-                                       return;
-                               }
-
                                wasEmpty = receivedBuffers.isEmpty();
                                receivedBuffers.add(buffer);
-                               recycleBuffer = false;
+
+                               if (hasListener) {
+                                       if (buffer.isBuffer() && 
receivedCheckpointId < lastRequestedCheckpointId) {
+                                               notifyReceivedBuffer = 
buffer.retainBuffer();
+                                       } else {
+                                               notifyReceivedBarrier = 
parseCheckpointBarrierOrNull(buffer);
 
 Review comment:
   Could this parsing be done outside of the `synchronized` block? (I assume it 
is relatively slow).
   
   This would also simplify code as we wouldn't need to declare 
`notifyReceivedBarrier` in advance.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to