Skip to content

Commit

Permalink
merge from upstream master
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-srebot authored Oct 20, 2021
2 parents 158f9de + a4fd8a6 commit 66689a1
Show file tree
Hide file tree
Showing 39 changed files with 1,164 additions and 329 deletions.
121 changes: 0 additions & 121 deletions .circleci/config.yml

This file was deleted.

7 changes: 6 additions & 1 deletion TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
+ [Use TiDB Lightning](/tidb-lightning/migrate-from-csv-using-tidb-lightning.md)
+ [Use `LOAD DATA` Statement](/sql-statements/sql-statement-load-data.md)
+ [Migrate from SQL Files](/migrate-from-mysql-dumpling-files.md)
+ [Replicate Incremental Data between TiDB Clusters in Real Time](/incremental-replication-between-clusters.md)
+ Maintain
+ Upgrade
+ [Use TiUP (Recommended)](/upgrade-tidb-using-tiup.md)
Expand Down Expand Up @@ -142,6 +143,7 @@
+ Tutorials
+ [Multiple Data Centers in One City Deployment](/multi-data-centers-in-one-city-deployment.md)
+ [Three Data Centers in Two Cities Deployment](/three-data-centers-in-two-cities-deployment.md)
+ [Two Data Centers in One City Deployment](/two-data-centers-in-one-city-deployment.md)
+ Read Historical Data
+ Use Stale Read (Recommended)
+ [Usage Scenarios of Stale Read](/stale-read.md)
Expand Down Expand Up @@ -557,17 +559,20 @@
+ [All Releases](/releases/release-notes.md)
+ v5.2
+ [5.2.1](/releases/release-5.2.1.md)
+ [5.2.0](/releases/release-5.2.0.md)
+ [5.2.0](/releases/release-5.2.0.md)
+ v5.1
+ [5.1.2](/releases/release-5.1.2.md)
+ [5.1.1](/releases/release-5.1.1.md)
+ [5.1.0](/releases/release-5.1.0.md)
+ v5.0
+ [5.0.4](/releases/release-5.0.4.md)
+ [5.0.3](/releases/release-5.0.3.md)
+ [5.0.2](/releases/release-5.0.2.md)
+ [5.0.1](/releases/release-5.0.1.md)
+ [5.0 GA](/releases/release-5.0.0.md)
+ [5.0.0-rc](/releases/release-5.0.0-rc.md)
+ v4.0
+ [4.0.15](/releases/release-4.0.15.md)
+ [4.0.14](/releases/release-4.0.14.md)
+ [4.0.13](/releases/release-4.0.13.md)
+ [4.0.12](/releases/release-4.0.12.md)
Expand Down
2 changes: 1 addition & 1 deletion adopters.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ This is a list of TiDB adopters in various industries.
|[VNG](https://en.wikipedia.org/wiki/VNG_Corporation)|Mobile Payment|English [#1](https://pingcap.com/case-studies/tidb-at-zalopay-infrastructure-lesson-learned/), [#2](https://pingcap.com/case-studies/zalopay-using-a-scale-out-mysql-alternative-to-serve-millions-of-users)|
|[Ping++](https://www.crunchbase.com/organization/ping-5)|Mobile Payment||
|[LianLian Tech](https://www.crunchbase.com/organization/lianlian-pay)|Mobile Payment||
|[Pinterest](https://en.wikipedia.org/wiki/Pinterest)|Media and Entertainment|[English](https://pingcap.com/case-studies/how-pinterest-reduced-costs-and-improved-data-consistency-with-newsql-database)|
|[U-Next](https://www.crunchbase.com/organization/u-next)|Media and Entertainment|[English](https://pingcap.com/case-studies/running-a-scale-out-database-on-arm-as-mysql-alternative/)|
|[Dailymotion](https://en.wikipedia.org/wiki/Dailymotion)|Media and Entertainment||
|[iQiyi](https://en.wikipedia.org/wiki/IQiyi)|Media and Entertainment|[English](https://pingcap.com/case-studies/tidb-in-iqiyi/)|
Expand Down Expand Up @@ -66,6 +65,7 @@ This is a list of TiDB adopters in various industries.
|[SEA group](https://sea-group.org/?lang=en)|Gaming||
|[Zhaopin.com](https://www.crunchbase.com/organization/zhaopin)|Recruiting||
|[BIGO](https://www.crunchbase.com/organization/bigo-technology)|Live Streaming|[English](https://pingcap.com/case-studies/why-we-chose-an-htap-database-over-mysql-for-horizontal-scaling-and-complex-queries/); [Chinese](https://pingcap.com/cases-cn/user-case-bigo/)|
|[Huya Live](https://en.wikipedia.org/wiki/Huya_Live)|Live Streaming|[English](https://pingcap.com/case-studies/how-we-scale-out-databases-and-get-big-data-queries-6x-faster-with-a-mysql-alternative); [Chinese](https://pingcap.com/zh/case/user-case-huya)|
|[Panda.tv](https://www.crunchbase.com/organization/panda-tv)|Live Streaming||
|[Phoenix New Media](https://www.crunchbase.com/organization/phoenix-new-media)|Media||
|[Tencent OMG](https://en.wikipedia.org/wiki/Tencent)|Media||
Expand Down
22 changes: 21 additions & 1 deletion alert-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aliases: ['/docs/dev/alert-rules/','/docs/dev/reference/alert-rules/']

# TiDB Cluster Alert Rules

This document describes the alert rules for different components in a TiDB cluster, including the rule descriptions and solutions of the alert items in TiDB, TiKV, PD, TiDB Binlog, Node_exporter and Blackbox_exporter.
This document describes the alert rules for different components in a TiDB cluster, including the rule descriptions and solutions of the alert items in TiDB, TiKV, PD, TiFlash, TiDB Binlog, Node_exporter and Blackbox_exporter.

According to the severity level, alert rules are divided into three categories (from high to low): emergency-level, critical-level, and warning-level. This division of severity levels applies to all alert items of each component below.

Expand Down Expand Up @@ -781,6 +781,10 @@ This section gives the alert rules for the TiKV component.

The speed of splitting Regions is slower than the write speed. To alleviate this issue, you’d better update TiDB to a version that supports batch-split (>= 2.1.0-rc1). If it is not possible to update temporarily, you can use `pd-ctl operator add split-region <region_id> --policy=approximate` to manually split Regions.

## TiFlash alert rules

For the detailed descriptions of TiFlash alert rules, see [TiFlash Alert Rules](/tiflash/tiflash-alert-rules.md).

## TiDB Binlog alert rules

For the detailed descriptions of TiDB Binlog alert rules, see [TiDB Binlog monitoring document](/tidb-binlog/monitor-tidb-binlog-cluster.md#alert-rules).
Expand Down Expand Up @@ -954,6 +958,22 @@ This section gives the alert rules for the Blackbox_exporter TCP, ICMP, and HTTP
* Check whether the TiDB process exists.
* Check whether the network between the monitoring machine and the TiDB machine is normal.

#### `TiFlash_server_is_down`

* Alert rule:

`probe_success{group="tiflash"} == 0`

* Description:

Failure to probe the TiFlash service port.

* Solution:

* Check whether the machine that provides the TiFlash service is down.
* Check whether the TiFlash process exists.
* Check whether the network between the monitoring machine and the TiFlash machine is normal.

#### `Pump_server_is_down`

* Alert rule:
Expand Down
2 changes: 1 addition & 1 deletion best-practices/pd-scheduling-best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Because different nodes might differ in performance, you can also set the weight

### Hot regions scheduling

For hot regions scheduling, use `hot-region-scheduler`. Currently in TiDB 3.0, the process is performed as follows:
For hot regions scheduling, use `hot-region-scheduler`. Since TiDB v3.0, the process is performed as follows:

1. Count hot regions by determining read/write traffic that exceeds a certain threshold for a certain period based on the information reported by stores.

Expand Down
2 changes: 1 addition & 1 deletion blocklist-control-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The blocklist of expression pushdown is one way to tune the expression pushdown,
| [Logical operations](/functions-and-operators/operators.md#logical-operators) | AND (&&), OR (&#124;&#124;), NOT (!) |
| [Comparison functions and operators](/functions-and-operators/operators.md#comparison-functions-and-operators) | <, <=, =, != (`<>`), >, >=, [`<=>`](https://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#operator_equal-to), [`IN()`](https://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_in), IS NULL, LIKE, IS TRUE, IS FALSE, [`COALESCE()`](https://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_coalesce) |
| [Numeric functions and operators](/functions-and-operators/numeric-functions-and-operators.md) | +, -, *, /, [`ABS()`](https://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html#function_abs), [`CEIL()`](https://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html#function_ceil), [`CEILING()`](https://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html#function_ceiling), [`FLOOR()`](https://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html#function_floor) |
| [Control flow functions](/functions-and-operators/control-flow-functions.md) | [`CASE`](https://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html#operator_case), [`IF()`](https://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html#function_if), [`IFNULL()`](https://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html#function_ifnull) |
| [Control flow functions](/functions-and-operators/control-flow-functions.md) | [`CASE`](https://dev.mysql.com/doc/refman/5.7/en/flow-control-functions.html#operator_case), [`IF()`](https://dev.mysql.com/doc/refman/5.7/en/flow-control-functions.html#function_if), [`IFNULL()`](https://dev.mysql.com/doc/refman/5.7/en/flow-control-functions.html#function_ifnull) |
| [JSON functions](/functions-and-operators/json-functions.md) | [JSON_TYPE(json_val)](https://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html#function_json-type),<br/> [JSON_EXTRACT(json_doc, path[, path] ...)](https://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html#function_json-extract),<br/> [JSON_UNQUOTE(json_val)](https://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html#function_json-unquote),<br/> [JSON_OBJECT(key, val[, key, val] ...)](https://dev.mysql.com/doc/refman/5.7/en/json-creation-functions.html#function_json-object),<br/> [JSON_ARRAY([val[, val] ...])](https://dev.mysql.com/doc/refman/5.7/en/json-creation-functions.html#function_json-array),<br/> [JSON_MERGE(json_doc, json_doc[, json_doc] ...)](https://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html#function_json-merge),<br/> [JSON_SET(json_doc, path, val[, path, val] ...)](https://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html#function_json-set),<br/> [JSON_INSERT(json_doc, path, val[, path, val] ...)](https://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html#function_json-insert),<br/> [JSON_REPLACE(json_doc, path, val[, path, val] ...)](https://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html#function_json-replace),<br/> [JSON_REMOVE(json_doc, path[, path] ...)](https://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html#function_json-remove) |
| [Date and time functions](/functions-and-operators/date-and-time-functions.md) | [`DATE_FORMAT()`](https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_date-format) |

Expand Down
23 changes: 16 additions & 7 deletions br/use-br-command-line-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Back up all the cluster data to the `/tmp/backup` path of each TiKV node and wri
br backup full \
--pd "${PDIP}:2379" \
--storage "local:///tmp/backup" \
--ratelimit 120 \
--ratelimit 128 \
--log-file backupfull.log
```

Expand All @@ -106,7 +106,7 @@ A progress bar is displayed in the terminal during the backup. When the progress
br backup full \
--pd "${PDIP}:2379" \
--storage "local:///tmp/backup" \
--ratelimit 120 \
--ratelimit 128 \
--log-file backupfull.log
Full Backup <---------/................................................> 17.12%.
```
Expand All @@ -126,7 +126,7 @@ br backup db \
--pd "${PDIP}:2379" \
--db test \
--storage "local:///tmp/backup" \
--ratelimit 120 \
--ratelimit 128 \
--log-file backuptable.log
```

Expand All @@ -150,7 +150,7 @@ br backup table \
--db test \
--table usertable \
--storage "local:///tmp/backup" \
--ratelimit 120 \
--ratelimit 128 \
--log-file backuptable.log
```

Expand Down Expand Up @@ -178,7 +178,7 @@ br backup full \
--pd "${PDIP}:2379" \
--filter 'db*.tbl*' \
--storage "local:///tmp/backup" \
--ratelimit 120 \
--ratelimit 128 \
--log-file backupfull.log
```

Expand Down Expand Up @@ -211,6 +211,7 @@ br backup full \
--storage "s3://${Bucket}/${Folder}" \
--s3.region "${region}" \
--send-credentials-to-tikv=true \
--ratelimit 128 \
--log-file backuptable.log
```

Expand All @@ -230,6 +231,7 @@ To back up the incremental data between `(LAST_BACKUP_TS, current PD timestamp]`
```shell
br backup full\
--pd ${PDIP}:2379 \
--ratelimit 128 \
-s local:///home/tidb/backupdata/incr \
--lastbackupts ${LAST_BACKUP_TS}
```
Expand Down Expand Up @@ -282,6 +284,7 @@ For example, you can execute the following command to back up all keys between `
br backup raw --pd $PD_ADDR \
-s "local://$BACKUP_DIR" \
--start 31 \
--ratelimit 128 \
--end 3130303030303030 \
--format hex \
--cf default
Expand Down Expand Up @@ -339,6 +342,7 @@ A progress bar is displayed in the terminal during the restoration. When the pro
br restore full \
--pd "${PDIP}:2379" \
--storage "local:///tmp/backup" \
--ratelimit 128 \
--log-file restorefull.log
Full Restore <---------/...............................................> 17.12%.
```
Expand All @@ -357,6 +361,7 @@ Restore a database backed up in the `/tmp/backup` path to the cluster.
br restore db \
--pd "${PDIP}:2379" \
--db "test" \
--ratelimit 128 \
--storage "local:///tmp/backup" \
--log-file restorefull.log
```
Expand All @@ -382,6 +387,7 @@ br restore table \
--pd "${PDIP}:2379" \
--db "test" \
--table "usertable" \
--ratelimit 128 \
--storage "local:///tmp/backup" \
--log-file restorefull.log
```
Expand Down Expand Up @@ -434,6 +440,7 @@ br restore full \
--pd "${PDIP}:2379" \
--storage "s3://${Bucket}/${Folder}" \
--s3.region "${region}" \
--ratelimit 128 \
--send-credentials-to-tikv=true \
--log-file restorefull.log
```
Expand All @@ -453,7 +460,7 @@ When you restore data using BR, the tables created in the `mysql` schema are not
{{< copyable "shell-regular" >}}
```shell
br restore full -f '*.*' -f '!mysql.*' -f 'mysql.usertable' -s $external_storage_url
br restore full -f '*.*' -f '!mysql.*' -f 'mysql.usertable' -s $external_storage_url --ratelimit 128
```
In the above command, `-f '*.*'` is used to override the default rules and `-f '!mysql.*'` instructs BR not to restore tables in `mysql` unless otherwise stated. `-f 'mysql.usertable'` indicates that `mysql.usertable` is required for restore. For detailed implementation, refer to the [table filter document](/table-filter.md#syntax).
Expand All @@ -463,7 +470,7 @@ If you only need to restore `mysql.usertable`, use the following command:
{{< copyable "shell-regular" >}}
```shell
br restore full -f 'mysql.usertable' -s $external_storage_url
br restore full -f 'mysql.usertable' -s $external_storage_url --ratelimit 128
```
> **Warning:**
Expand Down Expand Up @@ -492,6 +499,7 @@ br restore raw --pd $PD_ADDR \
-s "local://$BACKUP_DIR" \
--start 31 \
--end 3130303030303030 \
--ratelimit 128 \
--format hex \
--cf default
```
Expand Down Expand Up @@ -530,6 +538,7 @@ During data restoration, writing too much data affects the performance of the on
```
br restore full \
-s "local://$BACKUP_DIR" \
--ratelimit 128 \
--pd $PD_ADDR \
--online
```
Loading

0 comments on commit 66689a1

Please sign in to comment.