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


##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -1799,6 +1793,10 @@ private Optional<Throwable> acknowledgeBatchRecords(
                     if (throwable.isPresent()) {
                         return throwable;
                     }
+
+                    if (inFlightBatch.batchHasOngoingStateTransition()) {
+                        return Optional.of(new 
InvalidRecordStateException("The batch has on-going acknowledgement."));

Review Comment:
   Done both.



##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -1899,7 +1897,15 @@ private Optional<Throwable> 
acknowledgePerOffsetBatchRecords(
                             + " partition: {}-{}", offsetState.getKey(), 
inFlightBatch, groupId,
                         topicIdPartition);
                     return Optional.of(new InvalidRecordStateException(
-                        "The batch cannot be acknowledged. The offset is not 
acquired."));
+                        "The offset cannot be acknowledged. The offset is not 
acquired."));
+                }
+
+                if (offsetState.getValue().hasOngoingStateTransition()) {
+                    log.debug("The offset has on-going transition, offset: {} 
batch: {} for the share"
+                            + " partition: {}-{}", offsetState.getKey(), 
inFlightBatch, groupId,
+                        topicIdPartition);
+                    return Optional.of(new InvalidRecordStateException(
+                        "The offset cannot be acknowledged. The offset has 
on-going acknowledgement."));

Review Comment:
   Done.



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