wardlican commented on code in PR #3920:
URL: https://github.com/apache/amoro/pull/3920#discussion_r2887862123


##########
amoro-ams/src/main/java/org/apache/amoro/server/ha/DataBaseHighAvailabilityContainer.java:
##########
@@ -135,6 +137,44 @@ public void waitFollowerShip() throws InterruptedException 
{
     LOG.info("Became the follower of AMS (Database lease)");
   }
 
+  @Override
+  public void registerAndElect() throws Exception {
+    boolean isMasterSlaveMode = 
serviceConfig.getBoolean(AmoroManagementConf.USE_MASTER_SLAVE_MODE);
+    if (!isMasterSlaveMode) {
+      LOG.debug("Master-slave mode is not enabled, skip node registration");
+      return;
+    }
+    // In master-slave mode, register node to database by writing 
OPTIMIZING_SERVICE info
+    // This is similar to ZK mode registering ephemeral nodes
+    long now = System.currentTimeMillis();
+    String optimizingInfoJson = 
JacksonUtil.toJSONString(optimizingServiceServerInfo);

Review Comment:
   Okay, I'll change it so that `optimizingServiceServerInfo` is used for 
registration here.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to