Skip to content
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

KAFKA-18660: Transactions Version 2 doesn't handle epoch overflow correctly #18730

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

jolshan
Copy link
Member

@jolshan jolshan commented Jan 28, 2025

Fixed the typo that used the wrong producer ID and epoch when returning so that we handle epoch overflow correctly.

We also had to rearrange the concurrent transaction handling so that we don't self-fence when we start the new transaction with the new producer ID.

I also tested this with a modified version of the code where epoch overflow happens on the first epoch bump (every request has a new producer id)

@github-actions github-actions bot added core Kafka Broker tests Test fixes (including flaky tests) small Small PRs labels Jan 28, 2025
@github-actions github-actions bot removed the small Small PRs label Jan 29, 2025
@jolshan jolshan added Blocker This pull request is identified as solving a blocker for a release. transactions Transactions and EOS labels Jan 29, 2025
@jolshan jolshan marked this pull request as ready for review January 29, 2025 00:14
@@ -408,13 +408,13 @@ class TransactionCoordinator(txnConfig: TransactionConfig,

// generate the new transaction metadata with added partitions
txnMetadata.inLock {
if (txnMetadata.producerId != producerId) {
if (txnMetadata.pendingTransitionInProgress) {
// return a retriable exception to let the client backoff and retry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment here that explains the significance of ordering this check prior to others?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. 👍

Copy link
Contributor

@artemlivshits artemlivshits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocker This pull request is identified as solving a blocker for a release. core Kafka Broker tests Test fixes (including flaky tests) transactions Transactions and EOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants