wombatu-kun commented on code in PR #17925:
URL: https://github.com/apache/iceberg/pull/17925#discussion_r3964297068


##########
kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/channel/CommitState.java:
##########
@@ -102,6 +102,21 @@ void clearResponses() {
     commitBuffer.clear();
   }
 
+  /**
+   * Discard all in-flight commit state -- buffered responses, buffered ready 
events, the readiness
+   * counter, and the current commit id. Used when a control-topic rebalance 
invalidates the commit
+   * this coordinator was assembling; the underlying events remain on the 
control topic and are
+   * re-read by whichever coordinator takes over.
+   *
+   * <p>{@code startTime} is deliberately left alone, so the coordinator 
re-drives the abandoned
+   * commit on its next cycle rather than waiting out another full commit 
interval. That is what we
+   * want when a rebalance interrupted a commit that was already due.
+   */
+  void reset() {
+    clearResponses();

Review Comment:
   Consolidate, and rebase first: #17933 merged `merge(..., Long::max)` into 
this same loop yesterday, so the offset half is already on main and the only 
delta left is skipping dispatch. Its merged `TestChannel` asserts seven 
envelopes dispatched after a two-offset replay, so whichever PR carries the 
skip has to change a committer-approved expectation on purpose - lead with the 
`DataComplete` double-count in `addReady`, which the merge does not fix. On the 
durable side, the only cross-restart floor is the `kafka.connect.offsets` 
summary that `lastCommittedOffsetsForTable` finds by walking snapshot ancestry, 
so expiring that snapshot drops it - separate from both #18006 and this guard.



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