KAFKA-19003-Add forceTerminateTransaction command to CLI tools #19276
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The only difference is that we WON'T be creating a new public method in the Admin Client public TerminateTransactionResult forceTerminateTransaction(String transactionalId), to re-use existing the existing fence producer method.