-
Notifications
You must be signed in to change notification settings - Fork 11.9k
[ISSUE #4263]Delete topic route info based on cluster when delete topic. #4268
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
[ISSUE #4263]Delete topic route info based on cluster when delete topic. #4268
Conversation
Is the purpose of this pr to support multiple clusterNames? |
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.
In DeleteTopicSubCommand, The parameter 'clusterName' is mandatory. So deleting a topic with the parameters 'topic' and 'clusterName' is clear.
DeleteTopicSubCommand should delete topic route info based on clusterName in nameserver. But the processing logic of nameserver is deleting all the topic route info in topicQueueTable before updating the code. @lwclover |
This is an administrative command. In my opion, You don't have to write compatibility code. |
Codecov Report
@@ Coverage Diff @@
## develop #4268 +/- ##
=============================================
+ Coverage 47.90% 48.04% +0.14%
- Complexity 5001 5065 +64
=============================================
Files 633 642 +9
Lines 42523 42790 +267
Branches 5573 5604 +31
=============================================
+ Hits 20371 20559 +188
- Misses 19654 19707 +53
- Partials 2498 2524 +26
Continue to review full report at Codecov.
|
namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java
Show resolved
Hide resolved
namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java
Show resolved
Hide resolved
namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java
Show resolved
Hide resolved
2.move the judgment of whether there are any key-value pairs in queueDataMap out of the for loop
The new method need testcase. |
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.
Hi, @sunxi92 , IMO, compatibility needs to be considered here. If clusterName exists, delete it based on the clusterName. Otherwise, delete the whole topic. Otherwise, there will be issues with older versions of the admin tool or console calls.
@sunxi92 I'm sorry I told you I removed the compatibility code. |
done! |
…ic. (apache#4268) * Delete topic route info based on cluster when delete topic. * Delete useless compatibility code. * 1.add a non-null judgment to queueDataMap 2.move the judgment of whether there are any key-value pairs in queueDataMap out of the for loop * When clusterName is null, then delete topic route info in namesrv.
…ic. (apache#4268) * Delete topic route info based on cluster when delete topic. * Delete useless compatibility code. * 1.add a non-null judgment to queueDataMap 2.move the judgment of whether there are any key-value pairs in queueDataMap out of the for loop * When clusterName is null, then delete topic route info in namesrv.
#4263