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


##########
amoro-optimizer/amoro-optimizer-common/src/main/java/org/apache/amoro/optimizer/common/AbstractOptimizerOperator.java:
##########
@@ -86,25 +157,79 @@ private boolean shouldReturnNull(Throwable t) {
     return false;
   }
 
-  protected <T> T callAuthenticatedAms(AmsAuthenticatedCallOperation<T> 
operation)
+  /**
+   * Call authenticated AMS with a specific AMS URL.
+   *
+   * @param amsUrl The AMS node URL to call
+   * @param operation The operation to execute
+   * @return The result of the operation
+   * @throws TException If the operation fails
+   */
+  protected <T> T callAuthenticatedAms(String amsUrl, 
AmsAuthenticatedCallOperation<T> operation)
       throws TException {
+    // Maximum retry time window for auth errors in master-slave mode (30 
seconds)
+    long maxAuthRetryTimeWindow = TimeUnit.SECONDS.toMillis(90);

Review Comment:
   The purpose of this window is to allow the optimizer to wait for the slave 
AMS node to complete its automatic registration (PLUGIN_RETRY_AUTH_ERROR_CODE) 
once a connection has been established. The process by which a slave node 
discovers its assigned buckets and completes registration is as follows:
   
   - ZK Mode: Triggered by a ZK watch; typically completes within seconds.
   - DB Mode: Discovered via polling based on the `node_heartbeat_ts` 
timestamp, with a polling interval of approximately 10–30 seconds.
   
   Conclusion: A duration of 30 seconds is more appropriate.



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