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/12/14 04:49:22 UTC

[GitHub] [shardingsphere] strongduanmu opened a new issue, #22866: Parameters in the SQL Parser Rule cannot be dynamically updated through DistSQL

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

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   [bf17dc0](https://github.com/apache/shardingsphere/commit/bf17dc0addc1e49658d8c222da7b79d79b495b40)
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-JDBC + ShardingSphere-Proxy
   
   ### Expected behavior
   
   Execute following distsql through Proxy first:
   
   ```sql
   ALTER SQL_PARSER RULE SQL_COMMENT_PARSE_ENABLE=true, PARSE_TREE_CACHE(INITIAL_CAPACITY=128, MAXIMUM_SIZE=1024), SQL_STATEMENT_CACHE(INITIAL_CAPACITY=2000, MAXIMUM_SIZE=65535);
   ```
   
   And then execute `/* SHARDINGSPHERE_HINT: DATA_SOURCE_NAME=ds_0 */ SELECT * FROM t_order;` through JDBC. I hope this sql can be executed in ds_0 datasource.
   
   ### Actual behavior
   
   The sql `SELECT * FROM t_order` execute in all sharding datasources.
   
   ### Reason analyze (If you can)
   
   ALTER SQL_PARSER RULE did not update the parameter value in memory, causing `SQL_COMMENT_PARSE_ENABLE` to remain false. Currently, restarting can solve the problem, but this is a bad experience for users.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### 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.apache.org

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


[GitHub] [shardingsphere] strongduanmu closed issue #22866: Parameters in the SQL Parser Rule cannot be dynamically updated through DistSQL

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu closed issue #22866: Parameters in the SQL Parser Rule cannot be dynamically updated through DistSQL
URL: https://github.com/apache/shardingsphere/issues/22866


-- 
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 #22866: Parameters in the SQL Parser Rule cannot be dynamically updated through DistSQL

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #22866:
URL: https://github.com/apache/shardingsphere/issues/22866#issuecomment-1407366303

   Hi @strongduanmu 
   I tested the scenario you described and found that `SQL Parser Rule` can be updated dynamically.
   However, due to the notification from the governance center and the time-consuming by local metadata refresh, there is a certain delay in this process.
   
   ### In JDBC, before `ALTER SQL_PARSER RULE`
   <img width="976" alt="image" src="https://user-images.githubusercontent.com/5668787/215260343-1c4e0906-6cfc-4340-a299-511e1a4e0bd9.png">
   
   ### In Proxy, `ALTER SQL_PARSER RULE`
   <img width="1215" alt="image" src="https://user-images.githubusercontent.com/5668787/215260404-e8444a35-d495-47fe-994c-9ddaaa5ec652.png">
   
   ### In JDBC, after `ALTER SQL_PARSER RULE`
   <img width="993" alt="image" src="https://user-images.githubusercontent.com/5668787/215260395-4855303a-94e6-478a-8f76-d24698a166e9.png">
   
   Note: In the above process, JDBC is always the same process, there is no restart


-- 
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 #22866: Parameters in the SQL Parser Rule cannot be dynamically updated through DistSQL

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

   I will follow up.


-- 
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 #22866: Parameters in the SQL Parser Rule cannot be dynamically updated through DistSQL

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #22866:
URL: https://github.com/apache/shardingsphere/issues/22866#issuecomment-1407367047

   In addition, since the PreparedStatement may be cached, the SQLParserRule may not be re-acquired every time during the SQL execution, which may cause the problem you describe.


-- 
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 #22866: Parameters in the SQL Parser Rule cannot be dynamically updated through DistSQL

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #22866:
URL: https://github.com/apache/shardingsphere/issues/22866#issuecomment-1411285598

   @RaigorJiang Thank you for your feedback. There is indeed a delay in the governance center, and I have also found other problems caused by delays during testing. 
   
   


-- 
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 #22866: Parameters in the SQL Parser Rule cannot be dynamically updated through DistSQL

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #22866:
URL: https://github.com/apache/shardingsphere/issues/22866#issuecomment-1411305285

   Since this issue is caused by zookeeper latency, not a bug, I will close this issue.


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