pingcap/tidb

*: a better design for concurrent access of GlobalConfig

Open

#30,366 建立於 2021年12月3日

在 GitHub 查看
 (3 留言) (2 反應) (0 負責人)Go (6,186 fork)batch import
help wantedsig/sql-infratype/enhancement

倉庫指標

Star
 (40,090 star)
PR 合併指標
 (平均合併 14天 4小時) (30 天內合併 346 個 PR)

描述

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:

https://github.com/pingcap/tidb/issues/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 https://github.com/pingcap/tidb/pull/30346.

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

貢獻者指南