Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Why shardingspere need to load all meta data? #2063

Closed
songxu opened this issue Mar 20, 2019 · 3 comments
Closed

Why shardingspere need to load all meta data? #2063

songxu opened this issue Mar 20, 2019 · 3 comments
Assignees

Comments

@songxu
Copy link

songxu commented Mar 20, 2019

Version

io.shardingsphere.sharding-jdbc-spring-boot-starter:3.0.0

During the initializing, shardingspere will load all table meta in TableMetaDataInitializer.

TableMetaDataInitializer.load(final ShardingRule shardingRule) {
...
result.putAll(loadDefaultTables(shardingRule));
}

It takes much time(almost 2 minutes) to load all meta data.

Question

Why shardingspere need to load all meta data? If I don't load them, what will happen?

Thanks a lot.

@tristaZero
Copy link
Contributor

@songxu
Hi, your issue is duplicate with #1951.
Are you interested in this one? If available, maybe you can fix this problem and give us a pr.

@songxu
Copy link
Author

songxu commented Mar 20, 2019

@songxu
Hi, your issue is duplicate with #1951.
Are you interested in this one? If available, maybe you can fix this problem and give us a pr.

Thanks for you reply.
If the meta data isn't loaded at the initializing time, is there any impact?

@tristaZero
Copy link
Contributor

@songxu Hi, recently i am fixing this problem, and this issue occurrs to me. ShardingSphere needs a copy of metadata info to help parsing your SQLs, and checks the metadata consistancy of all the sharding tables. But there is a switch named check.table.metadata.enabled to decide to check it or not. If you don't want to cost too much time when startup, you can config this property. More details, please refer to our document. Thanks.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants