apoorvmittal10 commented on code in PR #19430: URL: https://github.com/apache/kafka/pull/19430#discussion_r2039566989
########## core/src/main/java/kafka/server/share/SharePartition.java: ########## @@ -1011,6 +1011,8 @@ private Optional<Throwable> releaseAcquiredRecordsForPerOffsetBatch(String membe return Optional.empty(); } if (offsetState.getValue().state == RecordState.ACQUIRED) { + // These records were fetched but they were not actually delivered to the client. + offsetState.getValue().tryReleaseDeliveryCount(); Review Comment: So instead of creating another method to do this, should we enhance the API `startStateTransition` and `startBatchStateTransition` to decrement the deliveryCount on release? I added the `incrementDeliveryCount` boolean to tackle the situation but seems we are missing the right behaviour while releasing. The state transition should be done within a transaction and not independently. -- 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