Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

[DON'T MERGE] Fix CreateTopics and DeleteTopics requests#598

Closed
BewareMyPower wants to merge 2 commits intobranch-2.7.2from
bewaremypower/branch-2.7.2-admin-fix
Closed

[DON'T MERGE] Fix CreateTopics and DeleteTopics requests#598
BewareMyPower wants to merge 2 commits intobranch-2.7.2from
bewaremypower/branch-2.7.2-admin-fix

Conversation

@BewareMyPower
Copy link
Copy Markdown
Collaborator

@BewareMyPower BewareMyPower commented Jun 29, 2021

This PR tries to cherry-pick #348 and #592 to branch-2.7.2.

dockerzhang and others added 2 commits June 29, 2021 15:57
Fixes #591

Kafka Connect use `Admin#createTopics` and check the `TopicExistsException` exception for existed topics. See https://github.com/apache/kafka/blob/ef3cd68c852daf21d8e207fa8e21c8770f4041d7/connect/runtime/src/main/java/org/apache/kafka/connect/util/TopicAdmin.java#L394 for details.

However, currently `Admin#createTopics` will return an `UnknownServerException` for any failure when create topics. In addition, the handler for CreateTopics request has other problems.

1. The default partition number (-1) is not handled, which may throw exception from `createPartitionedTopicAsync`.
2. If topic name is invalid, the future won't be completed until timeout. See #361, TimeoutException will be thrown in this case.

1. When the topic to create already exists, return a `TopicExistsException`.
2. Add a `tryComplete` method to complete a future of topic creation that may also complete the future of response.
3. Add related tests.

=====
* Fix some bugs for create topic request
* Fix KStreamAggregationTest
* Catch KoPTopicException instead of RuntimeException
@BewareMyPower
Copy link
Copy Markdown
Collaborator Author

OffsetFinderTest is broken.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants