adoroszlai commented on a change in pull request #649: HDDS-3120. Freon work 
with OM HA.
URL: https://github.com/apache/hadoop-ozone/pull/649#discussion_r389932026
 
 

 ##########
 File path: 
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java
 ##########
 @@ -469,4 +456,13 @@ public AtomicLong getAttemptCounter() {
   public int getThreadNo() {
     return threadNo;
   }
+
+  protected OzoneClient createOzoneClient(String omServiceID,
+      OzoneConfiguration conf) throws Exception {
+    if (omServiceID != null) {
+      return OzoneClientFactory.getRpcClient(omServiceID, conf);
+    } else {
+      return OzoneClientFactory.getRpcClient(conf);
 
 Review comment:
   I think here `getClient` should be used to validate presence of 
`--om-service-id` param.
   
   ```suggestion
         return OzoneClientFactory.getClient(conf);
   ```
   
   There are two methods in `OzoneClientFactory` that take `Configuration` and 
return `OzoneClient`:
   
    * `getClient(Configuration)` throws exception if configuration has OM 
service ID, but
    * `getRpcClient(Configuration)` does not
   
   I'm getting timeout on OM HA cluster when `--om-service-id` is omitted.
   
   ```
   $ ozone freon ockg -n 1 -t 1
   ...
   [main] INFO ipc.Client: Retrying connect to server: 0.0.0.0/0.0.0.0:9862. 
Already tried 0 time(s); retry policy is 
RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
   ...
   [main] ERROR ha.OMFailoverProxyProvider: Failed to connect to OMs: 
[nodeId=null,nodeAddress=0.0.0.0:9862]. Attempted 15 failovers.
   ```
   
   After making the suggested change locally, I get the error message as 
expected:
   
   ```
   $ ozone freon ockg -n 1 -t 1
   ...
   Following ServiceID's [id1] are defined in the configuration. Use the method 
getClient which takes serviceID and configuration as param
   ```

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to