peilinqian opened a new issue, #19114: URL: https://github.com/apache/shardingsphere/issues/19114
## Bug Report **For English only**, other languages will not accept. Before report a bug, make sure you have: - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues). - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview). Please pay attention on issues you submitted, because we maybe need more details. If no response anymore and we cannot reproduce it on current information, we will **close it**. Please answer these questions before submitting your issue. Thanks! ### Which version of ShardingSphere did you use? we find java version: java8, full_version=1.8.0_282 ShardingSphere-5.1.3-SNAPSHOT Commit ID: 7c67365b394d2e3ac562329b550c135c31ea764d Commit Message: Avoid overhead of invoking method in Optional.orElse (#18921) Branch: 7c67365b394d2e3ac562329b550c135c31ea764d Build time: 2022-07-08T19:24:17+0800 ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy? ShardingSphere-JDBC ### Expected behavior ss-jdbc initialization connection does not verify other schemas ### Actual behavior ss-jdbc initializes the connection to verify other schemas ### Reason analyze (If you can) ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc. 1、excute ss-jdbc error info ``` [ERROR] 2022-07-13 19:59:19,486 --Curator-SafeNotifyService-0-- [com.zaxxer.hikari.pool.HikariPool] HikariPool-5 - Exception during pool initialization. org.opengauss.util.PSQLException: [CSIP:60061/**otherDSIP**:15000] FATAL: no pg_hba.conf entry for host "CSIP", user "tpccuser", database "test_split", SSL off at org.opengauss.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:603) at org.opengauss.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:164) 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 com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:354) at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:202) at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473) at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:554) at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) at org.apache.shardingsphere.infra.database.type.DatabaseTypeEngine.getDatabaseType(DatabaseTypeEngine.java:109) at org.apache.shardingsphere.infra.database.type.DatabaseTypeEngine.getDatabaseType(DatabaseTypeEngine.java:101) at org.apache.shardingsphere.infra.database.type.DatabaseTypeEngine.lambda$getProtocolType$0(DatabaseTypeEngine.java:51) at java.util.Optional.orElseGet(Optional.java:267) at org.apache.shardingsphere.infra.database.type.DatabaseTypeEngine.getProtocolType(DatabaseTypeEngine.java:51) at org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabasesFactory.create(ShardingSphereDatabasesFactory.java:48) at org.apache.shardingsphere.mode.manager.ContextManager.createChangedDatabases(ContextManager.java:324) at org.apache.shardingsphere.mode.manager.ContextManager.createMetaDataContexts(ContextManager.java:308) at org.apache.shardingsphere.mode.manager.ContextManager.alterDataSourceConfiguration(ContextManager.java:268) at org.apache.shardingsphere.mode.manager.cluster.coordinator.ClusterContextManagerCoordinator.renew(ClusterContextManagerCoordinator.java:168) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:87) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:144) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:72) at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:67) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:108) at com.google.common.eventbus.EventBus.post(EventBus.java:212) at java.util.Optional.ifPresent(Optional.java:159) at org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.GovernanceWatcherFactory.lambda$watch$0(GovernanceWatcherFactory.java:55) at org.apache.shardingsphere.mode.repository.cluster.zookeeper.CuratorZookeeperRepository.lambda$watch$0(CuratorZookeeperRepository.java:240) at org.apache.curator.framework.recipes.cache.TreeCacheListenerWrapper.sendEvent(TreeCacheListenerWrapper.java:71) at org.apache.curator.framework.recipes.cache.TreeCacheListenerWrapper.event(TreeCacheListenerWrapper.java:42) at org.apache.curator.framework.recipes.cache.CuratorCacheListenerBuilderImpl$2.lambda$event$0(CuratorCacheListenerBuilderImpl.java:149) at java.util.ArrayList.forEach(ArrayList.java:1259) at org.apache.curator.framework.recipes.cache.CuratorCacheListenerBuilderImpl$2.event(CuratorCacheListenerBuilderImpl.java:149) at org.apache.curator.framework.recipes.cache.CuratorCacheImpl.lambda$putStorage$7(CuratorCacheImpl.java:279) at org.apache.curator.framework.listen.MappingListenerManager.lambda$forEach$0(MappingListenerManager.java:92) at org.apache.curator.framework.listen.MappingListenerManager.forEach(MappingListenerManager.java:89) at org.apache.curator.framework.listen.StandardListenerManager.forEach(StandardListenerManager.java:89) at org.apache.curator.framework.recipes.cache.CuratorCacheImpl.lambda$callListeners$10(CuratorCacheImpl.java:293) at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` ### Example codes for reproduce this issue (such as a github link). **1、ss-jdbc configuration** ``` schemaName: order_db mode: type: Cluster repository: type: ZooKeeper props: namespace: governance_ds server-lists: zkIP:2181 retryIntervalMilliseconds: 50000 timeToLiveSeconds: 60000 maxRetries: 3 operationTimeoutMilliseconds: 50000 overwrite: false props: sql-show: true ``` **2、ss-jdbc schema configuration** ``` schemaName: order_db dataSources: ds_0: url: jdbc:opengauss://ds1IP:14000/test_order?batchMode=on username: tpccuser password: Test@123 connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 50 minPoolSize: 1 ds_1: url: jdbc:opengauss://ds2IP:14000/test_order?batchMode=on username: tpccuser password: Test@123 connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 50 minPoolSize: 1 ``` **3、other schema configuration** ``` databaseName: readwrite_splitting_db dataSources: write_ds: connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 260 minPoolSize: 1 password: Test@123 url: jdbc:opengauss://ds1:15000/test_split?batchMode=on username: tpccuser read_ds_0: connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 260 minPoolSize: 1 password: Test@123 url: jdbc:opengauss://ds2:15000/test_split?batchMode=on username: tpccuser read_ds_1: connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 260 minPoolSize: 1 password: Test@123 url: jdbc:opengauss://**otherDSIP**:15000/test_split?batchMode=on username: tpccuser ``` -- 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]
