This is an automated email from the ASF dual-hosted git repository. stoty 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 281a5456a6 PHOENIX-7534 ConnectionIT.testRPCConnections is very flakey (#2145) 281a5456a6 is described below commit 281a5456a688e03dd1dd8c4fba95011fdd9f4f6e Author: Istvan Toth <st...@apache.org> AuthorDate: Tue May 13 07:28:24 2025 +0200 PHOENIX-7534 ConnectionIT.testRPCConnections is very flakey (#2145) --- .../java/org/apache/phoenix/jdbc/AbstractRPCConnectionInfo.java | 2 +- .../src/main/java/org/apache/phoenix/jdbc/RPCConnectionInfo.java | 3 ++- .../src/it/java/org/apache/phoenix/end2end/ConnectionIT.java | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/AbstractRPCConnectionInfo.java b/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/AbstractRPCConnectionInfo.java index 1a62c69fbb..33b91423ab 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/AbstractRPCConnectionInfo.java +++ b/phoenix-core-client/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-client/src/main/java/org/apache/phoenix/jdbc/RPCConnectionInfo.java b/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/RPCConnectionInfo.java index 5825b23494..49aaa22617 100644 --- a/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/RPCConnectionInfo.java +++ b/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/RPCConnectionInfo.java @@ -34,7 +34,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"; 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 8aab8feb1d..1edc4b9843 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 @@ -36,6 +36,7 @@ import org.apache.hadoop.hbase.util.VersionInfo; import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.jdbc.PhoenixTestDriver; +import org.apache.phoenix.jdbc.RPCConnectionInfo; import org.apache.phoenix.jdbc.ZKConnectionInfo; import org.apache.phoenix.mapreduce.util.ConnectionUtil; import org.apache.phoenix.query.ConfigurationFactory; @@ -146,6 +147,11 @@ public class ConnectionIT { public void testRPCConnections() throws SQLException { assumeTrue(VersionInfo.compareVersion(VersionInfo.getVersion(), "2.5.0") >= 0); String masterHosts = conf.get(HConstants.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");