-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 when using embedded Kafka broker for tests #3557
Comments
@dlyash The tests we have in the framework for transactions that use |
@sobychacko A few lines in the documentation surely won't hurt. Technically it's already documented in Kafka's own documentation:
But I bet 99% of developers will only look for them once running into the issue and then will end up on the StackOverflow anyway. As a developer, I would appreciate the testing framework taking care of it for me. That's why I was suggesting the programmatic solution.
Oh, is it? I didn't dive too deep into the code, but I was imagining something like this in the properties.putIfAbsent("transaction.state.log.replication.factor", Math.min(embeddedKafka.count(), 3)); |
Ok, you can give it a try and see if that works and is stable. If so, feel free to submit a PR. Thanks! |
I created fix PR #3602~! |
…eddedkafka Fixes: #3557 #3557 * Adjust the replication factor for the transaction state topic on `EmbeddedKafka` based on the broker count in `EmbeddedKafka`. * Keep the default replication factor of 3. * Adding tests to verify
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 amin(<number-of-brokers>, 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:Context
It's not a big deal, as it can be resolved by explicitly setting broker properties like follows. But a meaningful default would save some time for thousands of developers googling the problem again and again.
The text was updated successfully, but these errors were encountered: