pingcap / pingcap/tidb

infoschema: Putting all variables & configs into one view, with relevant information

Open
#48,886 0 comments 0 reactions 0 assignees View on GitHub
type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
Currently, there are two types of "parameters"(variable, config) that control the behavior of instances (TiDB, TiKV, PD, TiFlash). They have different characteristics and different scopes.

Where to see variables?
- information_schema.global_variables and information_schema.session_variables
- information_schema.variables_info

Where to see configs?
- cluster_config

I would like to propose one table to see all variables and configs:
```
mysql> desc information_schema.tidb_params;
+--------------------+---------------------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+---------------------+------+------+---------+-------+
| COMPONENT | varchar(64) | NO | | NULL | |
| TYPE | varchar(64) | NO | | NULL | |
| NAME | varchar(256) | NO | | NULL | |
| INSTANCE | varchar(64) | YES | | NULL | |
| SCOPE | varchar(64) | NO | | NULL | |
| VALUE | longtext | NO | | NULL | |
| DEFAULT_VALUE | varchar(64) | YES | | NULL | |
| MIN_VALUE | bigint(64) | YES | | NULL | |
| MAX_VALUE | bigint(64) unsigned | YES | | NULL | |
| POSSIBLE_VALUES | varchar(256) | YES | | NULL | |
| IS_CLUSTER_DYNAMIC | tinyint(1) | NO | | 0 | |
| IS_INST_DYNAMIC | tinyint(1) | NO | | 0 | |
| IS_SESS_DYNAMIC | tinyint(1) | NO | | 0 | |
+--------------------+---------------------+------+------+---------+-------+
13 rows in set (0.00 sec)
```
- COMPONT: "tidb/tikv/pd/tiflash" and all variables' type are "tidb"
- TYPE: VAR, CONFIG
- NAME: variable or config name
- INSTANCE: Endpoints of relevant instances.
- For INSTANCE variables: {endpoint}
- For other variables: *
- For config: {endpoint}
- SCOPE:
- GLOBALE: global variables
- INSTANCE: instance variables, all configs
- SESSION: session variable
- VALUE: current value
- DEFAULT_VALUE: default value
- MIN_VALUE: min value(config: null)
- MAX_VALUE: max value(config: null)
- POSSIBLE_VALUES: only for enum type variables(config: null)
- IS_CLUSTER_DYNAMIC: param is cluster-wide and can be set dynamically
- Global Variables: true
- Other: false
- IS_INST_DYNAMIC: param is instance-wide and can be set dynamically
- Instance variables: true
- Configs that can be set dynamically: true
- Other: false
- IS_SESS_DYNAMIC: param is session-wide and can be set dynamically
- Session Variables: YES
- Other: NO

With this new table, users can learn more information about the parameters of TiDB.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.