TiDB Version Upgrade

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

Original topic: tidb版本升级

| username: 特雷西-迈克-格雷迪

【TiDB Usage Environment】Production Environment
【TiDB Version】6.1.2
【Reproduction Path】
【Encountered Issues: Problem Phenomenon and Impact】

What should I pay attention to when upgrading TiDB from version 6.1.2 to 6.5.7? Are there any pitfalls to avoid?

【Attachments: Screenshots/Logs/Monitoring】

| username: 这里介绍不了我 | Original post link

Is there a rollback plan?

| username: tidb狂热爱好者 | Original post link

No problem, let’s practice first.

| username: xingzhenxiang | Original post link

This pitfall is quite obvious.

| username: 特雷西-迈克-格雷迪 | Original post link

There’s no rollback after the upgrade, right? That’s why I’m a bit worried.

| username: TiDBer_jYQINSnf | Original post link

Set up an environment to test, including performance.
Have encountered performance degradation after an upgrade.

| username: 这里介绍不了我 | Original post link

If possible, set up a rollback cluster. If there are issues with the upgrade, you can roll back. I think this is more reliable. Currently, the business also needs to test on the new version in advance.

| username: TiDBer_jYQINSnf | Original post link

Set up a test cluster to verify all SQLs. Check if the execution plan has changed. Have encountered performance degradation before.

| username: 这里介绍不了我 | Original post link

Yes, there’s no such thing as a downgrade.

| username: tidb菜鸟一只 | Original post link

No major issues if not crossing major versions.

| username: 春风十里 | Original post link

If there is an opportunity to shut down everything for cold backup, it can be considered a fallback plan, right? I suggest testing it multiple times in the test environment.

| username: dockerfile | Original post link

Don’t waste time.
Just go with 7.1.3 or 7.5.1.

| username: 特雷西-迈克-格雷迪 | Original post link

How is 7.5.1 working for you? Do you have any experience upgrading from 6.1 to 7.5?

| username: wangccsy | Original post link

When I installed it, it was version 7.5.

| username: Kongdom | Original post link

You can refer to the official upgrade instructions: 使用 TiUP 升级 TiDB | PingCAP 文档中心

Here are some excerpts from the upgrade instructions:

If the original cluster is a version before 6.2, when upgrading to version 6.2 and above, you may encounter situations where the upgrade gets stuck in some scenarios. You can refer to How to solve the problem of upgrade getting stuck.

When upgrading TiFlash from a version before v6.3.0 to v6.3.0 and later versions, special attention is needed: When deploying TiFlash on a Linux AMD64 architecture hardware platform, the CPU must support the AVX2 instruction set. When deploying TiFlash on a Linux ARM64 architecture hardware platform, the CPU must support the ARMv8 architecture. For details, please refer to the description in the 6.3.0 version Release Notes.

| username: ShawnYan | Original post link

Yes, this indeed needs attention

Attention

If the directory does not exist, TiDB will automatically create it at startup. If the directory creation fails or TiDB does not have read/write permissions for the directory, Fast Online DDL may encounter unpredictable issues during runtime.

| username: kelvin | Original post link

I’ve seen many people mention this issue; it is indeed problematic.

| username: 随便改个用户名 | Original post link

After the upgrade, make sure to check this parameter. This parameter does not exist in version 6.1.

| username: 哈喽沃德 | Original post link

It is recommended to first upgrade TiDB to one of the stable intermediate versions, and then upgrade to the target version. For example, you can first upgrade TiDB to a 6.2.x or 6.3.x version, and then upgrade to version 6.5.7.

| username: ShawnYan | Original post link

Emm, these two are DMRs, so you can skip them. For version selection, you can check here