You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/06/28 06:22:43 UTC

[GitHub] [rocketmq] cserwen opened a new pull request, #4523: [ISSUE #4522] Fix topic route info not found in some case

cserwen opened a new pull request, #4523:
URL: https://github.com/apache/rocketmq/pull/4523

   **Make sure set the target branch to `develop`**
   
   ## What is the purpose of the change
   
   Fix #4522 
   
   ## Brief changelog
   
   XX
   
   ## Verifying this change
   
   XXXX
   
   Follow this checklist to help us incorporate your contribution quickly and easily. Notice, `it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR`.
   
   - [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue. 
   - [x] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in [test module](https://github.com/apache/rocketmq/tree/master/test).
   - [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn clean test-compile failsafe:integration-test`  to make sure integration-test pass.
   - [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] Oliverwqcwrw commented on a diff in pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
Oliverwqcwrw commented on code in PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#discussion_r912667358


##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java:
##########
@@ -156,6 +156,10 @@ public RegisterBrokerResult registerBroker(
 
                 BrokerData brokerData = this.brokerAddrTable.get(brokerName);
                 if (null == brokerData) {
+                    if (topicConfigWrapper.getTopicConfigTable().size() == 1) {

Review Comment:
   I think it is better to judge Greater than or equal to 1, `topicConfigTable` maybe greater than 1 when batch send message



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] tsunghanjacktsai commented on a diff in pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
tsunghanjacktsai commented on code in PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#discussion_r909160077


##########
store/src/test/java/org/apache/rocketmq/store/dledger/DLedgerMultiPathTest.java:
##########
@@ -46,8 +46,8 @@ public void multiDirsStorageTest() throws Exception {
             DefaultMessageStore dLedgerStore = createDLedgerMessageStore(base, group, "n0", peers, multiStorePath, null);
             Thread.sleep(2000);
             doPutMessages(dLedgerStore, topic, 0, 1000, 0);
-            Assert.assertEquals(11, dLedgerStore.getMaxPhyOffset()/dLedgerStore.getMessageStoreConfig().getMappedFileSizeCommitLog());
             Thread.sleep(500);
+            Assert.assertEquals(11, dLedgerStore.getMaxPhyOffset()/dLedgerStore.getMessageStoreConfig().getMappedFileSizeCommitLog());

Review Comment:
   Nice change here. I guess this is something that causes our CI to fail sometimes. Hope it works. How about making this a separate PR so that we could maybe merge it faster?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] cserwen commented on a diff in pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
cserwen commented on code in PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#discussion_r912669309


##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java:
##########
@@ -156,6 +156,10 @@ public RegisterBrokerResult registerBroker(
 
                 BrokerData brokerData = this.brokerAddrTable.get(brokerName);
                 if (null == brokerData) {
+                    if (topicConfigWrapper.getTopicConfigTable().size() == 1) {

Review Comment:
   I think this has nothing to do with sending messages. This is just when a topic is created, the broker will register the topic's routing information with namesrv, and it will only be 1. When the broker is fully registered, the size must be greater than 1, because the number of system topics has exceeded 1, right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] cserwen commented on pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
cserwen commented on PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#issuecomment-1207861660

   @duhenglucky ping~


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] cserwen commented on a diff in pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
cserwen commented on code in PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#discussion_r912691981


##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java:
##########
@@ -156,6 +156,10 @@ public RegisterBrokerResult registerBroker(
 
                 BrokerData brokerData = this.brokerAddrTable.get(brokerName);
                 if (null == brokerData) {
+                    if (topicConfigWrapper.getTopicConfigTable().size() == 1) {

Review Comment:
   > Are you primarily trying to solve the problem of not being able to create a topic before first registering the broker
   
   I describe the current problem in detail in the issue. If someone creates a topic before the broker first registers with a new namesrv, the broker's first registration will fail. The registration can only be completed when the data version of TopicConfigManager is changed.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] codecov-commenter commented on pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#issuecomment-1172041270

   # [Codecov](https://codecov.io/gh/apache/rocketmq/pull/4523?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#4523](https://codecov.io/gh/apache/rocketmq/pull/4523?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3c5c6e3) into [develop](https://codecov.io/gh/apache/rocketmq/commit/364494166daec2711455aa0768990997eb692d8e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3644941) will **decrease** coverage by `0.22%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #4523      +/-   ##
   =============================================
   - Coverage      48.16%   47.93%   -0.23%     
   + Complexity      5125     5101      -24     
   =============================================
     Files            649      649              
     Lines          43026    43056      +30     
     Branches        5624     5633       +9     
   =============================================
   - Hits           20723    20639      -84     
   - Misses         19801    19895      +94     
   - Partials        2502     2522      +20     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/4523?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...tmq/namesrv/processor/DefaultRequestProcessor.java](https://codecov.io/gh/apache/rocketmq/pull/4523/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bmFtZXNydi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvbmFtZXNydi9wcm9jZXNzb3IvRGVmYXVsdFJlcXVlc3RQcm9jZXNzb3IuamF2YQ==) | `64.43% <0.00%> (-9.09%)` | :arrow_down: |
   | [...e/rocketmq/namesrv/routeinfo/RouteInfoManager.java](https://codecov.io/gh/apache/rocketmq/pull/4523/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bmFtZXNydi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvbmFtZXNydi9yb3V0ZWluZm8vUm91dGVJbmZvTWFuYWdlci5qYXZh) | `78.01% <0.00%> (-0.82%)` | :arrow_down: |
   | [...rg/apache/rocketmq/common/stats/StatsSnapshot.java](https://codecov.io/gh/apache/rocketmq/pull/4523/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vc3RhdHMvU3RhdHNTbmFwc2hvdC5qYXZh) | `84.61% <0.00%> (-15.39%)` | :arrow_down: |
   | [...org/apache/rocketmq/common/stats/StatsItemSet.java](https://codecov.io/gh/apache/rocketmq/pull/4523/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vc3RhdHMvU3RhdHNJdGVtU2V0LmphdmE=) | `41.79% <0.00%> (-13.44%)` | :arrow_down: |
   | [.../apache/rocketmq/common/stats/MomentStatsItem.java](https://codecov.io/gh/apache/rocketmq/pull/4523/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vc3RhdHMvTW9tZW50U3RhdHNJdGVtLmphdmE=) | `38.09% <0.00%> (-9.53%)` | :arrow_down: |
   | [...ache/rocketmq/common/stats/MomentStatsItemSet.java](https://codecov.io/gh/apache/rocketmq/pull/4523/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vc3RhdHMvTW9tZW50U3RhdHNJdGVtU2V0LmphdmE=) | `39.13% <0.00%> (-8.70%)` | :arrow_down: |
   | [...va/org/apache/rocketmq/logging/inner/Appender.java](https://codecov.io/gh/apache/rocketmq/pull/4523/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bG9nZ2luZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvbG9nZ2luZy9pbm5lci9BcHBlbmRlci5qYXZh) | `29.21% <0.00%> (-7.87%)` | :arrow_down: |
   | [...org/apache/rocketmq/store/ha/WaitNotifyObject.java](https://codecov.io/gh/apache/rocketmq/pull/4523/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL2hhL1dhaXROb3RpZnlPYmplY3QuamF2YQ==) | `66.07% <0.00%> (-5.36%)` | :arrow_down: |
   | [...va/org/apache/rocketmq/common/stats/StatsItem.java](https://codecov.io/gh/apache/rocketmq/pull/4523/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vc3RhdHMvU3RhdHNJdGVtLmphdmE=) | `50.00% <0.00%> (-5.00%)` | :arrow_down: |
   | ... and [23 more](https://codecov.io/gh/apache/rocketmq/pull/4523/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/rocketmq/pull/4523?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/rocketmq/pull/4523?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [5595f00...3c5c6e3](https://codecov.io/gh/apache/rocketmq/pull/4523?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] duhenglucky merged pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
duhenglucky merged PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] coveralls commented on pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
coveralls commented on PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#issuecomment-1172042735

   
   [![Coverage Status](https://coveralls.io/builds/50516163/badge)](https://coveralls.io/builds/50516163)
   
   Coverage decreased (-0.05%) to 52.13% when pulling **3c5c6e343b25a9d75c74f293889fc5fd21c407f5 on cserwen:fix_route_info_not_found** into **493e52b945c7fdbdddb759847816d4952c966cff on apache:develop**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] coveralls commented on pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
coveralls commented on PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#issuecomment-1172042728

   
   [![Coverage Status](https://coveralls.io/builds/50516163/badge)](https://coveralls.io/builds/50516163)
   
   Coverage decreased (-0.05%) to 52.13% when pulling **3c5c6e343b25a9d75c74f293889fc5fd21c407f5 on cserwen:fix_route_info_not_found** into **493e52b945c7fdbdddb759847816d4952c966cff on apache:develop**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] Oliverwqcwrw commented on a diff in pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
Oliverwqcwrw commented on code in PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#discussion_r912709593


##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java:
##########
@@ -156,6 +156,10 @@ public RegisterBrokerResult registerBroker(
 
                 BrokerData brokerData = this.brokerAddrTable.get(brokerName);
                 if (null == brokerData) {
+                    if (topicConfigWrapper.getTopicConfigTable().size() == 1) {

Review Comment:
   Ok, I get it , Thanks for your reply



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] cserwen commented on a diff in pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
cserwen commented on code in PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#discussion_r911564678


##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/DefaultRequestProcessor.java:
##########
@@ -240,6 +240,13 @@ public RemotingCommand registerBrokerWithFilterServer(ChannelHandlerContext ctx,
             registerBrokerBody.getFilterServerList(),
             ctx.channel());
 
+        if (result == null) {

Review Comment:
   ```java
   if (topicConfigWrapper.getTopicConfigTable().size() == 1) {
       log.warn("Can't register topicConfigWrapper={} because broker={} has not registered.", topicConfigWrapper, brokerName);
       return null; 
   }
   ```
   
   `null` is returned directly. @Oliverwqcwrw 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] cserwen commented on a diff in pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
cserwen commented on code in PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#discussion_r912670848


##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java:
##########
@@ -156,6 +156,10 @@ public RegisterBrokerResult registerBroker(
 
                 BrokerData brokerData = this.brokerAddrTable.get(brokerName);
                 if (null == brokerData) {
+                    if (topicConfigWrapper.getTopicConfigTable().size() == 1) {

Review Comment:
   Besides, If the judgment is greater than or equal to 1, it will be impossible to distinguish the full registration of the Broker from the registration which the topic is created



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] Oliverwqcwrw commented on a diff in pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
Oliverwqcwrw commented on code in PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#discussion_r911540607


##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/DefaultRequestProcessor.java:
##########
@@ -240,6 +240,13 @@ public RemotingCommand registerBrokerWithFilterServer(ChannelHandlerContext ctx,
             registerBrokerBody.getFilterServerList(),
             ctx.channel());
 
+        if (result == null) {

Review Comment:
   The `result` seems can not null, it is initialized in first line, please correct me if I understand error
   
   > public RegisterBrokerResult registerBroker(
               final String clusterName,
               final String brokerAddr,
               final String brokerName,
               final long brokerId,
               final String haServerAddr,
               final TopicConfigSerializeWrapper topicConfigWrapper,
               final List<String> filterServerList,
               final Channel channel) {
           RegisterBrokerResult result = new RegisterBrokerResult();
           try {
               try {
                   this.lock.writeLock().lockInterruptibly();



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] Oliverwqcwrw commented on a diff in pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
Oliverwqcwrw commented on code in PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#discussion_r912686734


##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java:
##########
@@ -156,6 +156,10 @@ public RegisterBrokerResult registerBroker(
 
                 BrokerData brokerData = this.brokerAddrTable.get(brokerName);
                 if (null == brokerData) {
+                    if (topicConfigWrapper.getTopicConfigTable().size() == 1) {

Review Comment:
   Are you primarily trying to solve the problem of not being able to create a topic before first registering the broker



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] cserwen commented on a diff in pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
cserwen commented on code in PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#discussion_r909174265


##########
store/src/test/java/org/apache/rocketmq/store/dledger/DLedgerMultiPathTest.java:
##########
@@ -46,8 +46,8 @@ public void multiDirsStorageTest() throws Exception {
             DefaultMessageStore dLedgerStore = createDLedgerMessageStore(base, group, "n0", peers, multiStorePath, null);
             Thread.sleep(2000);
             doPutMessages(dLedgerStore, topic, 0, 1000, 0);
-            Assert.assertEquals(11, dLedgerStore.getMaxPhyOffset()/dLedgerStore.getMessageStoreConfig().getMappedFileSizeCommitLog());
             Thread.sleep(500);
+            Assert.assertEquals(11, dLedgerStore.getMaxPhyOffset()/dLedgerStore.getMessageStoreConfig().getMappedFileSizeCommitLog());

Review Comment:
   > Nice change here. I guess this is something that causes our CI to fail sometimes. Hope it works. How about making this a separate PR so that we could maybe merge it faster?
   
   @tsunghanjacktsai  Good suggestion, I'll deal with it later.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] Oliverwqcwrw commented on a diff in pull request #4523: [ISSUE #4522] Fix topic route info not found in some case

Posted by GitBox <gi...@apache.org>.
Oliverwqcwrw commented on code in PR #4523:
URL: https://github.com/apache/rocketmq/pull/4523#discussion_r911575468


##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/DefaultRequestProcessor.java:
##########
@@ -240,6 +240,13 @@ public RemotingCommand registerBrokerWithFilterServer(ChannelHandlerContext ctx,
             registerBrokerBody.getFilterServerList(),
             ctx.channel());
 
+        if (result == null) {

Review Comment:
   ok, I didn't notice you added this piece of code, thanks for your reply



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org