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

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

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