Skip to content

Commit

Permalink
reference: add new option for tidb_replica_read (pingcap#2762)
Browse files Browse the repository at this point in the history
* reference: add new option for tidb_replica_read

* Update reference/performance/follower-read.md
  • Loading branch information
TomShawn authored and sre-bot committed May 14, 2020
1 parent e0ca92a commit 083e355
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion follower-read.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Follower Read 功能是指在强一致性读的前提下使用 Region 的 follow
## 使用方式

要开启 TiDB 的 Follower Read 功能,修改 SESSION 变量 `tidb_replica_read` 的值即可
要开启 TiDB 的 Follower Read 功能, SESSION 变量 `tidb_replica_read` 的值设置为 `follower``leader-and-follower` 即可

{{< copyable "sql" >}}

Expand All @@ -35,6 +35,7 @@ set @@tidb_replica_read = '<目标值>';

- 当设定为默认值 `leader` 或者空字符串时,TiDB 会维持原有行为方式,将所有的读取操作都发送给 leader 副本处理。
- 当设置为 `follower` 时,TiDB 会选择 Region 的 follower 副本完成所有的数据读取操作。
-`tidb_replica_read` 的值设为 `leader-and-follower` 时,TiDB 可以选择任意副本来执行读取操作。
- 当设置为 `leader-and-follower` 时,读请求会在 leader 和 follower 之间负载均衡。

## 实现机制
Expand Down

0 comments on commit 083e355

Please sign in to comment.