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/07/13 10:02:05 UTC

[GitHub] [shardingsphere] wsm12138 opened a new issue, #19102: Maybe we can verify dataSource in ReadWrite-splitting rules,before create ReadWrite-splitting rules.

wsm12138 opened a new issue, #19102:
URL: https://github.com/apache/shardingsphere/issues/19102

   ## Feature Request
   
   **For English only**, other languages will not accept.
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot make decision by current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Is your feature request related to a problem?
   NO
   ### Describe the feature you would like.
   #### First of all, we can use DistSQL create two READWRITE_SPLITTING RULE in one logic schema.
   eg:
   ```
   CREATE READWRITE_SPLITTING RULE ms_group_0 (
   WRITE_RESOURCE=write_ds,
   READ_RESOURCES(read_ds_0,read_ds_1),
   TYPE(NAME=random)
   );
   CREATE READWRITE_SPLITTING RULE ms_group_1(
   WRITE_RESOURCE=write_ds,
   READ_RESOURCES(read_ds_0,read_ds_1),
   TYPE(NAME=random)
   );
   
   ```
   <img width="665" alt="image" src="https://user-images.githubusercontent.com/86462784/178705641-fbc56d1e-07e9-48a6-af7a-8e8328cda378.png">
   
   #### But when we use select in this logic schema,we can't figure out how to route,because of we have same table in two rules.
   And it is not legal, because we cant't have two same table in one schema.
   
   #### So,can we verify dataSource in ReadWrite-splitting rules? Ensures that a logical schema does not exist the same table and cannot be routed.
   


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

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


[GitHub] [shardingsphere] wsm12138 commented on issue #19102: Maybe we can verify dataSource in ReadWrite-splitting rules,before create ReadWrite-splitting rules.

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

   @zhaojinchao95  @RaigorJiang  
   plz help have a look


-- 
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] zhaojinchao95 commented on issue #19102: Maybe we can verify dataSource in ReadWrite-splitting rules,before create ReadWrite-splitting rules.

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

   This problem cause are `DistSQL` update memory metadata first, and then, call `governance api` to persist configuration. compute node listen zk event to rebuild readwrite rule throws error, this work flow are asynchronous.


-- 
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] peilinqian commented on issue #19102: Maybe we can verify dataSource in ReadWrite-splitting rules,before create ReadWrite-splitting rules.

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

   we find java version: java8, full_version=1.8.0_342, full_path=/home/peilq_sharding/bisheng-jdk1.8.0_342//bin/java
   ShardingSphere-5.2.1-SNAPSHOT
   Commit ID: dirty-4114e7ee4cbe5923c2b403a3e86d1f23355cadf3
   Commit Message: Fix parse exception when execute insert statement with negative value (#21197)
   Branch: 4114e7ee4cbe5923c2b403a3e86d1f23355cadf3
   Build time: 2022-09-27T16:37:07+0800
   
   ```
   tpch_db=> CREATE READWRITE_SPLITTING RULE ms_group_0 (
   tpch_db(> WRITE_RESOURCE=resource_0 ,
   tpch_db(> READ_RESOURCES(resource_0 ,resource_0),
   tpch_db(> TYPE(NAME="random")
   tpch_db(> );
   ERROR:  Invalid `readwrite splitting` rule `ms_group_0`, error message is: Can not config duplicate read resource `resource_0` in database `tpch_db`
   tpch_db=> CREATE READWRITE_SPLITTING RULE ms_group_0 (
   tpch_db(> WRITE_RESOURCE=resource_0 ,
   tpch_db(> READ_RESOURCES(resource_0),
   tpch_db(> TYPE(NAME="random")
   tpch_db(> );
   
   SUCCESS
   tpch_db=> CREATE READWRITE_SPLITTING RULE ms_group_0 (
   tpch_db(> WRITE_RESOURCE=resource_1 ,
   tpch_db(> READ_RESOURCES(resource_0),
   tpch_db(> TYPE(NAME="random")
   tpch_db(> );
   ERROR:  Duplicate readwrite splitting rule names `[ms_group_0]` in database `tpch_db`
   tpch_db=> CREATE READWRITE_SPLITTING RULE ms_group_0 (
   tpch_db(> WRITE_RESOURCE=resource_0 ,
   tpch_db(> READ_RESOURCES(resource_1),
   tpch_db(> TYPE(NAME="random")
   tpch_db(> );
   ERROR:  Duplicate readwrite splitting rule names `[ms_group_0]` in database `tpch_db`
   tpch_db=> CREATE READWRITE_SPLITTING RULE ms_group_0 (
   tpch_db(> WRITE_RESOURCE=resource_1 ,
   tpch_db(> READ_RESOURCES(resource_1),
   tpch_db(> TYPE(NAME="random")
   tpch_db(> );
   ERROR:  Duplicate readwrite splitting rule names `[ms_group_0]` in database `tpch_db`
   tpch_db=>
   tpch_db=>
   tpch_db=>
   tpch_db=> CREATE READWRITE_SPLITTING RULE ms_group_1 (
   WRITE_RESOURCE=resource_1 ,
   READ_RESOURCES(resource_1),
   TYPE(NAME="random")
   );
   SUCCESS
   tpch_db=>
   
   ```


-- 
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 #19102: Maybe we can verify dataSource in ReadWrite-splitting rules,before create ReadWrite-splitting rules.

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

   @wsm12138 I found `RuleConfigurationChecker` a good place to add validation logic, but currently Proxy doesn't use it. I will add a `RuleConfigurationChecker` call to the Proxy and migrate various rule checking logic to `RuleConfigurationChecker`.


-- 
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] peilinqian commented on issue #19102: Maybe we can verify dataSource in ReadWrite-splitting rules,before create ReadWrite-splitting rules.

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

   ```
   split_db=> CREATE READWRITE_SPLITTING RULE ms_group_0 (
   split_db(> WRITE_RESOURCE=write_0,
   split_db(> READ_RESOURCES(read1_0),
   split_db(> TYPE(NAME="random")
   split_db(> );
   ERROR:  Can not config duplicate write data source `write_0` in database `split_db`.
   split_db=> CREATE READWRITE_SPLITTING RULE ms_group_1(
   split_db(> WRITE_RESOURCE=write_0,
   split_db(> READ_RESOURCES(read1_0),
   split_db(> TYPE(NAME="random")
   split_db(> );
   ERROR:  Can not config duplicate write data source `write_0` in database `split_db`.
   split_db=>
   split_db=> SHOW READWRITE_SPLITTING RULES;
       name    | auto_aware_data_source_name | write_data_source_query_enabled | write_data_source_name | read_data_source_names |   load_balancer_type    | load_balancer_props
   ------------+-----------------------------+---------------------------------+------------------------+------------------------+-------------------------+---------------------
    ds_0       |                             |                                 | write_0                | read0_0                | TRANSACTION_ROUND_ROBIN |
    ds_1       |                             |                                 | write_1                | read1_0                | TRANSACTION_ROUND_ROBIN |
    ms_group_0 |                             |                                 | write_0                | read1_0                | random                  |
    ms_group_1 |                             |                                 | write_0                | read1_0                | random                  |
   (4 rows)
   
   ```


-- 
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] wsm12138 commented on issue #19102: Maybe we can verify dataSource in ReadWrite-splitting rules,before create ReadWrite-splitting rules.

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

   @peilinqian 
   I found this issue fixed by https://github.com/apache/shardingsphere/pull/21093.
   
   <img width="953" alt="image" src="https://user-images.githubusercontent.com/86462784/191426413-6ce9dfd5-5803-4f97-96a0-02cbfd8b33d9.png">
   
   
   <img width="1070" alt="image" src="https://user-images.githubusercontent.com/86462784/191426482-c6657a7a-d887-4880-ba62-6bdc4be04c3e.png">
   


-- 
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 #19102: Maybe we can verify dataSource in ReadWrite-splitting rules,before create ReadWrite-splitting rules.

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

   Yes, by design, read resource and write resource may be the same.


-- 
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] zjcnb closed issue #19102: Maybe we can verify dataSource in ReadWrite-splitting rules,before create ReadWrite-splitting rules.

Posted by GitBox <gi...@apache.org>.
zjcnb closed issue #19102: Maybe we can verify dataSource in ReadWrite-splitting rules,before create  ReadWrite-splitting rules.
URL: https://github.com/apache/shardingsphere/issues/19102


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