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 2020/08/17 11:44:42 UTC

[GitHub] [shardingsphere] satheesh-moorthy opened a new issue #6898: Force specifying hint when using hint sharding strategy configuration

satheesh-moorthy opened a new issue #6898:
URL: https://github.com/apache/shardingsphere/issues/6898


   I have a table employee and it is sharded between 3 databases. It is represent by 3 datasources.
   
   I am using HintShardingStrategyConfiguration. 
   
   Everything works fine when I set hint, but if hint is not set then all the 3 datasources are queried. I want to control this behaviour where if hint is not set then it should either throw exception or fallback to default datasource.
   
   Is this already available or not supported.
   
   Can you please help
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] satheesh-moorthy commented on issue #6898: Force specifying hint when using hint sharding strategy configuration

Posted by GitBox <gi...@apache.org>.
satheesh-moorthy commented on issue #6898:
URL: https://github.com/apache/shardingsphere/issues/6898#issuecomment-675260350


   Hi @tristaZero 
   
   Thanks a lot for taking your time and clarifying.
   
   Actually the application I am working on is more complex where the sharding column will not be present in SQL and we use separate lookup table to identify the shard based on metadata. 
   
   So we can only use hint strategy and not inline or standard. Using the metadata in the request we will use a lookup table to find the shard and set it in hintmanager.
   
   We have more than 20 shards, and by some programming error if shard is not set in hintmanager before some query is run then all the 20 shards will be queried, which will be not advisable.
   
   So wanted to know if there is any setting to control this behaviour
   
   
   
   
   
   
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #6898: Force specifying hint when using hint sharding strategy configuration

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


   Hi @satheesh-moorthy 
   
   If so, I am sorry that currently there is no other better way than setting `hint manager` to route SQLs for this `logic table`. 
   Please look at [Hint router](https://github.com/apache/shardingsphere/blob/f34ab740629545c530f26cc29eaf90ea64a8cf19/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/main/java/org/apache/shardingsphere/sharding/route/engine/type/standard/ShardingStandardRoutingEngine.java#L78)  for more detail.
   
   Best,
   Trista


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #6898: Force specifying hint when using hint sharding strategy configuration

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


   Hi @satheesh-moorthy ,
   
   Thanks for your issue. 
   
   > if hint is not set and a query is performed then all the 3 datasources are queried.
   
   Firstly, suppose you do not set any values to `hintManger`, we can not `filter the target databases or tables` using these values. Therefore what you mentioned will follow.
   Secondly, just out of my curiosity, why do you consider using [other sharding strategies](https://shardingsphere.apache.org/document/legacy/4.x/document/en/features/sharding/concept/sharding/) like `Inline` or `Standard`? You do not need to set any values using them. 
   
   Cheers,
   Trista


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] satheesh-moorthy commented on issue #6898: Force specifying hint when using hint sharding strategy configuration

Posted by GitBox <gi...@apache.org>.
satheesh-moorthy commented on issue #6898:
URL: https://github.com/apache/shardingsphere/issues/6898#issuecomment-675315317


   Hi @tristaZero 
   
   Thanks for clarifying. Appreciate your help 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero closed issue #6898: Force specifying hint when using hint sharding strategy configuration

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


   


----------------------------------------------------------------
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:
users@infra.apache.org