kafka icon indicating copy to clipboard operation
kafka copied to clipboard

Fix IllegalStateException for Transaction Producer

Open k-raina opened this issue 10 months ago • 2 comments

Current Behavior:

  • When a batch fails with a fatal error (e.g., ProducerFencedException), the TM transitions to FATAL state
  • However, subsequent batches that fail can still trigger state transitions through code path Sender.failBatch -> TM.handleFailedBatch > TM.maybeTransitionToErrorState
  • This means that even after entering FATAL state, other batches could potentially transition the TM to ABORTABLE state

Example Scenario:

Batch 1 fails with ProducerFencedException
  ↓
TM transitions to FATAL state
  ↓
Batch 2 fails with UnknownProducerIdException
  ↓
TM incorrectly transitions to ABORTABLE state (this is the bug)

k-raina avatar Mar 13 '25 17:03 k-raina

A label of 'needs-attention' was automatically added to this PR in order to raise the attention of the committers. Once this issue has been triaged, the triage label should be removed to prevent this automation from happening again.

github-actions[bot] avatar Mar 21 '25 03:03 github-actions[bot]

This PR is being marked as stale since it has not had any activity in 90 days. If you would like to keep this PR alive, please leave a comment asking for a review. If the PR has merge conflicts, update it with the latest from the base branch.

If you are having difficulty finding a reviewer, please reach out on the [mailing list](https://kafka.apache.org/contact).

If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.

github-actions[bot] avatar Jun 19 '25 03:06 github-actions[bot]

A label of 'needs-attention' was automatically added to this PR in order to raise the attention of the committers. Once this issue has been triaged, the triage label should be removed to prevent this automation from happening again.

github-actions[bot] avatar Jun 21 '25 03:06 github-actions[bot]

@jolshan—can you review this PR? Thanks 😄

kirktrue avatar Aug 05 '25 16:08 kirktrue

@k-raina—can you push an empty commit to this branch so it triggers a build? Thanks!

kirktrue avatar Aug 05 '25 16:08 kirktrue

@k-raina—Also, can you mark it as "ready to review?" I just realized it's still in draft mode.

kirktrue avatar Aug 05 '25 16:08 kirktrue

A label of 'needs-attention' was automatically added to this PR in order to raise the attention of the committers. Once this issue has been triaged, the triage label should be removed to prevent this automation from happening again.

github-actions[bot] avatar Aug 07 '25 03:08 github-actions[bot]

This PR is being marked as stale since it has not had any activity in 90 days. If you would like to keep this PR alive, please leave a comment asking for a review. If the PR has merge conflicts, update it with the latest from the base branch.

If you are having difficulty finding a reviewer, please reach out on the [mailing list](https://kafka.apache.org/contact).

If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.

github-actions[bot] avatar Nov 05 '25 03:11 github-actions[bot]

A label of 'needs-attention' was automatically added to this PR in order to raise the attention of the committers. Once this issue has been triaged, the triage label should be removed to prevent this automation from happening again.

github-actions[bot] avatar Nov 07 '25 03:11 github-actions[bot]