peilinqian opened a new issue, #21927:
URL: https://github.com/apache/shardingsphere/issues/21927
### Which version of ShardingSphere did you use?
we find java version: java8, full_version=1.8.0_282,
full_path=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64/bin/java
ShardingSphere-5.2.1-SNAPSHOT
Commit ID: dirty-bcde6f374c4a3a025173fbc9f6d0e66ed686a042
Commit Message: Fix fetch forward all error in openGauss(#21421) (#21471)
Branch: bcde6f374c4a3a025173fbc9f6d0e66ed686a042
Build time: 2022-10-11T19:13:56+0800
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
### Expected behavior
When the url of dataSources is configured with multiple hosts, log is normal;
### Actual behavior
When the url of dataSources is configured with multiple hosts, an error is
reported in the background.
### Reason analyze (If you can)
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
configuration, when exception occur etc.
```
schemaName: test_db_multi
dataSources:
ds_0:
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 260
minPoolSize: 1
password: Test@123
url:
jdbc:opengauss://IP1:15000,IP2:15000,IP3:15000/test_db?loadBalanceHosts=true&targetServerType=preferSlave&serverTimezone=UTC&useSSL=false&connectTimeout=10&useCursorFetch=true&defaultFetchSize=100
username: tpccuser
ds_1:
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 260
minPoolSize: 1
password: Test@123
url:
jdbc:opengauss://IP1:16000,IP2:16000,IP3:16000/test_db?loadBalanceHosts=true&targetServerType=preferSlave&serverTimezone=UTC&useSSL=false&connectTimeout=10&useCursorFetch=true&defaultFetchSize=100
username: tpccuser
rules:
- !SHARDING
tables:
t_single:
actualDataNodes: ds_0.t_single
t_ssdb_tb:
actualDataNodes: ds_${0..1}.t_ssdb_tb_${0..1}
databaseStrategy:
standard:
shardingAlgorithmName: ds_database_inline
shardingColumn: id
tableStrategy:
standard:
shardingColumn: c_id
shardingAlgorithmName: ts_t_ssdb_tb_inline
defaultTableStrategy:
none:
defaultDatabaseStrategy:
none:
shardingAlgorithms:
ds_database_inline:
type: INLINE
props:
algorithm-expression: ds_${id % 2}
allow-range-query-with-inline-sharding: true
ts_t_ssdb_tb_inline:
type: INLINE
props:
algorithm-expression: t_ssdb_tb_${c_id % 2}
allow-range-query-with-inline-sharding: true
```
```
[INFO ] 2022-11-03 16:07:18.328 [Periodic Recovery]
o.o.core.v3.ConnectionFactoryImpl - [9d3d541a-b70f-403c-a9e5-75b8c7174f6d] Try
to connect. IP: 10.29.180.204:15000
[INFO ] 2022-11-03 16:07:18.368 [Periodic Recovery]
o.o.core.v3.ConnectionFactoryImpl - [7.212.123.28:41750/10.29.180.204:15000]
Connection is established. ID: 9d3d541a-b70f-403c-a9e5-75b8c7174f6d
[INFO ] 2022-11-03 16:07:18.374 [Periodic Recovery]
o.o.core.v3.ConnectionFactoryImpl - Connect complete. ID:
9d3d541a-b70f-403c-a9e5-75b8c7174f6d
[INFO ] 2022-11-03 16:07:18.389 [Periodic Recovery]
o.o.hostchooser.MultiHostChooser - [AUTOBALANCE] The load balancing result of
the cluster is: | Cluster: [10.243.194.134:5431, 10.29.180.204:5431,
7.212.123.28:5431] | LoadBalanceResult: [7.212.123.28:5431,
10.243.194.134:5431, 10.29.180.204:5431]
[INFO ] 2022-11-03 16:07:18.389 [Periodic Recovery]
o.o.hostchooser.MultiHostChooser - [AUTOBALANCE] The load balancing result of
the cluster is: | Cluster: [10.243.194.134:5431, 10.29.180.204:5431,
7.212.123.28:5431] | LoadBalanceResult: [10.29.180.204:5431, 7.212.123.28:5431,
10.243.194.134:5431]
[INFO ] 2022-11-03 16:07:18.389 [Periodic Recovery]
o.o.core.v3.ConnectionFactoryImpl - [391fefe6-e4a2-4f58-b6ee-586f229ccf4c] Try
to connect. IP: 7.212.123.28:5431
[INFO ] 2022-11-03 16:07:18.391 [Periodic Recovery]
o.o.core.v3.ConnectionFactoryImpl - ConnectException occured while connecting
to {0}7.212.123.28:5431
java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:607)
at org.opengauss.core.PGStream.<init>(PGStream.java:70)
at
org.opengauss.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:112)
at
org.opengauss.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235)
at
org.opengauss.core.ConnectionFactory.openConnection(ConnectionFactory.java:53)
at org.opengauss.jdbc.PgConnection.<init>(PgConnection.java:255)
at org.opengauss.Driver.makeConnection(Driver.java:561)
at org.opengauss.Driver.connect(Driver.java:314)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at
org.opengauss.ds.common.BaseDataSource.getConnection(BaseDataSource.java:126)
at
org.opengauss.xa.PGXADataSource.getXAConnection(PGXADataSource.java:46)
at
org.opengauss.xa.PGXADataSource.getXAConnection(PGXADataSource.java:33)
at
org.apache.shardingsphere.transaction.xa.narayana.manager.DataSourceXAResourceRecoveryHelper.getXaConnection(DataSourceXAResourceRecoveryHelper.java:98)
at
org.apache.shardingsphere.transaction.xa.narayana.manager.DataSourceXAResourceRecoveryHelper.connect(DataSourceXAResourceRecoveryHelper.java:87)
at
org.apache.shardingsphere.transaction.xa.narayana.manager.DataSourceXAResourceRecoveryHelper.getXAResources(DataSourceXAResourceRecoveryHelper.java:78)
at
com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecoveryForRecoveryHelpers(XARecoveryModule.java:698)
at
com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:244)
at
com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:191)
at
com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:770)
at
com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:382)
[INFO ] 2022-11-03 16:07:18.392 [Periodic Recovery]
o.o.core.v3.ConnectionFactoryImpl - [f827e6a7-5feb-4a42-ab58-ecfede4f80e8] Try
to connect. IP: 10.243.194.134:5431
[INFO ] 2022-11-03 16:07:18.393 [Periodic Recovery]
o.o.core.v3.ConnectionFactoryImpl - ConnectException occured while connecting
to {0}10.243.194.134:5431
java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:607)
at org.opengauss.core.PGStream.<init>(PGStream.java:70)
at
org.opengauss.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:112)
at
org.opengauss.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235)
at
org.opengauss.core.ConnectionFactory.openConnection(ConnectionFactory.java:53)
at org.opengauss.jdbc.PgConnection.<init>(PgConnection.java:255)
at org.opengauss.Driver.makeConnection(Driver.java:561)
at org.opengauss.Driver.connect(Driver.java:314)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at
org.opengauss.ds.common.BaseDataSource.getConnection(BaseDataSource.java:126)
at
org.opengauss.xa.PGXADataSource.getXAConnection(PGXADataSource.java:46)
at
org.opengauss.xa.PGXADataSource.getXAConnection(PGXADataSource.java:33)
at
org.apache.shardingsphere.transaction.xa.narayana.manager.DataSourceXAResourceRecoveryHelper.getXaConnection(DataSourceXAResourceRecoveryHelper.java:98)
at
org.apache.shardingsphere.transaction.xa.narayana.manager.DataSourceXAResourceRecoveryHelper.connect(DataSourceXAResourceRecoveryHelper.java:87)
at
org.apache.shardingsphere.transaction.xa.narayana.manager.DataSourceXAResourceRecoveryHelper.getXAResources(DataSourceXAResourceRecoveryHelper.java:78)
at
com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecoveryForRecoveryHelpers(XARecoveryModule.java:698)
at
com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:244)
at
com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:191)
at
com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:770)
at
com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:382)
[INFO ] 2022-11-03 16:07:18.393 [Periodic Recovery]
o.o.core.v3.ConnectionFactoryImpl - [a1ad03f6-de3c-4a5b-bdc9-61125d4f3fc4] Try
to connect. IP: 10.29.180.204:5431
[INFO ] 2022-11-03 16:07:18.395 [Periodic Recovery]
o.o.core.v3.ConnectionFactoryImpl - ConnectException occured while connecting
to {0}10.29.180.204:5431
java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:607)
at org.opengauss.core.PGStream.<init>(PGStream.java:70)
at
org.opengauss.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:112)
at
org.opengauss.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235)
at
org.opengauss.core.ConnectionFactory.openConnection(ConnectionFactory.java:53)
at org.opengauss.jdbc.PgConnection.<init>(PgConnection.java:255)
at org.opengauss.Driver.makeConnection(Driver.java:561)
at org.opengauss.Driver.connect(Driver.java:314)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at
org.opengauss.ds.common.BaseDataSource.getConnection(BaseDataSource.java:126)
at
org.opengauss.xa.PGXADataSource.getXAConnection(PGXADataSource.java:46)
at
org.opengauss.xa.PGXADataSource.getXAConnection(PGXADataSource.java:33)
at
org.apache.shardingsphere.transaction.xa.narayana.manager.DataSourceXAResourceRecoveryHelper.getXaConnection(DataSourceXAResourceRecoveryHelper.java:98)
at
org.apache.shardingsphere.transaction.xa.narayana.manager.DataSourceXAResourceRecoveryHelper.connect(DataSourceXAResourceRecoveryHelper.java:87)
at
org.apache.shardingsphere.transaction.xa.narayana.manager.DataSourceXAResourceRecoveryHelper.getXAResources(DataSourceXAResourceRecoveryHelper.java:78)
at
com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecoveryForRecoveryHelpers(XARecoveryModule.java:698)
at
com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:244)
at
com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:191)
at
com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:770)
at
com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:382)
[INFO ] 2022-11-03 16:07:18.396 [Periodic Recovery]
o.o.core.v3.ConnectionFactoryImpl - Could not find a server with specified
targetServerType: preferSecondary. The current server known status is:
[7.212.123.28:5431=ConnectFail, 10.243.194.134:5431=ConnectFail,
10.29.180.204:5431=ConnectFail]
[WARN ] 2022-11-03 16:07:18.400 [Periodic Recovery]
o.a.s.t.x.n.m.DataSourceXAResourceRecoveryHelper - Failed to create connection
org.opengauss.util.PSQLException: Could not find a server with specified
targetServerType: preferSecondary
at
org.opengauss.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:404)
at
org.opengauss.core.ConnectionFactory.openConnection(ConnectionFactory.java:53)
at org.opengauss.jdbc.PgConnection.<init>(PgConnection.java:255)
at org.opengauss.Driver.makeConnection(Driver.java:561)
at org.opengauss.Driver.connect(Driver.java:314)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at
org.opengauss.ds.common.BaseDataSource.getConnection(BaseDataSource.java:126)
at
org.opengauss.xa.PGXADataSource.getXAConnection(PGXADataSource.java:46)
at
org.opengauss.xa.PGXADataSource.getXAConnection(PGXADataSource.java:33)
at
org.apache.shardingsphere.transaction.xa.narayana.manager.DataSourceXAResourceRecoveryHelper.getXaConnection(DataSourceXAResourceRecoveryHelper.java:98)
at
org.apache.shardingsphere.transaction.xa.narayana.manager.DataSourceXAResourceRecoveryHelper.connect(DataSourceXAResourceRecoveryHelper.java:87)
at
org.apache.shardingsphere.transaction.xa.narayana.manager.DataSourceXAResourceRecoveryHelper.getXAResources(DataSourceXAResourceRecoveryHelper.java:78)
at
com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecoveryForRecoveryHelpers(XARecoveryModule.java:698)
at
com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:244)
at
com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:191)
at
com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:770)
at
com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:382)
```
### Example codes for reproduce this issue (such as a github link).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]