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


##########
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() != null) {

Review Comment:
   Yeah, if the `rollbackState` is set to null, when we are trying to retrieve 
`rollbackState`, that case will get handled in the function `rollbackState()` 
[here](https://github.com/apache/kafka/pull/17965/files#diff-83f8b0eae4289cefc39e38e4b85e64d49610ceb900eb456285f1ab8d240d9555R2343).
 It will not throw an exception. IIUC, only case when batchRollbackState() can 
throw an exception is if `batchState` is null i.e. the batch is maintained per 
offsets.



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