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 2021/01/15 06:47:53 UTC

[GitHub] [shardingsphere] tristaZero opened a new issue #9046: [RDL] Support `Alter ShardingRule`

tristaZero opened a new issue #9046:
URL: https://github.com/apache/shardingsphere/issues/9046


   ### Introduction
   
   Sharding Proxy will support altering sharding rule online, which means Proxy will move the actual tables to the new location.
   This issue is a RDL `Alter ShardingRule`, a trigger for `sharding scaling`.
   
   ```SQL
   ALTER SHARDING RULE(
   add t_order_new t_order_new HASH_MOD(sharding_count=4), 
   modify t_item item_id mod(sharding_count=2)
   ) 
   ```
   
   ### Tasks
   - Support RDL g4 definition
   - Create Statement
   - Post a `RuleConfigurationsPersistEvent` in handler


----------------------------------------------------------------
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] jingshanglu commented on issue #9046: [RDL] Support `Alter ShardingRule`

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


   @terrymanu @tristaZero How about this? 
   `[]` : optional 
   ```
   alter SHARDING RULE (
   modify t_order ['ds_00.t_order_000${0..1}','ds_01.t_order_000${2..3}'] [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   add t_item 'ds_00.t_item_000${0..1}','ds_01.t_item_000${2..3}' [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   [binding_tables t_order,t_item]
   [default_table_strategy order_id HASH_MOD(xxx=xxx)]
   [broadcast_tables tb1, tb2]
   )
   
   create SHARDING RULE (
   modify t_order 'ds_00.t_order_000${0..1}','ds_01.t_order_000${2..3}' [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   add t_item 'ds_00.t_item_000${0..1}','ds_01.t_item_000${2..3}' [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   [binding_tables t_order,t_item]
   [default_table_strategy order_id HASH_MOD(xxx=xxx)]
   [broadcast_tables tb1, tb2]
   )
   ```


----------------------------------------------------------------
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] jingshanglu commented on issue #9046: [RDL] Support `Alter ShardingRule`

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


   @terrymanu @tristaZero What is `HASH_MOD` for? databaseStrategy? tableStrategy? keyGenerateStrategy? maybe we should design  grammar about shardingRule.


----------------------------------------------------------------
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] jingshanglu removed a comment on issue #9046: [RDL] Support `Alter ShardingRule`

Posted by GitBox <gi...@apache.org>.
jingshanglu removed a comment on issue #9046:
URL: https://github.com/apache/shardingsphere/issues/9046#issuecomment-764232091


   @terrymanu @tristaZero How about this? 
   `[]` : optional 
   ```
   alter SHARDING RULE (
   modify t_order ['ds_00.t_order_000${0..1}','ds_01.t_order_000${2..3}'] [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   add t_item 'ds_00.t_item_000${0..1}','ds_01.t_item_000${2..3}' [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   [binding_tables t_order,t_item]
   [default_table_strategy order_id HASH_MOD(xxx=xxx)]
   [broadcast_tables tb1, tb2]
   )
   
   create SHARDING RULE (
   modify t_order 'ds_00.t_order_000${0..1}','ds_01.t_order_000${2..3}' [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   add t_item 'ds_00.t_item_000${0..1}','ds_01.t_item_000${2..3}' [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   [binding_tables t_order,t_item]
   [default_table_strategy order_id HASH_MOD(xxx=xxx)]
   [broadcast_tables tb1, tb2]
   )
   ```


----------------------------------------------------------------
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 #9046: [RDL] Support `Alter ShardingRule`

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


   


----------------------------------------------------------------
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 #9046: [RDL] Support `Alter ShardingRule`

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


   


----------------------------------------------------------------
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] jingshanglu commented on issue #9046: [RDL] Support `Alter ShardingRule`

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


   @terrymanu @tristaZero How about this? 
   `[]` : optional 
   ```
   alter SHARDING RULE (
   modify t_order ['ds_00.t_order_000${0..1}','ds_01.t_order_000${2..3}'] [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   add t_item 'ds_00.t_item_000${0..1}','ds_01.t_item_000${2..3}' [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   [binding_tables t_order,t_item]
   [default_table_strategy order_id HASH_MOD(xxx=xxx)]
   [broadcast_tables tb1, tb2]
   )
   
   create SHARDING RULE (
   modify t_order 'ds_00.t_order_000${0..1}','ds_01.t_order_000${2..3}' [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   add t_item 'ds_00.t_item_000${0..1}','ds_01.t_item_000${2..3}' [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   [binding_tables t_order,t_item]
   [default_table_strategy order_id HASH_MOD(xxx=xxx)]
   [broadcast_tables tb1, tb2]
   )
   ```


----------------------------------------------------------------
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] jingshanglu removed a comment on issue #9046: [RDL] Support `Alter ShardingRule`

Posted by GitBox <gi...@apache.org>.
jingshanglu removed a comment on issue #9046:
URL: https://github.com/apache/shardingsphere/issues/9046#issuecomment-764232091


   @terrymanu @tristaZero How about this? 
   `[]` : optional 
   ```
   alter SHARDING RULE (
   modify t_order ['ds_00.t_order_000${0..1}','ds_01.t_order_000${2..3}'] [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   add t_item 'ds_00.t_item_000${0..1}','ds_01.t_item_000${2..3}' [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   [binding_tables t_order,t_item]
   [default_table_strategy order_id HASH_MOD(xxx=xxx)]
   [broadcast_tables tb1, tb2]
   )
   
   create SHARDING RULE (
   modify t_order 'ds_00.t_order_000${0..1}','ds_01.t_order_000${2..3}' [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   add t_item 'ds_00.t_item_000${0..1}','ds_01.t_item_000${2..3}' [TABLESTRATEGY order_id HASH_MOD(xxx=xxx)] [DATABASESTRATEGY order_id HASH_MOD(xxx=xxx)]  [KEYGENERATESTRATEGY order_id HASH_MOD(xxx=xxx)],
   [binding_tables t_order,t_item]
   [default_table_strategy order_id HASH_MOD(xxx=xxx)]
   [broadcast_tables tb1, tb2]
   )
   ```


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