Skip to content

Conversation

RobertIndie
Copy link
Member

Motivation

If the broker doesn't enable the transaction coordinator, the TC client will still be created without returning any error. And when creating the transaction, it will crash here:

return atomic.AddUint64(&tc.epoch, 1) % uint64(len(tc.cons))

This is because the tc.cons will be emtpy.

Modifications

  • Add new error ErrTransactionCoordinatorNotEnabled
  • Return error ErrTransactionCoordinatorNotEnabled if the broker doesn't enable transaction

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API: (yes / no)
  • The schema: (yes / no / don't know)
  • The default values of configurations: (yes / no)
  • The wire protocol: (yes / no)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / GoDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@RobertIndie RobertIndie added this to the v0.13.0 milestone Jul 11, 2024
@RobertIndie RobertIndie self-assigned this Jul 11, 2024
@RobertIndie RobertIndie changed the title Fix the client crash when the transaction coordinator not found [fix] fix the client crash when the transaction coordinator not found Jul 11, 2024
@BewareMyPower BewareMyPower merged commit 64d1e00 into apache:master Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants