Skip to content

Commit

Permalink
Merge branch 'pingcap:master' into orderratio
Browse files Browse the repository at this point in the history
  • Loading branch information
terry1purcell authored Mar 28, 2024
2 parents bbea3d9 + cb80cfb commit 2d9ab6e
Show file tree
Hide file tree
Showing 44 changed files with 935 additions and 300 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Currently, we maintain the following versions of TiDB documentation in different
| Branch name | TiDB docs version |
| :---------|:----------|
| [`master`](https://github.com/pingcap/docs/tree/master) | The latest development version |
| [`release-8.0`](https://github.com/pingcap/docs/tree/release-8.0) | 8.0 Development Milestone Release |
| [`release-7.6`](https://github.com/pingcap/docs/tree/release-7.6) | 7.6 Development Milestone Release |
| [`release-7.5`](https://github.com/pingcap/docs/tree/release-7.5) | 7.5 LTS (Long-Term Support) |
| [`release-7.4`](https://github.com/pingcap/docs/tree/release-7.4) | 7.4 Development Milestone Release |
Expand Down
2 changes: 1 addition & 1 deletion TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@
- [TiDB Versioning](/releases/versioning.md)
- [TiDB Installation Packages](/binary-package.md)
- v7.6
- [7.6.0](/releases/release-7.6.0.md)
- [7.6.0-DMR](/releases/release-7.6.0.md)
- v7.5
- [7.5.1](/releases/release-7.5.1.md)
- [7.5.0](/releases/release-7.5.0.md)
Expand Down
414 changes: 209 additions & 205 deletions basic-features.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions br/backup-and-restore-use-cases.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: TiDB Backup and Restore Use Cases
summary: TiDB provides snapshot and log backup solutions for specific use cases, such as timely data recovery and business audits. To use point-in-time recovery (PITR), deploy a TiDB cluster >= v6.2.0 and update BR to v7.6.0. Configure backup storage on Amazon S3 and set a backup policy to meet data loss and recovery requirements. Run log and snapshot backups, and use PITR to restore data to a specific time point. Clean up outdated data regularly. For detailed steps, refer to TiDB documentation.
summary: TiDB provides snapshot and log backup solutions for specific use cases, such as timely data recovery and business audits. To use point-in-time recovery (PITR), deploy a TiDB cluster >= v6.2.0 and update BR to v8.0.0. Configure backup storage on Amazon S3 and set a backup policy to meet data loss and recovery requirements. Run log and snapshot backups, and use PITR to restore data to a specific time point. Clean up outdated data regularly. For detailed steps, refer to TiDB documentation.
aliases: ['/docs/dev/br/backup-and-restore-use-cases/','/docs/dev/reference/tools/br/use-cases/','/tidb/dev/backup-and-restore-use-cases-for-maintain/']
---

Expand All @@ -17,7 +17,7 @@ With PITR, you can satisfy the preceding requirements.

## Deploy the TiDB cluster and BR

To use PITR, you need to deploy a TiDB cluster >= v6.2.0 and update BR to the same version as the TiDB cluster. This document uses v7.6.0 as an example.
To use PITR, you need to deploy a TiDB cluster >= v6.2.0 and update BR to the same version as the TiDB cluster. This document uses v8.0.0 as an example.

The following table shows the recommended hardware resources for using PITR in a TiDB cluster.

Expand All @@ -44,13 +44,13 @@ Install or upgrade BR using TiUP:
- Install:

```shell
tiup install br:v7.6.0
tiup install br:v8.0.0
```

- Upgrade:

```shell
tiup update br:v7.6.0
tiup update br:v8.0.0
```

## Configure backup storage (Amazon S3)
Expand Down
15 changes: 14 additions & 1 deletion br/br-snapshot-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ The output is as follows, corresponding to the physical time `2022-09-08 13:30:0

## Restore cluster snapshots

> **Note:**
>
> - For BR v7.5.0 and earlier versions, the snapshot restore speed per TiKV node is approximately 100 MiB/s.
> - Starting from BR v7.6.0, to address potential restore bottlenecks in scenarios with large-scale Regions, BR supports accelerating restore through the coarse-grained Region scattering algorithm (experimental). You can enable this feature by specifying the command-line parameter `--granularity="coarse-grained"`.
> - Starting from BR v8.0.0, the snapshot restore through the coarse-grained Region scattering algorithm is generally available (GA) and enabled by default. BR improves the snapshot restore speed significantly by implementing various optimizations such as adopting the coarse-grained Region scattering algorithm, creating databases and tables in batches, reducing the mutual impact between SST file downloads and ingest operations, and accelerating the restore of table statistics. According to test results from real-world cases, the SST file download speed for snapshot restore is improved by approximately up to 10 times, the data restore speed per TiKV node stabilizes at 1.2 GiB/s, the end-to-end restore speed is improved by approximately 1.5 to 3 times, and 100 TiB of data can be restored within one hour.
You can restore a snapshot backup by running the `br restore full` command. Run `br restore full --help` to see the help information:

The following example restores the [preceding backup snapshot](#back-up-cluster-snapshots) to a target cluster:
Expand Down Expand Up @@ -208,7 +214,7 @@ The impact of backup on cluster performance can be reduced by limiting the backu

- During data restore, TiDB tries to fully utilize the TiKV CPU, disk IO, and network bandwidth resources. Therefore, it is recommended to restore the backup data on an empty cluster to avoid affecting the running applications.
- The speed of restoring backup data is much related with the cluster configuration, deployment, and running applications. In internal tests, the restore speed of a single TiKV node can reach 100 MiB/s. The performance and impact of snapshot restore are varied in different user scenarios and should be tested in actual environments.
- Starting from v7.6.0, to accelerate restore speed in large-scale Region scenarios, BR introduces an experimental feature that allows you to enable a coarse-grained Region scatter algorithm by specifying the command-line parameter `--granularity="coarse-grained"`. This algorithm ensures that each TiKV node receives stable and evenly distributed download tasks, thus fully utilizing the resources of each TiKV node and achieving a rapid parallel recovery. In several real-world cases, the snapshot restore speed of the cluster is improved by about 10 times in large-scale Region scenarios. The following is an example:
- BR provides a coarse-grained Region scattering algorithm to accelerate Region restore in large-scale Region scenarios. The algorithm is controlled by the command-line parameter `--granularity="coarse-grained"` and is enabled by default. This algorithm ensures that each TiKV node receives stable and evenly distributed download tasks, thus fully utilizing the resources of each TiKV node and achieving a rapid parallel recovery. In several real-world cases, the snapshot restore speed of the cluster is improved by about 3 times in large-scale Region scenarios. The following is an example:

```bash
br restore full \
Expand All @@ -220,6 +226,13 @@ The impact of backup on cluster performance can be reduced by limiting the backu
--log-file restorefull.log
```

- Starting from v8.0.0, the `br` command-line tool introduces the `--tikv-max-restore-concurrency` parameter to control the maximum number of files that BR downloads and ingests per TiKV node. By configuring this parameter, you can also control the maximum length of the job queue (the maximum length of the job queue = 32 \* the number of TiKV nodes \* `--tikv-max-restore-concurrency`), thereby controlling the memory consumption of the BR node.

In normal cases, `--tikv-max-restore-concurrency` is automatically adjusted based on the cluster configuration, so manual configuration is unnecessary. If the **TiKV-Details** > **Backup & Import** > **Import RPC count** monitoring metric in Grafana shows that the number of files BR downloads remains close to 0 for a long time while the number of files that BR ingests consistently reaches the upper limit, it indicates that ingesting file tasks pile up and the job queue has reached its maximum length. In this case, you can take the following measures to alleviate the task pilling-up issue:

- Set the `--ratelimit` parameter to limit the download speed, ensuring sufficient resources for ingesting file tasks. For example, if the disk throughput of any TiKV node is `x MiB/s` and the network bandwidth for downloading backup files exceeds `x/2 MiB/s`, you can set the parameter as `--ratelimit x/2`. If the disk throughput of any TiKV node is `x MiB/s` and the network bandwidth for downloading backup files is less than or equal to `x/2 MiB/s`, you can leave the parameter `--ratelimit` unset.
- Increase the `--tikv-max-restore-concurrency` to increase the maximum length of the job queue.

## See also

* [TiDB Backup and Restore Use Cases](/br/backup-and-restore-use-cases.md)
Expand Down
2 changes: 1 addition & 1 deletion develop/dev-guide-sample-application-nodejs-mysql2.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ npm start
If the connection is successful, the console will output the version of the TiDB cluster as follows:

```
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v7.6.0)
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.0.0)
⏳ Loading sample game data...
✅ Loaded sample game data.

Expand Down
2 changes: 1 addition & 1 deletion develop/dev-guide-sample-application-nodejs-mysqljs.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ npm start
If the connection is successful, the console will output the version of the TiDB cluster as follows:

```
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v7.6.0)
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.0.0)
⏳ Loading sample game data...
✅ Loaded sample game data.

Expand Down
2 changes: 1 addition & 1 deletion develop/dev-guide-sample-application-nodejs-typeorm.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ npm start
If the connection is successful, the terminal will output the version of the TiDB cluster as follows:

```
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v7.6.0)
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.0.0)
🆕 Created a new player with ID 2.
ℹ️ Got Player 2: Player { id: 2, coins: 100, goods: 100 }
🔢 Added 50 coins and 50 goods to player 2, now player 2 has 100 coins and 150 goods.
Expand Down
2 changes: 1 addition & 1 deletion develop/dev-guide-sample-application-ruby-mysql2.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ ruby app.rb
If the connection is successful, the console will output the version of the TiDB cluster as follows:

```
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v7.6.0)
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.0.0)
⏳ Loading sample game data...
✅ Loaded sample game data.

Expand Down
2 changes: 1 addition & 1 deletion develop/dev-guide-sample-application-ruby-rails.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Connect to your TiDB cluster depending on the TiDB deployment option you've sele
If the connection is successful, the console will output the version of the TiDB cluster as follows:

```
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v7.6.0)
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.0.0)
⏳ Loading sample game data...
✅ Loaded sample game data.

Expand Down
2 changes: 1 addition & 1 deletion dm/maintain-dm-using-tiup.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ All operations above performed on the cluster machine use the SSH client embedde

Then you can use the `--native-ssh` command-line flag to enable the system-native command-line tool:

- Deploy a cluster: `tiup dm deploy <cluster-name> <version> <topo> --native-ssh`. Fill in the name of your cluster for `<cluster-name>`, the DM version to be deployed (such as `v7.6.0`) for `<version>` , and the topology file name for `<topo>`.
- Deploy a cluster: `tiup dm deploy <cluster-name> <version> <topo> --native-ssh`. Fill in the name of your cluster for `<cluster-name>`, the DM version to be deployed (such as `v8.0.0`) for `<version>` , and the topology file name for `<topo>`.
- Start a cluster: `tiup dm start <cluster-name> --native-ssh`.
- Upgrade a cluster: `tiup dm upgrade ... --native-ssh`

Expand Down
2 changes: 1 addition & 1 deletion dm/quick-start-create-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ To run a TiDB server, use the following command:
{{< copyable "shell-regular" >}}

```bash
wget https://download.pingcap.org/tidb-community-server-v7.6.0-linux-amd64.tar.gz
wget https://download.pingcap.org/tidb-community-server-v8.0.0-linux-amd64.tar.gz
tar -xzvf tidb-latest-linux-amd64.tar.gz
mv tidb-latest-linux-amd64/bin/tidb-server ./
./tidb-server
Expand Down
2 changes: 1 addition & 1 deletion hardware-and-software-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Library required for running TiDB: glibc (2.28-151.el8 version)

The following CPU architectures are supported:

- x86_64. Starting from TiDB v6.6.0, the [x84-64-v2 instruction set](https://developers.redhat.com/blog/2021/01/05/building-red-hat-enterprise-linux-9-for-the-x86-64-v2-microarchitecture-level) is required.
- x86_64. Starting from TiDB v6.6.0, the [x86-64-v2 instruction set](https://developers.redhat.com/blog/2021/01/05/building-red-hat-enterprise-linux-9-for-the-x86-64-v2-microarchitecture-level) is required.
- ARM 64

## Software recommendations
Expand Down
2 changes: 1 addition & 1 deletion information-schema/information-schema-tidb-servers-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The output is as follows:
PORT: 4000
STATUS_PORT: 10080
LEASE: 45s
VERSION: 8.0.11-TiDB-v7.6.0
VERSION: 8.0.11-TiDB-v8.0.0
GIT_HASH: 827d8ff2d22ac4c93ae1b841b79d468211e1d393
BINLOG_STATUS: Off
LABELS:
Expand Down
2 changes: 1 addition & 1 deletion pd-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ To obtain `pd-ctl` of the latest version, download the TiDB server installation

> **Note:**
>
> `{version}` in the link indicates the version number of TiDB. For example, the download link for `v7.6.0` in the `amd64` architecture is `https://download.pingcap.org/tidb-community-server-v7.6.0-linux-amd64.tar.gz`.
> `{version}` in the link indicates the version number of TiDB. For example, the download link for `v8.0.0` in the `amd64` architecture is `https://download.pingcap.org/tidb-community-server-v8.0.0-linux-amd64.tar.gz`.
### Compile from source code

Expand Down
2 changes: 1 addition & 1 deletion post-installation-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The following information indicates successful login:
```sql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 8.0.11-TiDB-v7.6.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 8.0 compatible
Server version: 8.0.11-TiDB-v8.0.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 8.0 compatible
Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
Expand Down
4 changes: 2 additions & 2 deletions production-deployment-using-tiup.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,13 @@ Before you run the `deploy` command, use the `check` and `check --apply` command
{{< copyable "shell-regular" >}}

```shell
tiup cluster deploy tidb-test v7.6.0 ./topology.yaml --user root [-p] [-i /home/root/.ssh/gcp_rsa]
tiup cluster deploy tidb-test v8.0.0 ./topology.yaml --user root [-p] [-i /home/root/.ssh/gcp_rsa]
```

In the `tiup cluster deploy` command above:

- `tidb-test` is the name of the TiDB cluster to be deployed.
- `v7.6.0` is the version of the TiDB cluster to be deployed. You can see the latest supported versions by running `tiup list tidb`.
- `v8.0.0` is the version of the TiDB cluster to be deployed. You can see the latest supported versions by running `tiup list tidb`.
- `topology.yaml` is the initialization configuration file.
- `--user root` indicates logging into the target machine as the `root` user to complete the cluster deployment. The `root` user is expected to have `ssh` and `sudo` privileges to the target machine. Alternatively, you can use other users with `ssh` and `sudo` privileges to complete the deployment.
- `[-i]` and `[-p]` are optional. If you have configured login to the target machine without password, these parameters are not required. If not, choose one of the two parameters. `[-i]` is the private key of the root user (or other users specified by `--user`) that has access to the target machine. `[-p]` is used to input the user password interactively.
Expand Down
10 changes: 5 additions & 5 deletions quick-start-with-tidb.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ As a distributed system, a basic TiDB test cluster usually consists of 2 TiDB in
{{< copyable "shell-regular" >}}

```shell
tiup playground v7.6.0 --db 2 --pd 3 --kv 3
tiup playground v8.0.0 --db 2 --pd 3 --kv 3
```

The command downloads a version cluster to the local machine and starts it, such as v7.6.0. To view the latest version, run `tiup list tidb`.
The command downloads a version cluster to the local machine and starts it, such as v8.0.0. To view the latest version, run `tiup list tidb`.

This command returns the access methods of the cluster:

Expand Down Expand Up @@ -202,10 +202,10 @@ As a distributed system, a basic TiDB test cluster usually consists of 2 TiDB in
{{< copyable "shell-regular" >}}

```shell
tiup playground v7.6.0 --db 2 --pd 3 --kv 3
tiup playground v8.0.0 --db 2 --pd 3 --kv 3
```

The command downloads a version cluster to the local machine and starts it, such as v7.6.0. To view the latest version, run `tiup list tidb`.
The command downloads a version cluster to the local machine and starts it, such as v8.0.0. To view the latest version, run `tiup list tidb`.

This command returns the access methods of the cluster:

Expand Down Expand Up @@ -437,7 +437,7 @@ Other requirements for the target machine include:
```
- `<cluster-name>`: Set the cluster name
- `<version>`: Set the TiDB cluster version, such as `v7.6.0`. You can see all the supported TiDB versions by running the `tiup list tidb` command
- `<version>`: Set the TiDB cluster version, such as `v8.0.0`. You can see all the supported TiDB versions by running the `tiup list tidb` command
- `-p`: Specify the password used to connect to the target machine.
> **Note:**
Expand Down
Loading

0 comments on commit 2d9ab6e

Please sign in to comment.