Open vereshchagin-d opened 5 hours ago
Hi @mostafa,
Thank you for your work on the xk6-kafka project—it’s been incredibly useful for our Kafka-related testing needs.
I’ve encountered an issue when trying to create a topic with replicaAssignments and have provided a detailed report [above/in this issue]. It seems like the library sets default values for NumPartitions and ReplicationFactor even when replicaAssignments is provided, which contradicts Kafka’s protocol.
Would you be able to take a look when you have time? I’ve included links to relevant Kafka documentation and test cases from kafka-go library to help clarify the context.
Let me know if there’s any additional information I can provide or steps I can take to assist. Thanks again for maintaining this project!
Best regards, Dmitriy
Hey @vereshchagin-d,
Looks like a bug. Would you please create a PR to fix this?
Hi!
Environment:
3.7.0
running in Kubernetesmostafamoradian/xk6-kafka:0.28.0
Description: I'm encountering an issue when trying to create a topic with
replicaAssignments
. Below is the code snippet used:The error message I receive is:
Observations: Upon checking the code, I noticed that in this section of the source code, default values for NumPartitions and ReplicationFactor are set to 1 if they are <= 0.
This behavior seems incorrect when using
replicaAssignments
sinceNumPartitions
andReplicationFactor
should be inferred from thereplicaAssignments
field according to the Kafka protocol.References:
Suggested Fix: The library should allow
NumPartitions
andReplicationFactor
to remain unset or explicitly-1
whenreplicaAssignments
is provided. This would align the behavior with Kafka’s protocol and similar libraries.