apoorvmittal10 commented on code in PR #19430:
URL: https://github.com/apache/kafka/pull/19430#discussion_r2055767896


##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -3003,24 +3014,32 @@ private boolean hasOngoingStateTransition() {
          * if the state update is unsuccessful.
          *
          * @param newState The new state of the records.
-         * @param incrementDeliveryCount Whether to increment the delivery 
count.
+         * @param ops      The behavior on the delivery count.
          *
          * @return {@code InFlightState} if update succeeds, null otherwise. 
Returning state
          *         helps update chaining.
          */
-        private InFlightState tryUpdateState(RecordState newState, boolean 
incrementDeliveryCount, int maxDeliveryCount, String newMemberId) {
+        private InFlightState tryUpdateState(RecordState newState, 
DeliveryCountOps ops, int maxDeliveryCount, String newMemberId) {
+            boolean decreaseFlag = false;
             try {
+                if (ops == DeliveryCountOps.DECREASE && newState != 
RecordState.ARCHIVED) {
+                    deliveryCount--;

Review Comment:
   So will it be correct to change below check to following, and the later 
change the delivery count accordingly?
   ```
                   if (newState == RecordState.AVAILABLE && ops != 
DeliveryCountOps.DECREASE && deliveryCount >= maxDeliveryCount) {
                       newState = RecordState.ARCHIVED;
                   }



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to