This is an automated email from the ASF dual-hosted git repository.
stoty 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 b66f650bb4 PHOENIX-7534 ConnectionIT.testRPCConnections is very flakey
(#2145)
b66f650bb4 is described below
commit b66f650bb4a59fc31dc449863ea73a6efb1bffe7
Author: Istvan Toth <[email protected]>
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 0e4920c4c9..1f9141b64a 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 19749c6e8b..1b29b156a6 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
@@ -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";
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 243b3c730a..87cf8649e3 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;
@@ -141,6 +142,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");