slfan1989 commented on code in PR #7016:
URL: https://github.com/apache/ozone/pull/7016#discussion_r1743316432


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/client/ScmClient.java:
##########
@@ -392,6 +392,15 @@ StartContainerBalancerResponseProto startContainerBalancer(
    */
   List<String> getScmRatisRoles() throws IOException;
 
+  /**
+   * Get the current SCM mode.
+   *
+   * @return `true` indicates that it is in RATIS mode,
+   * while `false` indicates that it is in STANDALONE mode.
+   * @throws IOException  an I/O exception of some sort has occurred.
+   */
+  boolean isSCMRatisEnable() throws IOException;

Review Comment:
   Thank you for reviewing the code! I will improve this part of the code.



##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/scm/protocolPB/StorageContainerLocationProtocolClientSideTranslatorPB.java:
##########
@@ -758,6 +758,7 @@ public ScmInfo getScmInfo() throws IOException {
     ScmInfo.Builder builder = new ScmInfo.Builder()
         .setClusterId(resp.getClusterId())
         .setScmId(resp.getScmId())
+        .setScmRatisEnabled(resp.getScmRatisEnabled())

Review Comment:
   > Here to be backward compatible, we should first check whether the response 
has "scmRatisEnabled" field. 
   
   Thank you for the reminder! It's indeed very necessary. I will check if 
`ScmRatisEnabled` exists.
   
   > If it doesn't have, which means the SCM server is an old version server, 
then we need to set this ScmRatisEnabled field in other way, for example, the 
size of RolesList.
   
   We use the size of `RolesList` to determine if Ratis is enabled. If 
RolesList.size > 1, we consider Ratis enabled. If RolesList.size <= 1, we 
consider Ratis not enabled ?
   



-- 
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: issues-unsubscr...@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to