RaigorJiang opened a new issue, #29459:
URL: https://github.com/apache/shardingsphere/issues/29459
## Bug Report
### Which version of ShardingSphere did you use?
master f8f90126f698cefe1ba83f5fbe953455f1971559
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
### Expected behavior
When readwrite-splitting and shadow rule are used together, Proxy can be
started successfully.
### Actual behavior
Throws DataSourceNameExistedException
### Reason analyze (If you can)
1. When `checkWriteDataSourceNames`,
`ReadwriteSplittingRuleConfigurationChecker` will check other logic data sources
```java
ShardingSpherePreconditions.checkState(dataSourceMap.containsKey(each) ||
containsInOtherRules(each, rules),
() -> new
DataSourceNameExistedException(String.format("Write data source name `%s` not
in database `%s`.", each, databaseName)));
```
2. But when `checkReadeDataSourceNames`,
`ReadwriteSplittingRuleConfigurationChecker` will not check other logic data
sources, this may result in dependent data sources not being found.
```java
ShardingSpherePreconditions.checkState(dataSourceMap.containsKey(each),
() -> new
DataSourceNameExistedException(String.format("Read data source name `%s` not in
database `%s`.", each, databaseName)));
```
--
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:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]