Setting alter-primary-key is not effective

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

Original topic: 设置alter-primary-key不生效

| username: HACK

【TiDB Usage Environment】Production, Testing, Research
【TiDB Version】
【Encountered Problem】
After modifying alter-primary-key: true through tiup edit-config and restarting the TiDB server, the variable is still false when queried. What could be the issue?

【Reproduction Path】What operations were performed to encounter the problem
【Problem Phenomenon and Impact】

【Attachments】

Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.

| username: db_user | Original post link

Which version of TiDB is it? If it is 5 or above, this parameter has already been deprecated.

| username: HACK | Original post link

I’m using version 4.0.16. This version hasn’t been deprecated, has it?

| username: OnTheRoad | Original post link

What version? 5.0+ has been deprecated.

| username: HACK | Original post link

4.0.16

| username: Kongdom | Original post link

According to the description, there are some situations where it is not supported even if it is enabled.

| username: HACK | Original post link

My test result is that after I changed this parameter to true, the value of the variable is still false when viewed through show config, and the welcome information in tidb.log is also false.

| username: Kongdom | Original post link

Did you reload?

| username: HACK | Original post link

I did it, restarted the TiDB node. It shows true when checked through edit-config, but it just can’t be modified.

| username: Kongdom | Original post link

Check whether the configuration in the meta.yaml file under the directory of the control machine is true or false.
.tiup/storage/cluster/clusters/tidb/

| username: HACK | Original post link

This is true.

| username: Kongdom | Original post link

Then check the configuration file tidb.toml on the TiDB node server
/home/tidb/TI_Deploy/tidb-3990/conf/

If it is false here, then it has not taken effect. You need to reload to update the configuration.

| username: HACK | Original post link

I’ve looked at this file, and it doesn’t contain this variable. It seems it wasn’t automatically added.

| username: Kongdom | Original post link

That means it hasn’t taken effect, you need to reload to update the configuration.

| username: Kongdom | Original post link

Note, it is highly discouraged to manually add to the TiDB node configuration file.

| username: HACK | Original post link

Oh, right, right, I only remembered to restart, but forgot to manually reload.

| username: HACK | Original post link

May I ask another question? Is the .tiup directory used to store the topology information of the TiDB cluster and the configuration parameters of the cluster components?

| username: Kongdom | Original post link

Yes, it is saved on the central control machine.

| username: HACK | Original post link

:ok_hand:

| username: system | Original post link

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