You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "thswlsqls (via GitHub)" <gi...@apache.org> on 2026/08/07 09:36:44 UTC
[I] Readwrite-splitting rule configuration checker does not evaluate inline expressions in data source names [shardingsphere]
thswlsqls opened a new issue, #39373:
URL: https://github.com/apache/shardingsphere/issues/39373
## Bug Report
### Which version of ShardingSphere did you use?
master @ ba53784e172
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
Both
### Expected behavior
Checking passes for data source groups configured with Row Value Expressions. `docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/rules/readwrite-splitting.en.md` documents `writeDataSourceName` and `readDataSourceNames` as names which "uses Groovy's Row Value Expressions SPI implementation to parse by default".
### Actual behavior
`IMPORT DATABASE CONFIGURATION` fails with `MissingRequiredStorageUnitsException` for the literal name `write_ds_${0..1}`, although `write_ds_0` and `write_ds_1` are registered. With a `WEIGHT` load balancer, checking additionally fails with `AlgorithmInitializationException: Target 'read_ds_0' is required in database 'foo_db'`.
### Reason analyze (If you can)
`ReadwriteSplittingRuleConfigurationChecker` (`features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/checker/ReadwriteSplittingRuleConfigurationChecker.java`) returns configured names verbatim from `getRequiredDataSourceNames()` (line 72) and passes them verbatim to `LoadBalanceAlgorithm.check()` in `checkLoadBalancer()` (line 67). Both should evaluate inline expressions first, as `ReadwriteSplittingRule.createStaticDataSourceGroupRules()`, `ReadwriteSplittingDataSourceRuleConfigurationChecker.checkActualSourceNames()` and `ShardingRuleConfigurationChecker.getRequiredDataSourceNames()` already do.
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
Configure a readwrite-splitting group with `writeDataSourceName: write_ds_${0..1}`, `readDataSourceNames: read_ds_${0..1}` and a `WEIGHT` load balancer keyed by `read_ds_0`/`read_ds_1`, then import it. Background: #23576 reports this exception from a different cause.
### Example codes for reproduce this issue (such as a github link).
N/A
--
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
Re: [I] Readwrite-splitting rule configuration checker does not evaluate inline expressions in data source names [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #39373: Readwrite-splitting rule configuration checker does not evaluate inline expressions in data source names
URL: https://github.com/apache/shardingsphere/issues/39373
--
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