[TiDB Community Wisdom Collection] 2022 Community User Upgrade Guide & Comprehensive Column Upgrade Articles

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

Original topic: 【TiDB 社区智慧合集】2022 社区用户升级指南&专栏升级文章大全

| username: Billmay表妹

Good news for those preparing to upgrade! My cousin has prepared a super comprehensive upgrade guide for you to refer to:

:one: Practical Experience - Recording a Major Version Upgrade (4.0.13→5.4.0)

I. Background

  • Currently, our company’s TiDB cluster is running databases for 5 business systems. These 5 businesses are relatively important systems for the company, characterized by high concurrent writes, high concurrent queries, or large batch data queries.
  • TiDB iterates quickly, and although TiDB v5.4.0 GA version is about a year later than TiDB v4.0.13, it has significant functional and performance improvements (tested) that can enhance write performance, query performance, especially multi-table joint queries (MPP).

II. Upgrade Purpose

  • Improve TiDB cluster write and query performance, with 5.4.0 being 10-15% better than 4.0.13.
  • The TiFlash component adds MPP (query pushdown) functionality, significantly improving TiDB cluster multi-table join query performance.
  • Enhance more user-friendly maintenance and management methods.
  • Replace old cluster servers with new ones, doubling the maximum capacity of the TiDB cluster.

Table of Contents:

More details: 专栏 - 实战-记录一次大版本升级 | TiDB 社区

:two: “TiDB Cross-Version Upgrade” – Process Overview (3.0.10→5.3.0)

Upgrade Background

  1. The original cluster version is too low, making maintenance difficult, so a version upgrade is decided.
  2. Testing shows that v5.3.0 has significant performance improvements over v3.0.10.
  3. Decided to upgrade TiDB v3.0.10 to TiDB v5.3.0.

Upgrade Method

This plan uses Dumpling+Lightning+TiDB Binlog.

【Upgrade Method Division】
Generally divided into downtime upgrade and non-downtime upgrade.
Based on the literal meaning, we can choose according to business requirements. If the business allows downtime upgrade, it is relatively safer and faster. If the business does not allow downtime, we mainly choose non-downtime upgrade.

Non-downtime upgrade according to the official documentation requires a specific method for rolling upgrade.
Rolling upgrade might be a good choice for us, but the issues are:

  1. Business needs rollback, and our rollback plan usually requires full backup + incremental method, making rollback progress slow.
  2. If the version gap is too large, continuous rolling upgrade increases uncontrollable factors.
  3. The old version usually uses Ansible installation, while the new version wants to use tiup for management, making operations more complex.
    # Due to various reasons, we finally decided to use Dumpling+Lightning+TiDB Binlog to effectively avoid a series of cumbersome issues.
  • Obtain relevant information
  • Create the target cluster for TiDB v5.3.0
  • Use Dumpling to export data from the original cluster
  • Use Lightning to import data into the target cluster
  • Start Drainer for incremental synchronization
  • Use sync-diff-inspector for data verification
  • Set up rollback path
  • Switch business

More details: 专栏 - 《TiDB跨版本升级》 --流程概述 | TiDB 社区

:three: TiDB Upgrade and Case Sharing (TiDB v4.0.1 → v5.4.1)

Why Upgrade?

  1. Low version TiDB peripheral components are not well supported, such as low version CDC has memory leak issues, etc.
  2. TiDB panic bug triggered in actual work.
  3. Under the background of cost reduction and efficiency improvement, enhance TiDB performance or throughput.
  4. Contribute actual business scenarios to the community.

How to Upgrade?

TiDB upgrades are divided into downtime upgrade and non-downtime upgrade, with non-downtime upgrade further divided into smooth upgrade and forced upgrade (–force). Below is a brief explanation of the process, without too much detail, only introducing the core.

Table of Contents:

More details: 专栏 - TiDB升级与案例分享(TiDB v4.0.1 → v5.4.1) | TiDB 社区

:four: High-Concurrency Request TiDB Cluster Business Lossless Upgrade

Table of Contents

I. Preface

II. Common Online Transaction System Upgrade Methods

III. Common Issues in Upgrading TiDB Cluster

  1. SQL request failure
  2. Incompatibility between versions before and after upgrade causing upgrade failure
  3. No rollback plan for upgrade failure

IV. Upgrade Preparation and Non-Core Component Upgrade

  1. Preparations before upgrade
  2. Upgrade of peripheral components

V. Online Upgrade of TiDB Cluster Core Components

  1. Core component upgrade sequence
  2. Use tiup cluster patch to upgrade each component separately
  3. Upgrade PD
  4. Upgrade TiKV
  5. Upgrade Pump
  6. Upgrade TiDB

More details: 专栏 - 高并发请求下 TiDB 集群的业务无损升级 | TiDB 社区

:five: TiDB Cross-Version Upgrade - First Attempt by Newcomers (3.0.8→5.4.0)

Upgrade Background

  1. The original cluster version is too low, making maintenance difficult, so a version upgrade is decided.
  2. Testing shows that v5.4.0 has significant performance improvements over v3.0.10.
  3. Decided to upgrade TiDB v3.0.10 to TiDB v5.4.0.

Upgrade Method

This upgrade uses Dumpling+Lighting+TiDB binlog.

【Upgrade Method Division】
Generally divided into downtime upgrade and non-downtime upgrade.
Based on the literal meaning, we can choose according to business requirements. If the business allows downtime upgrade, it is relatively safer and faster. If the business does not allow downtime, we mainly choose non-downtime upgrade.

Non-downtime upgrade according to the official documentation requires a specific method for rolling upgrade.
Rolling upgrade might be a good choice for us, but the issues are:

  1. Business needs rollback, and our rollback plan usually requires full backup + incremental method, making rollback progress slow.
  2. If the version gap is too large, continuous rolling upgrade increases uncontrollable factors.
  3. The old version usually uses Ansible installation, while the new version wants to use tiup for management, making operations more complex.
    # Due to various reasons, we finally decided to use Dumpling+Lightning+TiDB Binlog to effectively avoid a series of cumbersome issues.
  • Obtain relevant information
  • Create the target cluster for TiDB v5.3.0
  • Use Dumpling to export data from the original cluster
  • Use Lightning to import data into the target cluster
  • Start Drainer for incremental synchronization
  • Use sync-diff-inspector for data verification
  • Set up rollback path
  • Switch business

More details: 专栏 - TiDB跨版本升级--新人首次尝试🧐 | TiDB 社区

:six: Some Tidbits About TiDB Upgrade - Teaching You How to Upgrade Happily (4.0.9→4.0.14)

More details: 专栏 - 有关 TiDB 升级的二三事——教你如何快乐升级 | TiDB 社区

:seven: TiDB Upgrade to 5.0.2 with Surprises (5.0.1 → 5.0.2)

More details: 专栏 - TiDB升级5.0.2有惊喜 | TiDB 社区

:eight: TiDB 4.0 Upgrade to 5.1 Tidbits - Pitfall Guide (4.0→5.1)

More details: 专栏 - TiDB 4.0 升级 5.1 二三事——避坑指南 | TiDB 社区

:nine: TiDB 2.1 Upgrade to 4.0 Operation Document

More details: 专栏 - tidb 2.1升级到4.0操作文档 | TiDB 社区

:one::zero: TiDB4PG Upgrading TiDB Version to v5.3.0

More details: 专栏 - TiDB4PG 中 TiDB 版本升级至 v5.3.0 | TiDB 社区

:one::one: TTIDB Monitoring Upgrade to Solve Panic - A Long Exploration

More details: 专栏 - TIDB监控升级解决panic的漫漫探索之路 | TiDB 社区

| username: 数据小黑 | Original post link

First comment?

| username: xiaohetao | Original post link

Got it!

| username: tjdagang1 | Original post link

Like:+1::+1::+1:

| username: ShawnYan | Original post link

:+1::+1::+1:

| username: TiDBer_Wp | Original post link

Like :rose: