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


##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -643,7 +643,7 @@ public ShareAcquiredRecords acquire(
                         // acquire subset of offsets from the in-flight batch 
but only if the
                         // complete batch is available yet. Hence, do a 
pre-check to avoid exploding
                         // the in-flight offset tracking unnecessarily.
-                        if (inFlightBatch.batchState() != 
RecordState.AVAILABLE) {
+                        if (inFlightBatch.batchState() != 
RecordState.AVAILABLE || inFlightBatch.batchRollbackState() == 
RecordState.ACQUIRED) {

Review Comment:
   Hi @AndrewJSchofield , although the original change would have worked 
because we only do a commit from `ACQUIRED -> ACKNOWLEDGED` or `ACQUIRED -> 
AVAILABLE` or `ACQUIRED -> ARCHIVED` during `completeStateTransition`, but I 
think the change to check from ACQUIRED to null will help in future code 
extension, hence made the change as adviced. Same for the below 2 comments as 
well



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