adixitconfluent commented on code in PR #20286:
URL: https://github.com/apache/kafka/pull/20286#discussion_r2247766259


##########
server/src/main/java/org/apache/kafka/server/share/fetch/InFlightState.java:
##########
@@ -190,13 +224,22 @@ public InFlightState startStateTransition(RecordState 
newState, DeliveryCountOps
      * @param commit If true, commits the state transition, otherwise rolls 
back.
      */
     public void completeStateTransition(boolean commit) {
-        if (commit) {
+        if (commit || isTerminalState()) {
+            // Cancel the acquisition lock timeout task for the state since it 
is acknowledged/released successfully.
+            cancelAndClearAcquisitionLockTimeoutTask();
             rollbackState = null;
             return;
         }
-        state = rollbackState.state;
-        deliveryCount = rollbackState.deliveryCount;
-        memberId = rollbackState.memberId;
+        // Check is acquisition lock timeout task is expired then mark the 
message as Available.
+        if (acquisitionLockTimeoutTask != null && 
acquisitionLockTimeoutTask.hasExpired()) {
+            state = RecordState.AVAILABLE;

Review Comment:
   I think we need a check on DeliveryCount here



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