apoorvmittal10 commented on code in PR #17965:
URL: https://github.com/apache/kafka/pull/17965#discussion_r1869340698
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -2007,7 +2006,7 @@ private void
releaseAcquisitionLockOnTimeoutForCompleteBatch(InFlightBatch inFli
updateResult.state.id, (short)
updateResult.deliveryCount));
// Update acquisition lock timeout task for the batch to null
since it is completed now.
Review Comment:
Can you please correct the comment in both places since we have changed the
code here now.
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -2332,12 +2330,24 @@ String memberId() {
return memberId;
}
+ private RecordState rollbackState() {
+ if (rollbackState == null) {
+ // This case could occur when the batch/offset hasn't
transitioned even once or the state transitions have
+ // been committed.
+ return null;
+ }
+ return rollbackState.state;
+ }
+
// Visible for testing.
TimerTask acquisitionLockTimeoutTask() {
return acquisitionLockTimeoutTask;
}
- void updateAcquisitionLockTimeoutTask(AcquisitionLockTimerTask
acquisitionLockTimeoutTask) {
+ void updateAcquisitionLockTimeoutTask(AcquisitionLockTimerTask
acquisitionLockTimeoutTask) throws IllegalStateException {
+ if (this.acquisitionLockTimeoutTask != null) {
+ throw new IllegalStateException("The acquisition lock timeout
task is being overridden");
Review Comment:
My question was on the error message, I didn't get that.
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -2346,6 +2347,19 @@ void cancelAndClearAcquisitionLockTimeoutTask() {
acquisitionLockTimeoutTask = null;
}
+ private RecordState rollbackState() {
+ if (rollbackState == null) {
+ // This case could occur when the batch/offset hasn't
transitioned even once or the state transitions have
+ // been committed.
+ return null;
+ }
+ return rollbackState.state;
+ }
Review Comment:
Do we need this method or should incorporate the change in
`hasOngoingStateTransition`? Why to have this addiitonal logic which is
confusing anyways in this method.
--
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]