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/08/10 09:58:31 UTC

[GitHub] [shardingsphere] cqiwencom opened a new issue #11746: Proxy can't route 'select ... for update' to the writeable node

cqiwencom opened a new issue #11746:
URL: https://github.com/apache/shardingsphere/issues/11746


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   ShardingSphere-Proxy 5.0.0-beta
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   
   ### Expected behavior
   When executing 'select ... for update' , the select statement should be routed to the writable node.
   
   ### Actual behavior
   When executing 'select ... for update' , the select statement was routed to the readable node.
   
   ### Reason analyze (If you can)
   Proxy can't route 'select ... for update' to the writeable node
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   schemaName: testdb
   
   dataSources:
     write_ds:
       url: jdbc:mysql://127.0.0.1:6446/testdb?serverTimezone=UTC&useSSL=false
       username: root
       password: root
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     read_ds_0:
       url: jdbc:mysql://127.0.0.1:6447/testdb?serverTimezone=UTC&useSSL=false
       username: root
       password: root
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
   - !READWRITE_SPLITTING
     dataSources:
       pr_ds:
         writeDataSourceName: write_ds
         readDataSourceNames:
           - read_ds_0
   
   
   When executing 'select ... for update' , the select statement was routed to read_ds_0. But in fact, this select statement should be routed to node write_ds.
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] tristaZero commented on issue #11746: Proxy can't route 'select ... for update' to the writeable node

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


   @cqiwencom Could you pull the latest commit from the master branch and give it a test? Look forward to your reply, thanks.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] strongduanmu commented on issue #11746: Proxy can't route 'select ... for update' to the writeable node

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


   @cqiwencom Can you try the master branch? I used the master branch to test and the routing results were normal.
   
   ```
   [INFO ] 2021-08-11 11:53:59.301 [ShardingSphere-Command-1] ShardingSphere-SQL - Logic SQL: select * from actor for update
   [INFO ] 2021-08-11 11:53:59.301 [ShardingSphere-Command-1] ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(limit=Optional.empty, lock=Optional[org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.LockSegment@137e13b5], window=Optional.empty)
   [INFO ] 2021-08-11 11:53:59.301 [ShardingSphere-Command-1] ShardingSphere-SQL - Actual SQL: write_ds ::: select * from actor for update
   ```


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] tristaZero commented on issue #11746: Proxy can't route 'select ... for update' to the writeable node

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


   @cqiwencom Could you pull the latest commit from the master branch and give it a test? Look forward to your reply, thanks.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] cqiwencom commented on issue #11746: Proxy can't route 'select ... for update' to the writeable node

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


   > @cqiwencom Can you try the master branch? I used the master branch to test and the routing results were normal.
   > 
   > ```
   > [INFO ] 2021-08-11 11:53:59.301 [ShardingSphere-Command-1] ShardingSphere-SQL - Logic SQL: select * from actor for update
   > [INFO ] 2021-08-11 11:53:59.301 [ShardingSphere-Command-1] ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(limit=Optional.empty, lock=Optional[org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.LockSegment@137e13b5], window=Optional.empty)
   > [INFO ] 2021-08-11 11:53:59.301 [ShardingSphere-Command-1] ShardingSphere-SQL - Actual SQL: write_ds ::: select * from actor for update
   > ```
   
   在我的日志文件中没有看到您上面的这种信息。但有如下的报错信息显示在日志中:
   
   [ERROR] 2021-08-12 12:31:20.828 [Connection-3-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
   java.lang.ClassCastException: org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression cannot be cast to org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement
   	at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserExecutor.parse(SQLStatementParserExecutor.java:47)
   	at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine.parse(SQLStatementParserEngine.java:48)
   	at org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse0(ShardingSphereSQLParserEngine.java:67)
   	at org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(ShardingSphereSQLParserEngine.java:56)
   	at org.apache.shardingsphere.proxy.backend.text.TextProtocolBackendHandlerFactory.newInstance(TextProtocolBackendHandlerFactory.java:86)
   	at org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.<init>(MySQLComQueryPacketExecutor.java:52)
   	at org.apache.shardingsphere.proxy.frontend.mysql.command.MySQLCommandExecutorFactory.newInstance(MySQLCommandExecutorFactory.java:73)
   	at org.apache.shardingsphere.proxy.frontend.mysql.command.MySQLCommandExecuteEngine.getCommandExecutor(MySQLCommandExecuteEngine.java:60)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:96)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)
   	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)


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] RaigorJiang commented on issue #11746: Proxy can't route 'select ... for update' to the writeable node

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


   Since this issue has been inactive for more than 30 days, we will close it. 
   If you still have related questions, please submit a new issue, thank you.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] strongduanmu commented on issue #11746: Proxy can't route 'select ... for update' to the writeable node

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


   @cqiwencom From your log, it looks like a parsing exception, not a readwrite splitting exception. Can you try the master branch?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] cqiwencom edited a comment on issue #11746: Proxy can't route 'select ... for update' to the writeable node

Posted by GitBox <gi...@apache.org>.
cqiwencom edited a comment on issue #11746:
URL: https://github.com/apache/shardingsphere/issues/11746#issuecomment-897342018


   > @cqiwencom Can you try the master branch? I used the master branch to test and the routing results were normal.
   > 
   > ```
   > [INFO ] 2021-08-11 11:53:59.301 [ShardingSphere-Command-1] ShardingSphere-SQL - Logic SQL: select * from actor for update
   > [INFO ] 2021-08-11 11:53:59.301 [ShardingSphere-Command-1] ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(limit=Optional.empty, lock=Optional[org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.LockSegment@137e13b5], window=Optional.empty)
   > [INFO ] 2021-08-11 11:53:59.301 [ShardingSphere-Command-1] ShardingSphere-SQL - Actual SQL: write_ds ::: select * from actor for update
   > ```
   
   I don't see the above information in my log file. However, the following error messages are displayed in the log:
   
   [ERROR] 2021-08-12 12:31:20.828 [Connection-3-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
   java.lang.ClassCastException: org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression cannot be cast to org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement
   	at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserExecutor.parse(SQLStatementParserExecutor.java:47)
   	at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine.parse(SQLStatementParserEngine.java:48)
   	at org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse0(ShardingSphereSQLParserEngine.java:67)
   	at org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(ShardingSphereSQLParserEngine.java:56)
   	at org.apache.shardingsphere.proxy.backend.text.TextProtocolBackendHandlerFactory.newInstance(TextProtocolBackendHandlerFactory.java:86)
   	at org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.<init>(MySQLComQueryPacketExecutor.java:52)
   	at org.apache.shardingsphere.proxy.frontend.mysql.command.MySQLCommandExecutorFactory.newInstance(MySQLCommandExecutorFactory.java:73)
   	at org.apache.shardingsphere.proxy.frontend.mysql.command.MySQLCommandExecuteEngine.getCommandExecutor(MySQLCommandExecuteEngine.java:60)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:96)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)
   	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)


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] cqiwencom commented on issue #11746: Proxy can't route 'select ... for update' to the writeable node

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


   > @strongduanmu Hi any progress?
   > 
   > @cqiwencom thanks for your attention, I can see your many activities these days. Are you testing ShardingProxy?
   
   Yes,i do.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] tristaZero commented on issue #11746: Proxy can't route 'select ... for update' to the writeable node

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


   @strongduanmu Hi any progress?
   
   @cqiwencom thanks for your attention, I can see your many activities these days. Are you testing ShardingProxy? 


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] RaigorJiang closed issue #11746: Proxy can't route 'select ... for update' to the writeable node

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


   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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