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


##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -1225,7 +1225,7 @@ private int acquireSubsetBatchRecords(
                     break;
                 }
 
-                if (offsetState.getValue().state != RecordState.AVAILABLE) {
+                if (offsetState.getValue().state != RecordState.AVAILABLE || 
offsetState.getValue().rollbackState() == RecordState.ACQUIRED) {

Review Comment:
   I think that really it's the presence of a rollback state at all, and not 
whether it would roll back to ACQUIRED which is interesting. The test purpose 
of the complete test is to see whether the batch is unencumbered.



##########
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:
   I think that really it's the presence of a rollback state at all, and not 
whether it would roll back to ACQUIRED which is interesting. The test purpose 
of the complete test is to see whether the batch is unencumbered.



##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -662,7 +662,7 @@ public ShareAcquiredRecords acquire(
                 }
 
                 // The in-flight batch is a full match hence change the state 
of the complete batch.
-                if (inFlightBatch.batchState() != RecordState.AVAILABLE) {
+                if (inFlightBatch.batchState() != RecordState.AVAILABLE || 
inFlightBatch.batchRollbackState() == RecordState.ACQUIRED) {

Review Comment:
   I think that really it's the presence of a rollback state at all, and not 
whether it would roll back to ACQUIRED which is interesting. The test purpose 
of the complete test is to see whether the batch is unencumbered.



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