ivandika3 commented on code in PR #9222:
URL: https://github.com/apache/ozone/pull/9222#discussion_r2529484928


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/ha/OMFailoverProxyProviderBase.java:
##########
@@ -445,7 +446,8 @@ protected synchronized void setOmProxies(Map<String,
   }
 
   protected synchronized void setOmNodeIDList(List<String> omNodeIDList) {
-    this.omNodeIDList = omNodeIDList;
+    Collections.shuffle(omNodeIDList);
+    this.omNodeIDList = Collections.unmodifiableList(omNodeIDList);
   }

Review Comment:
   Quoting internal review for community visibility:
   
   I think this is the simplest solution. This will work ok if we have a 
short-lived read-only client. However, as soon as the Ozone client encounters a 
read request that was rejected by the OM leader or a write request, the client 
will revert back to the usual read and write from leader until the next leader 
failover (e.g. during release). This implies that for long-lived client (e.g. 
S3G), the workload will fallback to leader pretty quickly. Therefore, I believe 
we need to a more involved client implementation.
   A future work will need to design client-side proxy failover. I have 
outlined some of my thoughts in HDDS-9279, but it's just a brainstorm and need 
to be validated further.
   
   - A simpler approach might be to occassionally randomize this omNodeIDList 
every intervals (e.g. 5 seconds).
   - Another approach by DiDi 
(https://ozone.apache.org/assets/ApacheOzoneBestPracticesAtDidi.pdf "2 OM 
Follower Read for S3G in Internal Scenarios") is for clients to send 
occassional probe messages to all 3 OMs to get the latency and lastAppliedIndex 
info and pick the more appropriate OM follower based on these info.
   
   However, currently this is OK.



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


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

Reply via email to