-
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
Return accurate partition count and replication factor in CreateTopics response #16410
Return accurate partition count and replication factor in CreateTopics response #16410
Conversation
/dt |
8882459
to
44f8e9a
Compare
new failures in https://buildkite.com/redpanda/redpanda/builds/44558#018d61b4-0b8e-40e9-be5a-8fd15fe69f8d:
new failures in https://buildkite.com/redpanda/redpanda/builds/44558#018d6558-10ae-4a38-8f18-e619bf5cf974:
|
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/44558#018d61b8-a014-45c1-9fd5-c827b0f20751 |
CI Failure:
|
Specifically we noticed that cleanup.policy was populated with a stringified int in CreateTopics results. We implement formatters for several topic config types, so we should use them. Using e.g. "delete" for the cleanup policy value (rather than "1") matches the behavior of Apache Kafka. Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
44f8e9a
to
ba3b786
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just clean up the assert messages and we're gucci. Thanks!
ba3b786
to
8b6dc85
Compare
force push contents
|
@graphcareful @michael-redpanda - Sorry, needs a bit more review. Pulled in the commits for #7946 because the scope of the changes became much smaller but the DT tests are still dependent on this one landing. |
To amend create_topics responses with the partition count and replication factor of the created (or already existing) topic. Values pulled from metadata cache (similar to append_topic_configs) Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
- If the topic already exists, use that return code (36) - If the topic does not exist, return the partition count and replication factor from the request. - Responses now match Apache Kafka
Adapter for raw_create_topics that takes a list of client-supplied dicts, packs them up in raw requests, and issues a create request. Loads the result into a dict, extracts 'Topics' field, and returns the result (or empty list if something went wrong). Also adds a validate_only bool param to raw_create_topics Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
Test for correct config serialization and treatment of specific and defaulted partition count and replication factor values in responses. Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
In `CreateTopicsResponseTest`.
8b6dc85
to
0654662
Compare
force push remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, just one question
result.num_partitions = t.num_partitions; | ||
result.replication_factor = t.replication_factor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: just to confirm, if the topic already exists, we do not return that topics partition count or RF?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. That's what the latest Kafka does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/backport v23.3.x |
/backport v23.2.x |
/backport v23.1.x |
Failed to create a backport PR to v23.1.x branch. I tried:
|
This commit makes some changes to the create_topics path to ensure that partition count and replication factor of created (or already existing) topics are correctly populated in responses.
Includes a small change to ensure that topic configs are serialized correctly with respect to existing formatters (e.g. the default cleanup.policy should appear in create topics results as "delete" where previously it was "1").
Fixes #15722
Fixes #7946
Backports Required
Release Notes
Bug Fixes