Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

*: a better design for concurrent access of GlobalConfig #30366

Open
bb7133 opened this issue Dec 3, 2021 · 3 comments
Open

*: a better design for concurrent access of GlobalConfig #30366

bb7133 opened this issue Dec 3, 2021 · 3 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. sig/sql-infra SIG: SQL Infra type/enhancement The issue or PR belongs to an enhancement.

Comments

@bb7133
Copy link
Member

bb7133 commented Dec 3, 2021

Enhancement

Currently, the GlobalConfig is loaded from the configuration file and can be modified('dynamic config') after that, several fields are wrapped with an atomic operation helper to avoid data race issues, for example:

But it can be vulnerable, for example:

#30345 is introduced by #29247 but it is really hard for the developers to realize the race issue. In order to solve it, an atomic wrapper is introduced in #30346.

IMO this may easily happen before we find a systematic way to solve it, possible alternatives are:

@bb7133 bb7133 added the type/enhancement The issue or PR belongs to an enhancement. label Dec 3, 2021
@bb7133 bb7133 changed the title *: a better design for GlobalConfig *: a better design for concurrent access of GlobalConfig Dec 3, 2021
@bb7133
Copy link
Member Author

bb7133 commented Dec 3, 2021

/cc @morgo Do you think it's a good idea to deprecate 'dynamic configuration' for TiDB-server?

@bb7133 bb7133 added sig/sql-infra SIG: SQL Infra help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Dec 3, 2021
@morgo
Copy link
Contributor

morgo commented Dec 3, 2021

I would love to deprecate dynamic config and eventually the toml config file. For most server options users prefer dynamic config and we can use sysvars. For the options they can't, we could use a mysql-style config file.

The underlying limitation is deciding on the behavior of instance-scoped variables. There are two options:

It is waiting for product management to decide.

@morgo
Copy link
Contributor

morgo commented Dec 9, 2021

I have proposed that we address this in refactoring in step 3 of this proposal: #30558

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. sig/sql-infra SIG: SQL Infra type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants