TiDB does have a few cycle dependency breakers, like:
util/tableutil/tableutil.go
util/sqlexec/restricted_sql_executor.go
As they are used internally, I’d suggest we move these codes into one dedicated path said cycledepbreaker
, and layout as several packages.
This way, we keep track explicitly on cycle dependencies and force to face them instead of cover the problem under util
, which is put anything if the developer cannot determine where a file to go.
What do you think? Is there other cycle dependency breaker?