apache / apache/shardingsphere

USE DistSQL IMPORT DATABASE CONFIGURATION FROM FILE `filepath` for import readwrite_splliting rules error

Open
#23,576 5 comments 0 reactions 1 assignee Claimed by @RaigorJiang View on GitHub
feature: DistSQL in: metadata
Dominant language
Java
Stars
20.8k
Forks
6.9k
Avg merge
11h 35m
Merged PRs (30d)
326

Description

## Bug Report

**For English only**, other languages will not accept.

Before report a bug, make sure you have:

- Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
- Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).

Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will **close it**.

Please answer these questions before submitting your issue. Thanks!

### Which version of ShardingSphere did you use?

master [`d08e4ac2`](https://github.com/apache/shardingsphere/commit/d08e4ac2a0ac0e16ed5544cf71b9b59dec66b608)

### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy

### Expected behavior
IMPORT DATABASE CONFIGURATION FROM FILE 'filepath';

### Actual behavior
Start ShardingSphere-Proxy with cluster mode, connect and run:
```sql
mysql> IMPORT DATABASE CONFIGURATION FROM FILE 'filepath';
ERROR 19001 (44000): Storage units `[ds_1, ds_0]` do not exist in database `readwrite_splliting_db`.
```
### Reason analyze (If you can)
This problem only occurs in the cluster mode. The analysis reason is that the metadata synchronization is not completed after the new storage node is registered.

### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

### Example codes for reproduce this issue (such as a github link).
```yaml
databaseName: readwrite_splliting_db

dataSources:
ds_0:
url: jdbc:mysql://127.0.0.1:3306/ds0?useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&prepStmtCacheSize=8192&prepStmtCacheSqlLimit=8000&allowPublicKeyRetrieval=true
username: root
password:
connectionTimeoutMilliseconds: 10000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 500
minPoolSize: 1
ds_1:
url: jdbc:mysql://127.0.0.1:3306/ds1?useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&prepStmtCacheSize=8192&prepStmtCacheSqlLimit=8000&allowPublicKeyRetrieval=true
username: root
password:
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 500
minPoolSize: 1

rules:
- !READWRITE_SPLITTING
dataSources:
readwrite_ds:
staticStrategy:
writeDataSourceName: ds_0
readDataSourceNames:
- ds_1
loadBalancerName: random
loadBalancers:
random:
type: RANDOM
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.