Skip to content
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

feat: better error message when transaction to command topic fails to initialize by timeout #4486

Conversation

stevenpyzhang
Copy link
Member

Description

Addresses #4453

Moved transactionalProducer.initTransactions() out of the same try catch block as the rest of the transaction operations.
Added more specific error message. (added as a pluggable one for scenarios where it doesn't make sense to advise the user to set their Kafka configs)

This isn't ideal currently as there are other reasons for a TimeoutException to be returned from initTransaction but until https://issues.apache.org/jira/browse/KAFKA-9511 is worked on, I think this is the best we can do.

Testing done

Unit test
Spun up a Kafka without setting the required configs, got the error message when issuing a DDL to the server.

ksql> CREATE STREAM source_ab (myFixedField1 varchar, eventPayload varchar) WITH (kafka_topic='topic_a', PARTITIONS = 1, value_format='json');
Timeout while initializing transaction to the KSQL command topic.
If you're running a single Kafka broker, ensure that the following Kafka configs are set to 1:
- transaction.state.log.replication.factor
- transaction.state.log.min.isr
- offsets.topic.replication.factor

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@stevenpyzhang stevenpyzhang requested a review from a team as a code owner February 7, 2020 18:53
@stevenpyzhang stevenpyzhang force-pushed the kafka-misconfigured-transactions branch from 58e9184 to 5aea0c5 Compare February 7, 2020 19:02
@stevenpyzhang stevenpyzhang force-pushed the kafka-misconfigured-transactions branch from 5aea0c5 to 72ecd00 Compare February 7, 2020 21:07
Copy link
Contributor

@agavra agavra left a comment

Choose a reason for hiding this comment

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

LGTM! Nice error message

@stevenpyzhang stevenpyzhang merged commit a5fed3b into confluentinc:master Feb 7, 2020
@rmoff
Copy link
Member

rmoff commented Feb 10, 2020

Thanks for fixing this. One small comment:

If you're running a single Kafka broker, ensure that the following Kafka configs are set to 1:

Might be slightly better (less ambiguously) worded:

If you're running a single Kafka broker, ensure that the following configs are set to 1 on the broker:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants