Skip to content

KAFKA-18042: Reject the produce request with lower producer epoch early (KIP-890) #19844

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

rreddy-22
Copy link
Contributor

@rreddy-22 rreddy-22 commented May 28, 2025

With the transaction V2, replica manager checks whether the incoming
producer request produces to a partition belonging to a transaction.
ReplicaManager figures this out by checking the producer epoch stored in
the partition log. However, the current code does not reject the produce
request if its producer epoch is lower than the stored producer epoch.
It is an optimization to reject such requests earlier instead of sending
an AddPartitionToTxn request and getting rejected in the response.

Reviewers: Justine Olshan jolshan@confluent.io, Artem Livshits
alivshits@confluent.io

@github-actions github-actions bot added triage PRs from the community core Kafka Broker storage Pull requests that target the storage module small Small PRs labels May 28, 2025
@jolshan jolshan added ci-approved and removed triage PRs from the community labels May 28, 2025
Copy link
Member

@jolshan jolshan left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me. Let's make sure all the tests look 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

@jolshan jolshan merged commit cc25d21 into apache:trunk Jun 4, 2025
26 checks passed
Mirai1129 pushed a commit to Mirai1129/kafka that referenced this pull request Jun 5, 2025
…ly (KIP-890) (apache#19844)

With the transaction V2, replica manager checks whether the incoming
producer request produces to a partition belonging to a transaction.
ReplicaManager figures this out by checking the producer epoch stored in
the partition log. However, the current code does not reject the produce
request if its producer epoch is lower than the stored producer epoch.
It is an optimization to reject such requests earlier instead of sending
an AddPartitionToTxn request and getting rejected in the response.

Reviewers: Justine Olshan <jolshan@confluent.io>, Artem Livshits
 <alivshits@confluent.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-approved core Kafka Broker small Small PRs storage Pull requests that target the storage module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants