Skip to content

KAFKA-19003: Add forceTerminateTransaction command to CLI tools #19276

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

Merged

Conversation

rreddy-22
Copy link
Contributor

@rreddy-22 rreddy-22 commented Mar 24, 2025

This patch is part of KIP-939 Support Participation in 2PC

The kafka-transactions.sh tool will support a new command --forceTerminateTransaction It has one required argument --transactionalId that would take the transactional id for the transaction to be terminated.

The command uses the existing Admin#fenceProducers method to forcefully abort the transaction associated with the specified transactional ID. Under the hood, it sends an InitProducerId request to the transaction coordinator with the given transactional ID and keepPreparedTxn = false by default. This is aligned with the functionality outlined in the KIP.

We will be creating a new public method in the Admin Client public TerminateTransactionResult forceTerminateTransaction(String transactionalId), and re-use the existing fence producer method.

@github-actions github-actions bot added triage PRs from the community tools small Small PRs labels Mar 24, 2025
@github-actions github-actions bot added streams clients and removed small Small PRs labels Mar 28, 2025
@rreddy-22 rreddy-22 changed the title KAFKA-19003-Add forceTerminateTransaction command to CLI tools KAFKA-19003: Add forceTerminateTransaction command to CLI tools Mar 31, 2025
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

@github-actions github-actions bot removed the triage PRs from the community label Apr 1, 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.

Thanks!

@jolshan jolshan merged commit eeffd8c into apache:trunk Apr 2, 2025
22 checks passed
janchilling pushed a commit to janchilling/kafka that referenced this pull request Apr 4, 2025
…he#19276)

This patch is part of KIP-939 [Support Participation in
2PC](https://cwiki.apache.org/confluence/display/KAFKA/KIP-939%3A+Support+Participation+in+2PC)

The kafka-transactions.sh tool will support a new command
--forceTerminateTransaction It has one required argument
--transactionalId that would take the transactional id for the
transaction to be terminated.

The command uses the existing Admin#fenceProducers method to forcefully
abort the transaction associated with the specified transactional ID.
Under the hood, it sends an InitProducerId request to the transaction
coordinator with the given transactional ID and keepPreparedTxn = false
by default. This is aligned with the functionality outlined in the KIP.

We will be creating a new public method in the Admin Client **public
TerminateTransactionResult forceTerminateTransaction(String
transactionalId)**, and re-use the existing fence producer method.

Reviewers: Artem Livshits <[email protected]>, Justine Olshan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants