strongduanmu opened a new issue #10605:
URL: https://github.com/apache/shardingsphere/issues/10605
## Bug Report
### Which version of ShardingSphere did you use?
master branch
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy & governance
### Expected behavior
Alter readwrite splitting rule success and does not affect other rule
configurations.
### Actual behavior
Before execute `alter readwrite splitting rule` statement, the metadata is:
```yaml
!!map
- !SHARDING
bindingTables:
- t_order,t_order_item
broadcastTables:
- t_config
defaultDatabaseStrategy:
standard:
shardingAlgorithmName: database_inline
shardingColumn: user_id
defaultTableStrategy:
none: ''
keyGenerators:
snowflake:
props:
worker-id: 123
type: SNOWFLAKE
shardingAlgorithms:
database_inline:
props:
algorithm-expression: ds_${user_id % 2}
type: INLINE
t_order_inline:
props:
algorithm-expression: t_order_${order_id % 2}
type: INLINE
t_order_new_inline:
props:
algorithm-expression: t_order_new_${order_id % 2}
type: INLINE
t_order_item_inline:
props:
algorithm-expression: t_order_item_${order_id % 2}
type: INLINE
tables:
t_order:
actualDataNodes: ds_${0..1}.t_order_${0..1}
keyGenerateStrategy:
column: order_id
keyGeneratorName: snowflake
logicTable: t_order
tableStrategy:
standard:
shardingAlgorithmName: t_order_inline
shardingColumn: order_id
t_order_item:
actualDataNodes: ds_${0..1}.t_order_item_${0..1}
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
logicTable: t_order_item
tableStrategy:
standard:
shardingAlgorithmName: t_order_item_inline
shardingColumn: order_id
t_user:
actualDataNodes: ds_0.t_user_0
logicTable: t_user
t_user_new:
actualDataNodes: ds_0.t_user_new_0
logicTable: t_user_new
- !READWRITE_SPLITTING
dataSources:
ms_group_0:
loadBalancerName: ms_group_0_random
readDataSourceNames:
- replica_ds_0
- replica_ds_1
writeDataSourceName: primary_ds
loadBalancers:
ms_group_0_random:
type: random
```
After execute `alter readwrite splitting rule` statement, the metadata is:
```yaml
!!map
- !READWRITE_SPLITTING
dataSources:
ms_group_0:
loadBalancerName: ms_group_0_ROUND_ROBIN
readDataSourceNames:
- replica_ds_0
- replica_ds_1
- replica_ds_2
writeDataSourceName: primary_ds
loadBalancers:
ms_group_0_ROUND_ROBIN:
props:
read_weight: '''2:0'''
type: ROUND_ROBIN
```
### Reason analyze (If you can)
Not post all rules after execute `alter readwrite splitting rule` statement.
--
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:
[email protected]