Why do TiDB parameter changes not take effect after restarting the cluster, and require reloading each node to take effect?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb修改参数,重启集群为啥不生效,非得每个节点reload才生效?

| username: yulei7633

When modifying TiDB parameters, why doesn’t restarting the cluster take effect, and each node has to be reloaded to take effect?
Today, when modifying a TiKV parameter, I directly restarted the cluster, but found that the parameter did not take effect… I had no choice but to reload each TiKV node one by one for it to take effect.
I don’t quite understand, restarting the cluster also restarts the TiKV nodes, and reloading also restarts the TiKV nodes. Why is the effect different?

| username: Kongdom | Original post link

tiup cluster reload command

This command will publish the configuration from the control machine to the remote machines where the services are running, and restart the services in sequence according to the upgrade process. The cluster remains available during the restart process.

tiup cluster restart command

This command is used to restart all or part of the services in the specified cluster. There will be a period of service unavailability during the restart process.

In comparison, the restart command only restarts the components without fetching and loading the latest configuration.

| username: yulei7633 | Original post link

I modified the parameters through: tiup cluster edit-config tidb-test and then restarted the cluster. In this case, do I have to reload each node individually because the configuration file has not been delivered to the specified TiKV node? If the changes take effect after restarting the cluster, do I need to configure the corresponding parameters on the TiKV nodes separately? Is that correct?

| username: yulei7633 | Original post link

Understood, thank you.

| username: Kongdom | Original post link

First, there’s no need to reload individually; you can directly use tiup cluster reload -R tikv to load the configuration by role.

If you want the changes to take effect by restarting the cluster, you need to configure it separately on the TiKV nodes. However, be aware that such modifications will be overwritten by the configuration on the control machine during the next reload.

| username: Kongdom | Original post link

:handshake: :handshake: :handshake:

| username: zhanggame1 | Original post link

Reload and restart are two different operations. Reload loads the modified configuration from the control center and can restart without affecting the running business. Restart means shutting down the cluster and then starting it again.

| username: yulei7633 | Original post link

Got it, thanks.

| username: 舞动梦灵 | Original post link

Does this mean that if you modify the configuration, you can just reload it without restarting?

| username: TI表弟 | Original post link

Reload is a hot update, and each node will restart one by one.

| username: dba远航 | Original post link

I feel that there is still a BUG here.

| username: yulei7633 | Original post link

This is not a bug. Look at the discussion above.

| username: Kongdom | Original post link

:yum: The reload includes a restart.

| username: Kongdom | Original post link

:thinking: What bug? Please elaborate~

| username: dba远航 | Original post link

A normal restart should also load the latest configuration, not just reload. So I feel this operation is flawed.

| username: Kongdom | Original post link

Restarting does not mean not loading the configuration; it means not downloading the configuration from the central control machine. This is likely because the node does not know which machine is the central control machine. Restarting will only load the local configuration.

| username: yulei7633 | Original post link

Understood, thank you.

| username: zhanggame1 | Original post link

The parameters and configuration files of TiDB are quite complex, and the locations of parameters for different components vary. Some system variables of the TiDB server are persisted to TiKV, while some parameters of PD are persisted to etcd, and so on.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.