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

Lower the replication factor for transactions topic on @EmbeddedKafka Test #3602

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

Dltmd202
Copy link
Contributor

@Dltmd202 Dltmd202 commented Oct 27, 2024

Fixes: #3557

Expected Behavior

It would be nice if the embedded broker started by @embeddedkafka (or the similar JUnit Rule) defaulted the replication factor for the transaction state topic to the number of brokers, or a min(, 3).

Current Behavior
The embedded broker starts with the default configuration of transaction.state.log.replication.factor = 3 which doesn't make sense for a single-broker cluster, which is quite common in tests:

org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 3 larger than available brokers: 1.

Fix

  • When writing test code using EmbeddedKafka, adjust the number of brokers for the transaction topic to the minimum.
  • The topic has been made constant

@pivotal-cla
Copy link

@Dltmd202 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@Dltmd202 Thank you for signing the Contributor License Agreement!

@Dltmd202 Dltmd202 changed the title Lower the replication factor for transactions topic Lower the replication factor for transactions topic on @EmbeddedKafka Test Oct 27, 2024
@sobychacko
Copy link
Contributor

@Dltmd202 There are some checkstyle errors. Can you fix that? In addition to that, could you add your name as the author to all the classes you changed? Thanks!

@Dltmd202 Dltmd202 force-pushed the gh-3557 branch 2 times, most recently from f4b2f0a to 4fe8d90 Compare October 29, 2024 18:28
@Dltmd202
Copy link
Contributor Author

Dltmd202 commented Oct 29, 2024

@sobychacko Of course. I will reflect it right away! Thank you

@sobychacko sobychacko merged commit 3769c24 into spring-projects:main Oct 30, 2024
3 checks passed
@sobychacko
Copy link
Contributor

Thanks for the PR! It is now merged upstream.

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.

Lower the replication factor for transactions topic when using embedded Kafka broker for tests
3 participants