Skip to content

Support session level tidb_ddl_reorg_worker_cnt and tidb_ddl_reorg_batch_size #55335

@tangenta

Description

@tangenta

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementThe issue or PR belongs to an enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions