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/04/14 02:46:04 UTC

[GitHub] [shardingsphere] glon commented on issue #10063: Proxy broadcastTables select * error

glon commented on issue #10063:
URL: https://github.com/apache/shardingsphere/issues/10063#issuecomment-819180886


   1. We've set `sql.show = true`
   
   When executing `select * from city`, could not get the answer, and the selected database will lost, like :
   ```
   sharding_user@localhost:6033 [sharding_db]>select * from city;
   Query OK, 0 rows affected, 25971 warnings (0.01 sec)
   
   sharding_user@localhost:6033 [(none)]>
   ```
   
   Here's the logs/stdout.log recording when executing the SQL :
   ```
   [INFO ] 10:37:36.364 [ShardingSphere-Command-4] ShardingSphere-SQL - Logic SQL: select * from city
   [INFO ] 10:37:36.364 [ShardingSphere-Command-4] ShardingSphere-SQL - SQLStatement: SelectStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement@4c958aed, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@4365ad34), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@4365ad34, projectionsContext=ProjectionsContext(startIndex=7, stopIndex=7, distinctRow=false, projections=[ShorthandProjection(owner=Optional.empty, actualColumns=[])]), groupByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.groupby.GroupByContext@25372307, orderByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.orderby.OrderByContext@35e56d5a, paginationContext=org.apache.shardingsphere.sql.parser.binder.segment.select.pagination.PaginationContext@55474be9, containsSubquery=false)
   [INFO ] 10:37:36.364 [ShardingSphere-Command-4] ShardingSphere-SQL - Actual SQL: ds_0 ::: select * from city
   [WARN ] 10:37:36.364 [ShardingSphere-Command-4] com.zaxxer.hikari.pool.PoolBase - HikariPool-1 - Failed to validate connection com.mysql.jdbc.JDBC4Connection@3ba54078 (No operations allowed after connection closed.). Possibly consider using a shorter maxLifetime value.
   [ERROR] 10:37:36.500 [ShardingSphere-Command-4] o.a.s.s.f.c.CommandExecutorTask - Exception occur: 
   java.lang.NullPointerException: null
   	at com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:6300)
   	at com.zaxxer.hikari.pool.HikariProxyResultSet.next(HikariProxyResultSet.java)
   	at org.apache.shardingsphere.sharding.execute.sql.execute.result.StreamQueryResult.next(StreamQueryResult.java:50)
   	at org.apache.shardingsphere.sharding.merge.dql.iterator.IteratorStreamMergedResult.next(IteratorStreamMergedResult.java:41)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.next(JDBCDatabaseCommunicationEngine.java:138)
   	at org.apache.shardingsphere.shardingproxy.backend.text.query.QueryBackendHandler.next(QueryBackendHandler.java:57)
   	at org.apache.shardingsphere.shardingproxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.next(MySQLComQueryPacketExecutor.java:135)
   	at org.apache.shardingsphere.shardingproxy.frontend.mysql.command.MySQLCommandExecuteEngine.writeQueryData(MySQLCommandExecuteEngine.java:81)
   	at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:101)
   	at org.apache.shardingsphere.shardingproxy.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)
   [INFO ] 10:37:36.501 [ShardingSphere-Command-5] ShardingSphere-SQL - Logic SQL: SELECT DATABASE()
   [INFO ] 10:37:36.501 [ShardingSphere-Command-5] ShardingSphere-SQL - SQLStatement: SelectStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement@46fe6fd1, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@18a691b4), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@18a691b4, projectionsContext=ProjectionsContext(startIndex=7, stopIndex=16, distinctRow=false, projections=[ExpressionProjection(expression=DATABASE(), alias=Optional.empty)]), groupByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.groupby.GroupByContext@7660743e, orderByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.orderby.OrderByContext@4a1ab3ef, paginationContext=org.apache.shardingsphere.sql.parser.binder.segment.select.pagination.PaginationContext@7fafcd9a, containsSubquery=false)
   [INFO ] 10:37:36.501 [ShardingSphere-Command-5] ShardingSphere-SQL - Actual SQL: ds_1 ::: SELECT DATABASE()
   [WARN ] 10:37:36.501 [ShardingSphere-Command-5] com.zaxxer.hikari.pool.PoolBase - HikariPool-2 - Failed to validate connection com.mysql.jdbc.JDBC4Connection@5328c8ea (No operations allowed after connection closed.). Possibly consider using a shorter maxLifetime value.
   ```
   
   server.yaml :
   ```
   authentication:
     users:
       root:
         password: root
       sharding:
         password: sharding
         authorizedSchemas: sharding_db
   
   props:
     max.connections.size.per.query: 9
     acceptor.size: 16  # The default value is available processors count * 2.
     executor.size: 16  # Infinite by default.
     proxy.frontend.flush.threshold: 128  # The default value is 128.
     proxy.transaction.type: LOCAL
     proxy.opentracing.enabled: false
     proxy.hint.enabled: false
     query.with.cipher.column: true
     sql.show: true
     allow.range.query.with.inline.sharding: false
   ```
   
   2. SQL like `select id, name from city`, `insert into city (id, name) values (...)[,(...)]` work well.
   `insert into city values (...)[,(...)]` does not work as well.
   
   3. Other broadcast tables  have the same problem, but sharding tables work well.
   
   


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