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

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


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

commit cb33ec3ebbad84a1dad2aa19307d95c6e5736760
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 65d076593b..5d46b54095 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
@@ -1730,16 +1730,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());
@@ -1748,7 +1748,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 8e4c7febf5..a7f282e1f7 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
@@ -314,8 +314,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