-
Notifications
You must be signed in to change notification settings - Fork 14.7k
KAFKA-19690: Cherry Pick to 4.0 #20607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…t unexpected fatal error (apache#20534) We are seeing cases where a Kafka Streams (KS) thread stalls for ~20 seconds. During this stall, the broker correctly aborts the open transaction (triggered by the 10-second transaction timeout). However, when the KS thread resumes, instead of receiving the expected InvalidProducerEpochException (which we already handle gracefully as part of transaction abort), the client is instead hit with an InvalidTxnStateException. KS currently treats this as a fatal error, causing the application to fail. To fix this, we've added an epoch check before the verification check to send the recoverable InvalidProducerEpochException instead of the fatal InvalidTxnStateException. This helps safeguard both tv1 and tv2 clients Reviewers: Justine Olshan <[email protected]>
@rreddy-22 Could you please open PR for 4.2 as well? I try to cherry-pick it but there are some conflicts :( |
4.1 |
Yes, I was going in order so will raise that PR next! Haha yeah there are quite a few conflicts #20618 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rreddy-22 Thanks for the backport. The formatting looks mostly good, but a few of the changes seems a little strange. Could you double-check them?
currentTxnStartOffset: Option[Long], | ||
coordinatorEpoch: Option[Int] | ||
): Unit = { | ||
producerId: Long, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind reverting this? I think it was accidentally done by the auto-formatter. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah ugh it's the auto formatter
Can we get the change isolated without the formatting changes? |
Cherry-pick changes (#20534) to 4.0
Conflicts:
-> storage/src/main/java/org/apache/kafka/storage/internals/log/UnifiedLog.java - kept the file the same, and the rest of the code is in UnifiedLog.scala in 4.0 so added it there
-> core/src/test/scala/unit/kafka/log/UnifiedLogTest.scala - just added the required test and kept everything else the same
Reviewers: Justine Olshan [email protected], Chia-Ping Tsai [email protected]