1996fanrui commented on code in PR #27861:
URL: https://github.com/apache/flink/pull/27861#discussion_r3024985308


##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/PipelinedSubpartition.java:
##########
@@ -252,8 +252,21 @@ private boolean processPriorityBuffer(BufferConsumer 
bufferConsumer, int partial
     @GuardedBy("buffers")
     private boolean needNotifyPriorityEvent() {
         assert Thread.holdsLock(buffers);
-        // if subpartition is blocked then downstream doesn't expect any 
notifications
-        return buffers.getNumPriorityElements() == 1 && !isBlocked;
+        // Priority events (e.g. unaligned checkpoint barriers) must notify 
downstream even
+        // when the subpartition is blocked.
+        //
+        // During recovery, once the upstream output channel state is fully 
restored, a
+        // RECOVERY_COMPLETION event (EndOfOutputChannelStateEvent) is 
emitted. This event
+        // blocks the subpartition to prevent the upstream from sending new 
data while the
+        // downstream is still consuming recovered buffers. The subpartition 
remains blocked
+        // until the downstream finishes consuming all recovered buffers from 
every channel
+        // and calls resumeConsumption() to unblock.
+        //
+        // If a checkpoint is triggered while the downstream is still 
consuming recovered
+        // buffers, the upstream receives an unaligned checkpoint barrier and 
adds it to this
+        // blocked subpartition. The barrier must still be delivered to the 
downstream
+        // immediately, otherwise the checkpoint will hang until it times out.
+        return buffers.getNumPriorityElements() == 1;

Review Comment:
   Explaining why  `Priority events (e.g. unaligned checkpoint barriers) must 
notify downstream even when the subpartition is blocked.`



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

Reply via email to