You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "GenerousMan (via GitHub)" <gi...@apache.org> on 2023/03/18 15:46:03 UTC

[GitHub] [rocketmq] GenerousMan opened a new pull request, #6393: [ISSUE #6392]GetSyncStateSet prints replica's alive status

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

   **Make sure set the target branch to `develop`**
   
   ## What is the purpose of the change
   
   GetSyncStateSet prints replica's alive status
   
   fix ISSUE #6392 
   
   ## Brief changelog
   
   print whether the broker is alive or not.
   
   ## 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: commits-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] TheR1sing3un commented on a diff in pull request #6393: [ISSUE #6392]GetSyncStateSet prints replica's alive status

Posted by "TheR1sing3un (via GitHub)" <gi...@apache.org>.
TheR1sing3un commented on code in PR #6393:
URL: https://github.com/apache/rocketmq/pull/6393#discussion_r1141346153


##########
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/body/BrokerReplicasInfo.java:
##########
@@ -115,29 +114,32 @@ public Long getMasterBrokerId() {
         }
 
         public boolean isExistInSync(String brokerName, Long brokerId, String brokerAddress) {
-            return this.getInSyncReplicas().contains(new ReplicaIdentity(brokerName, brokerId, brokerAddress));
+            return this.getInSyncReplicas().contains(new ReplicaIdentity(brokerName, brokerId, brokerAddress, true))
+                    || this.getInSyncReplicas().contains(new ReplicaIdentity(brokerName, brokerId, brokerAddress, false)) ;

Review Comment:
   The `ReplicaIndentity`'s field `isAlive` will not participate in the method `List::contains`. How about adding a constucter method like `public ReplicaIndentity(String brokerName, Long brokerId, String brokerAdress)` and the filed `isAlive` with the default value `false` ~



-- 
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: commits-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] RongtongJin commented on a diff in pull request #6393: [ISSUE #6392]GetSyncStateSet prints replica's alive status

Posted by "RongtongJin (via GitHub)" <gi...@apache.org>.
RongtongJin commented on code in PR #6393:
URL: https://github.com/apache/rocketmq/pull/6393#discussion_r1141576674


##########
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/body/BrokerReplicasInfo.java:
##########
@@ -164,12 +163,21 @@ public void setBrokerId(Long brokerId) {
             this.brokerId = brokerId;
         }
 
+        public Boolean getIsAlive() {
+            return this.isAlive;
+        }
+
+        public void setIsAlive(Boolean isAlive) {
+            this.isAlive = isAlive;
+        }

Review Comment:
   How about renaming isAlive and setAlive ?



-- 
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: commits-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] RongtongJin merged pull request #6393: [ISSUE #6392]GetSyncStateSet prints replica's alive status

Posted by "RongtongJin (via GitHub)" <gi...@apache.org>.
RongtongJin merged PR #6393:
URL: https://github.com/apache/rocketmq/pull/6393


-- 
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: commits-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] TheR1sing3un commented on a diff in pull request #6393: [ISSUE #6392]GetSyncStateSet prints replica's alive status

Posted by "TheR1sing3un (via GitHub)" <gi...@apache.org>.
TheR1sing3un commented on code in PR #6393:
URL: https://github.com/apache/rocketmq/pull/6393#discussion_r1141346153


##########
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/body/BrokerReplicasInfo.java:
##########
@@ -115,29 +114,32 @@ public Long getMasterBrokerId() {
         }
 
         public boolean isExistInSync(String brokerName, Long brokerId, String brokerAddress) {
-            return this.getInSyncReplicas().contains(new ReplicaIdentity(brokerName, brokerId, brokerAddress));
+            return this.getInSyncReplicas().contains(new ReplicaIdentity(brokerName, brokerId, brokerAddress, true))
+                    || this.getInSyncReplicas().contains(new ReplicaIdentity(brokerName, brokerId, brokerAddress, false)) ;

Review Comment:
   The `ReplicaIndentity`'s member-variable `isAlive` will not participate in the method `List::contains`. How about adding a constucter method like `public ReplicaIndentity(String brokerName, Long brokerId, String brokerAdress)` and the member-variable `isAlive` with the default value `false` ~



-- 
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: commits-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 #6393: [ISSUE #6392]GetSyncStateSet prints replica's alive status

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #6393:
URL: https://github.com/apache/rocketmq/pull/6393#issuecomment-1475561203

   ## [Codecov](https://codecov.io/gh/apache/rocketmq/pull/6393?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 [#6393](https://codecov.io/gh/apache/rocketmq/pull/6393?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f4d63fc) into [develop](https://codecov.io/gh/apache/rocketmq/commit/5ac91199f2c64be9f221dec7c25acb5e84cf91cd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5ac9119) will **increase** coverage by `0.00%`.
   > The diff coverage is `42.85%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##             develop    #6393   +/-   ##
   ==========================================
     Coverage      43.07%   43.08%           
   - Complexity      8914     8919    +5     
   ==========================================
     Files           1105     1105           
     Lines          77943    77970   +27     
     Branches       10144    10146    +2     
   ==========================================
   + Hits           33575    33590   +15     
   - Misses         40151    40169   +18     
   + Partials        4217     4211    -6     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/6393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...he/rocketmq/controller/impl/DLedgerController.java](https://codecov.io/gh/apache/rocketmq/pull/6393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvY29udHJvbGxlci9pbXBsL0RMZWRnZXJDb250cm9sbGVyLmphdmE=) | `66.66% <0.00%> (ø)` | |
   | [...tmq/remoting/protocol/body/BrokerReplicasInfo.java](https://codecov.io/gh/apache/rocketmq/pull/6393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3JlbW90aW5nL3Byb3RvY29sL2JvZHkvQnJva2VyUmVwbGljYXNJbmZvLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...q/controller/impl/manager/ReplicasInfoManager.java](https://codecov.io/gh/apache/rocketmq/pull/6393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvY29udHJvbGxlci9pbXBsL21hbmFnZXIvUmVwbGljYXNJbmZvTWFuYWdlci5qYXZh) | `64.96% <75.00%> (-0.09%)` | :arrow_down: |
   
   ... and [24 files with indirect coverage changes](https://codecov.io/gh/apache/rocketmq/pull/6393/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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: commits-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] github-code-scanning[bot] commented on pull request #6393: [ISSUE #6392]GetSyncStateSet prints replica's alive status

Posted by "github-code-scanning[bot] (via GitHub)" <gi...@apache.org>.
github-code-scanning[bot] commented on PR #6393:
URL: https://github.com/apache/rocketmq/pull/6393#issuecomment-1474883928

   You have successfully added a new CodeQL configuration `.github/workflows/codeql_analysis.yml:CodeQL-Build`. As part of the setup process, we have scanned this repository and found 9 existing alerts. Please check the repository [Security tab](/apache/rocketmq/security/code-scanning?query=pr%3A6393+tool%3ACodeQL+is%3Aopen) to see all alerts.


-- 
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: commits-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] GenerousMan commented on pull request #6393: [ISSUE #6392]GetSyncStateSet prints replica's alive status

Posted by "GenerousMan (via GitHub)" <gi...@apache.org>.
GenerousMan commented on PR #6393:
URL: https://github.com/apache/rocketmq/pull/6393#issuecomment-1474883010

   @RongtongJin 


-- 
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: commits-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] GenerousMan commented on a diff in pull request #6393: [ISSUE #6392]GetSyncStateSet prints replica's alive status

Posted by "GenerousMan (via GitHub)" <gi...@apache.org>.
GenerousMan commented on code in PR #6393:
URL: https://github.com/apache/rocketmq/pull/6393#discussion_r1141549631


##########
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/body/BrokerReplicasInfo.java:
##########
@@ -115,29 +114,32 @@ public Long getMasterBrokerId() {
         }
 
         public boolean isExistInSync(String brokerName, Long brokerId, String brokerAddress) {
-            return this.getInSyncReplicas().contains(new ReplicaIdentity(brokerName, brokerId, brokerAddress));
+            return this.getInSyncReplicas().contains(new ReplicaIdentity(brokerName, brokerId, brokerAddress, true))
+                    || this.getInSyncReplicas().contains(new ReplicaIdentity(brokerName, brokerId, brokerAddress, false)) ;

Review Comment:
   You are right. Thanks a lot~



-- 
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: commits-unsubscribe@rocketmq.apache.org

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