You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/12/10 12:56:40 UTC

[GitHub] [ozone] GlenGeng opened a new pull request #1683: HDDS-4575: Refactor SCMHAManager and SCMRatisServer with RaftServer.Divison

GlenGeng opened a new pull request #1683:
URL: https://github.com/apache/ozone/pull/1683


   ## What changes were proposed in this pull request?
   
   Simplify SCMHAManager and SCMRatisServer with RaftServer.Division
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-4575
   
   ## How was this patch tested?
   
   CI
   


----------------------------------------------------------------
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.

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



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


[GitHub] [ozone] GlenGeng closed pull request #1683: HDDS-4575: Refactor SCMHAManager and SCMRatisServer with RaftServer.Divison

Posted by GitBox <gi...@apache.org>.
GlenGeng closed pull request #1683:
URL: https://github.com/apache/ozone/pull/1683


   


----------------------------------------------------------------
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.

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



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


[GitHub] [ozone] GlenGeng commented on a change in pull request #1683: HDDS-4575: Refactor SCMHAManager and SCMRatisServer with RaftServer.Divison

Posted by GitBox <gi...@apache.org>.
GlenGeng commented on a change in pull request #1683:
URL: https://github.com/apache/ozone/pull/1683#discussion_r543070483



##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/MockSCMHAManager.java
##########
@@ -204,23 +180,27 @@ private Message process(final SCMRatisRequest request)
     }
 
     @Override
-    public RaftServer getServer() {
-      return null;
+    public void stop() {
     }
 
     @Override
-    public RaftGroupId getRaftGroupId() {
+    public RaftServer.Division getDivision() {
       return null;

Review comment:
       No, we don't allow null Divison in real env.




----------------------------------------------------------------
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.

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



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


[GitHub] [ozone] GlenGeng closed pull request #1683: HDDS-4575: Refactor SCMHAManager and SCMRatisServer with RaftServer.Divison

Posted by GitBox <gi...@apache.org>.
GlenGeng closed pull request #1683:
URL: https://github.com/apache/ozone/pull/1683


   


----------------------------------------------------------------
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.

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



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


[GitHub] [ozone] timmylicheng commented on a change in pull request #1683: HDDS-4575: Refactor SCMHAManager and SCMRatisServer with RaftServer.Divison

Posted by GitBox <gi...@apache.org>.
timmylicheng commented on a change in pull request #1683:
URL: https://github.com/apache/ozone/pull/1683#discussion_r542365071



##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/MockSCMHAManager.java
##########
@@ -204,23 +180,27 @@ private Message process(final SCMRatisRequest request)
     }
 
     @Override
-    public RaftServer getServer() {
-      return null;
+    public void stop() {
     }
 
     @Override
-    public RaftGroupId getRaftGroupId() {
+    public RaftServer.Division getDivision() {
       return null;

Review comment:
       Do we allow Division to be null?




----------------------------------------------------------------
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.

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



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


[GitHub] [ozone] GlenGeng commented on a change in pull request #1683: HDDS-4575: Refactor SCMHAManager and SCMRatisServer with RaftServer.Divison

Posted by GitBox <gi...@apache.org>.
GlenGeng commented on a change in pull request #1683:
URL: https://github.com/apache/ozone/pull/1683#discussion_r543073822



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java
##########
@@ -69,41 +65,49 @@
       throws IOException {
     this.address = haConf.getRatisBindAddress();
 
-    SCMHAGroupBuilder scmHAGroupBuilder = new SCMHAGroupBuilder(haConf, conf);
-    this.raftPeerId = scmHAGroupBuilder.getPeerId();
-    this.raftGroupId = scmHAGroupBuilder.getRaftGroupId();
-    this.raftGroup = scmHAGroupBuilder.getRaftGroup();
+    SCMHAGroupBuilder haGrpBuilder = new SCMHAGroupBuilder(haConf, conf);
 
     final RaftProperties serverProperties = RatisUtil
         .newRaftProperties(haConf, conf);
-    this.scmStateMachine = new SCMStateMachine();
-    this.server = RaftServer.newBuilder()
-        .setServerId(raftPeerId)
-        .setGroup(raftGroup)
+
+    RaftServer server = RaftServer.newBuilder()
+        .setServerId(haGrpBuilder.getPeerId())
+        .setGroup(haGrpBuilder.getRaftGroup())
         .setProperties(serverProperties)
-        .setStateMachine(scmStateMachine)
+        .setStateMachine(new SCMStateMachine())
         .build();
+
+    this.division = server.getDivision(haGrpBuilder.getRaftGroupId());

Review comment:
       You won't get a null, instead, the call will throw a `GroupMismatchException` in this situation.




----------------------------------------------------------------
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.

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



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


[GitHub] [ozone] ChenSammi commented on pull request #1683: HDDS-4575: Refactor SCMHAManager and SCMRatisServer with RaftServer.Divison

Posted by GitBox <gi...@apache.org>.
ChenSammi commented on pull request #1683:
URL: https://github.com/apache/ozone/pull/1683#issuecomment-747259739


   +1 


----------------------------------------------------------------
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.

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



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


[GitHub] [ozone] timmylicheng commented on a change in pull request #1683: HDDS-4575: Refactor SCMHAManager and SCMRatisServer with RaftServer.Divison

Posted by GitBox <gi...@apache.org>.
timmylicheng commented on a change in pull request #1683:
URL: https://github.com/apache/ozone/pull/1683#discussion_r542365439



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java
##########
@@ -69,41 +65,49 @@
       throws IOException {
     this.address = haConf.getRatisBindAddress();
 
-    SCMHAGroupBuilder scmHAGroupBuilder = new SCMHAGroupBuilder(haConf, conf);
-    this.raftPeerId = scmHAGroupBuilder.getPeerId();
-    this.raftGroupId = scmHAGroupBuilder.getRaftGroupId();
-    this.raftGroup = scmHAGroupBuilder.getRaftGroup();
+    SCMHAGroupBuilder haGrpBuilder = new SCMHAGroupBuilder(haConf, conf);
 
     final RaftProperties serverProperties = RatisUtil
         .newRaftProperties(haConf, conf);
-    this.scmStateMachine = new SCMStateMachine();
-    this.server = RaftServer.newBuilder()
-        .setServerId(raftPeerId)
-        .setGroup(raftGroup)
+
+    RaftServer server = RaftServer.newBuilder()
+        .setServerId(haGrpBuilder.getPeerId())
+        .setGroup(haGrpBuilder.getRaftGroup())
         .setProperties(serverProperties)
-        .setStateMachine(scmStateMachine)
+        .setStateMachine(new SCMStateMachine())
         .build();
+
+    this.division = server.getDivision(haGrpBuilder.getRaftGroupId());

Review comment:
       Any way to guarantee division is not null?




----------------------------------------------------------------
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.

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



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


[GitHub] [ozone] ChenSammi merged pull request #1683: HDDS-4575: Refactor SCMHAManager and SCMRatisServer with RaftServer.Divison

Posted by GitBox <gi...@apache.org>.
ChenSammi merged pull request #1683:
URL: https://github.com/apache/ozone/pull/1683


   


----------------------------------------------------------------
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.

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



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