iamif3000 opened a new issue #8215:
URL: https://github.com/apache/shardingsphere/issues/8215
## Bug Report
### Which version of ShardingSphere did you use?
tag 4.1.1
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
sharding-proxy
### Expected behavior
read request shoud be sent to master db node.
### Actual behavior
read request routes to slave db node.
### Reason analyze (If you can)
I think the status of the transaction is not updated correctly after the
execution of write request.
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
configuration, when exception occur etc.
`CREATE TABLE `test` ( `id` BIGINT ( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR ( 200 ) DEFAULT NULL, PRIMARY KEY ( `id` ) ) ENGINE = INNODB
DEFAULT CHARSET = utf8;`
- login with mysql client
- run the following sql
- start transaction;
- insert into test values(null, 'tran1');
- select id,name from test;
- commit;
- check the log output of sharding-proxy
> [INFO ] 11:29:25.186 [ShardingSphere-Command-3] ShardingSphere-SQL -
Actual SQL: master_ds ::: insert into test values(null, 'tran1')
> [INFO ] 11:29:34.688 [ShardingSphere-Command-0] ShardingSphere-SQL -
Actual SQL: slave_ds_0 ::: select id,name from test
### Example codes for reproduce this issue (such as a github link).
None
----------------------------------------------------------------
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:
[email protected]