-
Notifications
You must be signed in to change notification settings - Fork 552
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
CreateTopics should return TOPIC_ALREADY_EXISTS if topic name already exists when validate_only is specified #7946
Comments
I can confirm this issue and want to share other invalid configurations that should have been rejected in a dry-run. With Redpanda v23.2.19 I tested:
None of these have returned a validation error, which would have been the expected behaviour. There was only one case where I was able to cause a validation error at all, which was when using a replication factor (e.g. 4). I assume this is the only check when |
Currently working on #15722 and wanted to ask - does anybody know what Kafka returns (for partition count and replication factor specifically) in the
The reason I ask is that several clients discard the configs and numeric parameters in CreateTopic responses, so I'm curious whether the ask here includes detailed introspection of the already-existing topic vs "just give me the right error code". |
Looks like the answer is (3), which I believe is how redpanda behaves already (modulo the error code). If not, it will be very straightforward to reproduce. Here's what I tried, for posterity: $ kcl misc raw-req -k 19
{"Version": 6, "ValidateOnly": true, "TimeoutMillis": 60000, "Topics": [{"Topic": "foobar", "NumPartitions": 1, "ReplicationFactor": 1}]}
{
"Version": 7,
"ThrottleMillis": 0,
"Topics": [
{
"Topic": "foobar",
"TopicID": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"ErrorCode": 36,
"ErrorMessage": "Topic 'foobar' already exists.",
"ConfigErrorCode": 0,
"NumPartitions": -1,
"ReplicationFactor": -1,
"Configs": [],
"UnknownTags": {}
}
],
"UnknownTags": {}
} |
Version & Environment
Redpanda version: (use
rpk version
): 22.3.xWhat went wrong?
When using the Kafka AdminClient to create topics with validate_only, we should return TOPIC_ALREADY_EXISTS if the topic name is already used. This is how it works in Apache Kafka. Unfortunately some ecosystem components use this mechanism to robustly verify if a topic already exists (because in Kafka you cannot guarantee that all brokers know about a topic immediately after it's been created),
What should have happened instead?
Redpanda should return TOPIC_ALREADY_EXISTS. We should probably review the logic to look for other error conditions that might be returned (if they aren't already).
How to reproduce the issue?
Additional information
Please attach any relevant logs, backtraces, or metric charts.
The text was updated successfully, but these errors were encountered: