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

Support session level tidb_ddl_reorg_worker_cnt and tidb_ddl_reorg_batch_size #55335

Closed
tangenta opened this issue Aug 9, 2024 · 0 comments · Fixed by #55334
Closed

Support session level tidb_ddl_reorg_worker_cnt and tidb_ddl_reorg_batch_size #55335

tangenta opened this issue Aug 9, 2024 · 0 comments · Fixed by #55334
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@tangenta
Copy link
Contributor

tangenta commented Aug 9, 2024

Enhancement

Currently, these two system variables are global level and cannot be modified at session level. This introduce the inconvenience when global variables are restricted to modified:

mysql> set  @@global.tidb_ddl_reorg_worker_cnt = 6;
ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN privilege(s) for this operation

If TiDB supports session level variables, only ALTER privilege is needed to add index, instead of SUPER or SYSTEM_VARIABLES_ADMIN.

However, there is a slight difference between session level and global level variables.

  • For global variables, the modification will also take effect on running DDL jobs.
  • For session variables, because the current session is waiting for the DDL to complete and return the result, it cannot modify this parameter online for running DDL jobs. Therefore, there is a restriction that it can only take effect for the next DDL job. In some scenarios, such as adding an index that takes several days, it will be limited.
@tangenta tangenta added the type/enhancement The issue or PR belongs to an enhancement. label Aug 9, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in 3db0322 Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant