sandynz commented on issue #13632:
URL:
https://github.com/apache/shardingsphere/issues/13632#issuecomment-983373928
I reproduced this issue on commit 3f1ca7f190a04723b9929729c953271667286879.
### Reproduce steps
1. Cleanup `/metadata/sharding_db`
2. in `config-sharding.yaml`
```
dataSources:
ds_0:
url:
jdbc:mysql://127.0.0.1:3306/scaling_ds_0?serverTimezone=UTC&useSSL=false
username: root
password: root
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
ds_1:
url:
jdbc:mysql://127.0.0.1:3306/scaling_ds_1?serverTimezone=UTC&useSSL=false
username: root
password: root
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
```
3. in `server.yaml`
```
mode:
type: Cluster
repository:
type: ZooKeeper
props:
namespace: governance_ds
server-lists: localhost:2181
retryIntervalMilliseconds: 500
timeToLiveSeconds: 60
maxRetries: 3
operationTimeoutMilliseconds: 500
overwrite: true
```
4. start proxy
5. `/metadata/sharding_db/dataSources`
```
ds_0:
schema: null
transactionIsolation: null
initializationFailTimeout: 1
validationTimeout: 5000
catalog: null
maxLifetime: 1800000
leakDetectionThreshold: 0
connectionInitSql: null
minimumIdle: 1
password: root
dataSourceJNDI: null
connectionTestQuery: null
idleTimeout: 60000
driverClassName: null
jdbcUrl:
jdbc:mysql://127.0.0.1:3306/scaling_ds_0?serverTimezone=UTC&useSSL=false
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
maximumPoolSize: 50
connectionTimeout: 30000
username: root
poolName: HikariPool-1
ds_1:
schema: null
transactionIsolation: null
initializationFailTimeout: 1
validationTimeout: 5000
catalog: null
maxLifetime: 1800000
leakDetectionThreshold: 0
connectionInitSql: null
minimumIdle: 1
password: root
dataSourceJNDI: null
connectionTestQuery: null
idleTimeout: 60000
driverClassName: null
jdbcUrl:
jdbc:mysql://127.0.0.1:3306/scaling_ds_1?serverTimezone=UTC&useSSL=false
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
maximumPoolSize: 50
connectionTimeout: 30000
username: root
poolName: HikariPool-2
```
`driverClassName: null` and also much other keys with value null, these keys
should not be persisted in registry center.
### Reason analyze
I'm not sure which change cause this issue, I use cached metadata generated
several months before, it should be caused by latest months PR.
Possible solution:
`AbstractDataSourceCreator.findAllGetterProperties` get all property name
from target by reflection, and put them into result map, no matter property
value is null or not. We could filter these keys here.
--
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]