You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/05/28 10:46:05 UTC

[GitHub] [shardingsphere] taojintianxia opened a new issue #10531: proxy sharding got an exception in a sysbench test

taojintianxia opened a new issue #10531:
URL: https://github.com/apache/shardingsphere/issues/10531


   4 machines : 
   sysbench press on host 192.168.100.10
   proxy with sharding config on host 192.168.100.11
   two opengauss on host 192.168.100.20,192.168.100.21
   
   proxy could start normally, but when sysbench try to init , proxy got following error : 
   
   ```
   [ERROR] 2021-05-28 18:01:29.959 [pool-21-thread-1] o.a.s.p.f.c.CommandExecutorTask - Exception occur:
   java.sql.SQLException: Can not get 50 connections one time, partition succeed connection(0) have released!
   	at org.apache.shardingsphere.proxy.backend.communication.jdbc.datasource.JDBCBackendDataSource.createConnections(JDBCBackendDataSource.java:104)
   	at org.apache.shardingsphere.proxy.backend.communication.jdbc.datasource.JDBCBackendDataSource.getConnections(JDBCBackendDataSource.java:87)
   	at org.apache.shardingsphere.proxy.backend.communication.jdbc.datasource.JDBCBackendDataSource.getConnections(JDBCBackendDataSource.java:64)
   	at org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection.getConnectionsWithoutTransaction(BackendConnection.java:147)
   	at org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection.getConnections(BackendConnection.java:108)
   	at org.apache.shardingsphere.infra.executor.sql.prepare.driver.DriverExecutionPrepareEngine.group(DriverExecutionPrepareEngine.java:71)
   	at org.apache.shardingsphere.infra.executor.sql.prepare.AbstractExecutionPrepareEngine.prepare(AbstractExecutionPrepareEngine.java:68)
   	at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.useDriverToExecute(ProxySQLExecutor.java:161)
   	at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:124)
   	at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:113)
   	at org.apache.shardingsphere.proxy.backend.communication.ProxyLockEngine.doExecute(ProxyLockEngine.java:103)
   	at org.apache.shardingsphere.proxy.backend.communication.ProxyLockEngine.execute(ProxyLockEngine.java:81)
   	at org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngine.execute(DatabaseCommunicationEngine.java:98)
   	at org.apache.shardingsphere.proxy.backend.text.data.impl.SchemaAssignedDatabaseBackendHandler.execute(SchemaAssignedDatabaseBackendHandler.java:55)
   	at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.text.PostgreSQLComQueryExecutor.execute(PostgreSQLComQueryExecutor.java:65)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:93)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:71)
   	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)
   Caused by: java.sql.SQLTransientConnectionException: HikariPool-2 - Connection is not available, request timed out after 30000ms.
   	at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:689)
   	at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:196)
   	at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:161)
   	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:100)
   	at org.apache.shardingsphere.proxy.backend.communication.jdbc.datasource.JDBCBackendDataSource.createConnection(JDBCBackendDataSource.java:112)
   	at org.apache.shardingsphere.proxy.backend.communication.jdbc.datasource.JDBCBackendDataSource.createConnections(JDBCBackendDataSource.java:99)
   	... 19 common frames omitted
   ```
   
   following is the config-sharding for proxy:
   
   ```
   schemaName: sbtest
   
   dataSources:
    ds_0:
      url: jdbc:postgresql://192.168.100.20:15432/sbtest?serverTimezone=UTC&useSSL=false
      username: test
      password: test
      connectionTimeoutMilliseconds: 30000
      idleTimeoutMilliseconds: 60000
      maxLifetimeMilliseconds: 1800000
      maxPoolSize: 50
      minPoolSize: 1
      maintenanceIntervalMilliseconds: 30000
    ds_1:
      url: jdbc:postgresql://192.168.100.21:15432/sbtest?serverTimezone=UTC&useSSL=false
      username: test
      password: test
      connectionTimeoutMilliseconds: 30000
      idleTimeoutMilliseconds: 60000
      maxLifetimeMilliseconds: 1800000
      maxPoolSize: 50
      minPoolSize: 1
      maintenanceIntervalMilliseconds: 30000
   
   
   
   rules:
   - !SHARDING
     tables:
       sbtest1:
         actualDataNodes: ds_${0..1}.sbtest1_${0..99}
         tableStrategy:
           standard:
             shardingColumn: id
             shardingAlgorithmName: table_inline_1
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
       sbtest2:
         actualDataNodes: ds_${0..1}.sbtest2_${0..99}
         tableStrategy:
           standard:
             shardingColumn: id
             shardingAlgorithmName: table_inline_2
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
       sbtest3:
         actualDataNodes: ds_${0..1}.sbtest3_${0..99}
         tableStrategy:
           standard:
             shardingColumn: id
             shardingAlgorithmName: table_inline_3
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
       sbtest4:
         actualDataNodes: ds_${0..1}.sbtest4_${0..99}
         tableStrategy:
           standard:
             shardingColumn: id
             shardingAlgorithmName: table_inline_4
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
       sbtest5:
         actualDataNodes: ds_${0..1}.sbtest5_${0..99}
         tableStrategy:
           standard:
             shardingColumn: id
             shardingAlgorithmName: table_inline_5
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
       sbtest6:
         actualDataNodes: ds_${0..1}.sbtest6_${0..99}
         tableStrategy:
           standard:
             shardingColumn: id
             shardingAlgorithmName: table_inline_6
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
       sbtest7:
         actualDataNodes: ds_${0..1}.sbtest7_${0..99}
         tableStrategy:
           standard:
             shardingColumn: id
             shardingAlgorithmName: table_inline_7
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
       sbtest8:
         actualDataNodes: ds_${0..1}.sbtest8_${0..99}
         tableStrategy:
           standard:
             shardingColumn: id
             shardingAlgorithmName: table_inline_8
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
       sbtest9:
         actualDataNodes: ds_${0..1}.sbtest9_${0..99}
         tableStrategy:
           standard:
             shardingColumn: id
             shardingAlgorithmName: table_inline_9
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
       sbtest10:
         actualDataNodes: ds_${0..1}.sbtest10_${0..99}
         tableStrategy:
           standard:
             shardingColumn: id
             shardingAlgorithmName: table_inline_10
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
   
     defaultDatabaseStrategy:
       standard:
         shardingColumn: id
         shardingAlgorithmName: database_inline
   
     shardingAlgorithms:
       database_inline:
         type: INLINE
         props:
           algorithm-expression: ds_${id % 2}
       table_inline_1:
         type: INLINE
         props:
           algorithm-expression: sbtest1_${id % 100}
       table_inline_2:
         type: INLINE
         props:
           algorithm-expression: sbtest2_${id % 100}
       table_inline_3:
         type: INLINE
         props:
           algorithm-expression: sbtest3_${id % 100}
       table_inline_4:
         type: INLINE
         props:
           algorithm-expression: sbtest4_${id % 100}
       table_inline_5:
         type: INLINE
         props:
           algorithm-expression: sbtest5_${id % 100}
       table_inline_6:
         type: INLINE
         props:
           algorithm-expression: sbtest6_${id % 100}
       table_inline_7:
         type: INLINE
         props:
           algorithm-expression: sbtest7_${id % 100}
       table_inline_8:
         type: INLINE
         props:
           algorithm-expression: sbtest8_${id % 100}
       table_inline_9:
         type: INLINE
         props:
           algorithm-expression: sbtest9_${id % 100}
       table_inline_10:
         type: INLINE
         props:
           algorithm-expression: sbtest10_${id % 100}
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
         props:
           worker-id: 123
   ```
   
   BTW, for the same config , it will execute successfully on pg, but got error on opengauss
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] TeslaCN commented on issue #10531: proxy sharding got an exception in a sysbench test

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #10531:
URL: https://github.com/apache/shardingsphere/issues/10531#issuecomment-851240220


   If the `max-connections-size-per-query` is relatively large and the `maxPoolSize` is not large enough, the exception may occurred.
   
   ```
   props:
     max-connections-size-per-query: # a proper value
   ```
   
   Maybe we should adjust the error message to make it easier to understand.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero closed issue #10531: proxy sharding got an exception in a sysbench test

Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #10531:
URL: https://github.com/apache/shardingsphere/issues/10531


   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org