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 2022/01/07 02:15:41 UTC

[GitHub] [shardingsphere] userkdg opened a new issue #14584: readwrite_splitting hint source write fail

userkdg opened a new issue #14584:
URL: https://github.com/apache/shardingsphere/issues/14584


   ### Which version of ShardingSphere did you use?
   5.1.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   Proxy
   
   ### Expected behavior
   ``` 
   MySQL [sharding_rw]> preview select * from t_encrypt;
   +------------------+-------------------------+
   | data_source_name | sql                     |
   +------------------+-------------------------+
   | write_ds       | select * from t_encrypt |
   +------------------+-------------------------+
   ``` 
   ### Actual behavior
   ```
   MySQL [sharding_rw]> preview select * from t_encrypt;
   +------------------+-------------------------+
   | data_source_name | sql                     |
   +------------------+-------------------------+
   | read_ds_1        | select * from t_encrypt |
   +------------------+-------------------------+
   ```
   ### Reason analyze (If you can)
   hint fail 
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   steps: 
   ``` 
   MySQL [sharding_rw]> show schema resources;
   +-----------+-------+---------------+------+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | name      | type  | host          | port | db       | attribute                                                                                                                                                   |
   +-----------+-------+---------------+------+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | read_ds_1 | MySQL | 192.168.234.8 | 4403 | sharding | {"maxLifetimeMilliseconds":1800000,"readOnly":true,"minPoolSize":1,"idleTimeoutMilliseconds":60000,"maxPoolSize":50,"connectionTimeoutMilliseconds":30000}  |
   | read_ds_0 | MySQL | 192.168.234.8 | 4402 | sharding | {"maxLifetimeMilliseconds":1800000,"readOnly":true,"minPoolSize":1,"idleTimeoutMilliseconds":60000,"maxPoolSize":50,"connectionTimeoutMilliseconds":30000}  |
   | write_ds  | MySQL | 192.168.234.8 | 4401 | sharding | {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":1,"idleTimeoutMilliseconds":60000,"maxPoolSize":50,"connectionTimeoutMilliseconds":30000} |
   +-----------+-------+---------------+------+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
   3 rows in set (0.00 sec)
   
   MySQL [sharding_rw]> show readwrite_splitting hint status;
   +--------+
   | source |
   +--------+
   | auto   |
   +--------+
   1 row in set (0.00 sec)
   
   MySQL [sharding_rw]> set readwrite_splitting hint source = write;
   Query OK, 0 rows affected (0.01 sec)
   
   MySQL [sharding_rw]> show readwrite_splitting hint status;
   +--------+
   | source |
   +--------+
   | write  |
   +--------+
   1 row in set (0.01 sec)
   
   MySQL [sharding_rw]> preview select * from t_encrypt;
   +------------------+-------------------------+
   | data_source_name | sql                     |
   +------------------+-------------------------+
   | read_ds_1        | select * from t_encrypt |
   +------------------+-------------------------+
   1 row in set (0.00 sec)
   
   ```
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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] lwclover commented on issue #14584: readwrite_splitting hint source write fail

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


   > need rule
   > 
   > ```
   > CREATE READWRITE_SPLITTING RULE ms_group_0 ( WRITE_RESOURCE=write_ds, READ_RESOURCES(read_ds_0,read_ds_1), TYPE(NAME=random) );
   > ```
   
   Is there a problem with hint?


-- 
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] userkdg closed issue #14584: readwrite_splitting hint source write fail

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


   


-- 
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] userkdg commented on issue #14584: readwrite_splitting hint source write fail

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


   need rule
   ``` 
   CREATE READWRITE_SPLITTING RULE ms_group_0 ( WRITE_RESOURCE=write_ds, READ_RESOURCES(read_ds_0,read_ds_1), TYPE(NAME=random) );
   ``` 


-- 
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] lwclover commented on issue #14584: readwrite_splitting hint source write fail

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


   > need rule
   > 
   > ```
   > CREATE READWRITE_SPLITTING RULE ms_group_0 ( WRITE_RESOURCE=write_ds, READ_RESOURCES(read_ds_0,read_ds_1), TYPE(NAME=random) );
   > ```
   
   Is there a problem with hint?


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