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

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


The following commit(s) were added to refs/heads/5.1 by this push:
     new 926bad0193 PHOENIX-7534 ConnectionIT.testRPCConnections is very flakey 
(#2145)
926bad0193 is described below

commit 926bad019366175caa47ba3129ae60b45af613df
Author: Istvan Toth <st...@apache.org>
AuthorDate: Tue May 13 07:28:24 2025 +0200

    PHOENIX-7534 ConnectionIT.testRPCConnections is very flakey (#2145)
---
 .../src/it/java/org/apache/phoenix/end2end/ConnectionIT.java        | 6 ++++++
 .../java/org/apache/phoenix/jdbc/AbstractRPCConnectionInfo.java     | 2 +-
 .../src/main/java/org/apache/phoenix/jdbc/RPCConnectionInfo.java    | 3 ++-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ConnectionIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ConnectionIT.java
index 9e5ac1d104..42a0430799 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ConnectionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ConnectionIT.java
@@ -34,6 +34,7 @@ import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.util.VersionInfo;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.jdbc.PhoenixDriver;
+import org.apache.phoenix.jdbc.RPCConnectionInfo;
 import org.apache.phoenix.mapreduce.util.ConnectionUtil;
 import org.apache.phoenix.query.ConfigurationFactory;
 import org.apache.phoenix.util.InstanceResolver;
@@ -143,6 +144,11 @@ public class ConnectionIT {
     public void testRPCConnections() throws SQLException {
         assumeTrue(VersionInfo.compareVersion(VersionInfo.getVersion(), 
"2.5.0") >= 0);
         String masterHosts = conf.get(MASTER_ADDRS_KEY);
+        // HBase does fall back to MasterRpcRegistry if the bootstrap servers 
are not set, but
+        // ConnectionInfo normalization does not handle that.
+
+        // Set BOOTSTRAP_NODES so that we can test the default case
+        conf.set(RPCConnectionInfo.BOOTSTRAP_NODES, masterHosts);
 
         try (PhoenixConnection conn1 =
                 (PhoenixConnection) 
DriverManager.getConnection("jdbc:phoenix+rpc");
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/AbstractRPCConnectionInfo.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/AbstractRPCConnectionInfo.java
index d193a911eb..0e08c3c5d0 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/AbstractRPCConnectionInfo.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/AbstractRPCConnectionInfo.java
@@ -51,7 +51,7 @@ public abstract class AbstractRPCConnectionInfo extends 
ConnectionInfo {
 
     @Override
     public String getZookeeperConnectionString() {
-        throw new UnsupportedOperationException("MasterRegistry is used");
+        throw new UnsupportedOperationException("MasterRegistry/RPCRegistry is 
used");
     }
 
     @Override
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/RPCConnectionInfo.java 
b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/RPCConnectionInfo.java
index 74e5832196..1b5287b4ee 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/RPCConnectionInfo.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/RPCConnectionInfo.java
@@ -35,7 +35,8 @@ import org.apache.phoenix.util.ReadOnlyProps;
  */
 public class RPCConnectionInfo extends AbstractRPCConnectionInfo {
 
-    // We may be on an older HBase version, which does not even have 
RpcConnectionRegistry
+    // We may be compiling with an older HBase version, which does not even 
have
+    // RpcConnectionRegistry
     public static final String BOOTSTRAP_NODES = 
"hbase.client.bootstrap.servers";
     private static final String RPC_REGISTRY_CLASS_NAME =
             "org.apache.hadoop.hbase.client.RpcConnectionRegistry";

Reply via email to