This is an automated email from the ASF dual-hosted git repository.

vjasani pushed a commit to branch 5.2
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/5.2 by this push:
     new d10337d34a PHOENIX-7700 Update default values for schema change retry 
policy (#2286)
d10337d34a is described below

commit d10337d34a603d93da3afc362b175c29692ae92f
Author: Viraj Jasani <vjas...@apache.org>
AuthorDate: Sat Sep 13 11:48:42 2025 -0700

    PHOENIX-7700 Update default values for schema change retry policy (#2286)
    
    Co-authored-by: David Manning <david.mann...@salesforce.com>
---
 .../org/apache/phoenix/query/ConnectionQueryServicesImpl.java  | 10 ++++++----
 .../java/org/apache/phoenix/query/QueryServicesOptions.java    |  4 ++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git 
a/phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
 
b/phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
index 3dc0437325..4e19db1711 100644
--- 
a/phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
+++ 
b/phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
@@ -1653,16 +1653,16 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices
       
ConnectionQueryServicesImpl.this.props.getLong(QueryServices.DELAY_FOR_SCHEMA_UPDATE_CHECK,
         QueryServicesOptions.DEFAULT_DELAY_FOR_SCHEMA_UPDATE_CHECK);
     boolean success = false;
-    int numTries = 1;
+    int numTries = 0;
     PhoenixStopWatch watch = new PhoenixStopWatch();
     watch.start();
     do {
       try {
         success = op.checkForCompletion();
       } catch (Exception ex) {
-        // If we encounter any exception on the first or last try, propagate 
the exception and fail.
+        // If we encounter any exception on the first try, propagate the 
exception and fail.
         // Else, we swallow the exception and retry till we reach maxRetries.
-        if (numTries == 1 || numTries == maxRetries) {
+        if (numTries == 0) {
           watch.stop();
           TimeoutException toThrow = new TimeoutException("Operation " + 
op.getOperationName()
             + " didn't complete because of exception. Time elapsed: " + 
watch.elapsedMillis());
@@ -1671,7 +1671,9 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices
         }
       }
       numTries++;
-      Thread.sleep(sleepInterval);
+      if (numTries < maxRetries && !success) {
+        Thread.sleep(sleepInterval);
+      }
     } while (numTries < maxRetries && !success);
 
     watch.stop();
diff --git 
a/phoenix-core-client/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
 
b/phoenix-core-client/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
index 776f5f55dd..c4c4410856 100644
--- 
a/phoenix-core-client/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
+++ 
b/phoenix-core-client/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
@@ -309,8 +309,8 @@ public class QueryServicesOptions {
   public static final boolean DEFAULT_EXPLAIN_CHUNK_COUNT = true;
   public static final boolean DEFAULT_EXPLAIN_ROW_COUNT = true;
   public static final boolean DEFAULT_ALLOW_ONLINE_TABLE_SCHEMA_UPDATE = true;
-  public static final int DEFAULT_RETRIES_FOR_SCHEMA_UPDATE_CHECK = 10;
-  public static final long DEFAULT_DELAY_FOR_SCHEMA_UPDATE_CHECK = 5 * 1000; 
// 5 seconds.
+  public static final int DEFAULT_RETRIES_FOR_SCHEMA_UPDATE_CHECK = 50;
+  public static final long DEFAULT_DELAY_FOR_SCHEMA_UPDATE_CHECK = 1000; // 1 
second.
   public static final boolean DEFAULT_STORE_NULLS = false;
 
   // TODO Change this to true as part of PHOENIX-1543

Reply via email to