-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Description
Bug Report
When using the following configuration, the value passed to rule.findDataSourceGroupRule(logicDataSourceName) is write_ds or read_ds_0, which fails to locate the correct dataSourceGroups (e.g., joshua in the configuration). This causes the ReadwriteSplitting logic to be skipped. This PR fixes the issue by ensuring the logicDataSourceName parameter passed is set to joshua.
mode:
type: Standalone
repository:
type: JDBC
dataSources:
write_ds:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
url: jdbc:postgresql://127.0.0.1:5432/mydatabase
username: myuser
password: secret
read_ds_0:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
url: jdbc:postgresql://127.0.0.1:5432/mydatabase
username: myuser
password: secret
readOnly: true
rules:
- !READWRITE_SPLITTING
dataSourceGroups:
"joshua":
writeDataSourceName: write_ds
readDataSourceNames:
- read_ds_0
transactionalReadQueryStrategy: PRIMARY
loadBalancerName: baseAA
loadBalancers:
baseAA: # Load balance algorithm name
type: ROUND_ROBIN
- !SINGLE
tables:
- "*.*.*"
props:
sql-show: true
Which version of ShardingSphere did you use?
5.5.0/5.5.1/5.5.2-SNAPSHOT triggers BUG
5.4.1 works normally
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
Expected behavior
Tableless write operations have transactions
Tableless write operations point to write_ds
Actual behavior
Tableless write operations have transactions
Tableless write operations do not always point to write_ds, but sometimes point to read_ds_0