Skip to content

Commit

Permalink
reference/performance: correct replica selection policy of follower r…
Browse files Browse the repository at this point in the history
…ead (#1864)

* reference/performance: correct replica selection policy of follower read

* sync with docs-cn changes

pingcap/docs-cn#2311

* Update reference/performance/follower-read.md

Co-Authored-By: Keke Yi <40977455+yikeke@users.noreply.github.com>

* deleted a trailing space

Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>
  • Loading branch information
ran-huang and yikeke committed Feb 27, 2020
1 parent c8ca4b0 commit 1f56c6d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion reference/performance/follower-read.md
Expand Up @@ -47,4 +47,6 @@ When the follower node processes a read request, it first uses `ReadIndex` of th

### Follower replica selection strategy

Because the Follower Read feature guarantees linearizability without affecting Snapshot Isolation, TiDB adopts the round-robin strategy to select the follower replica. Although TiKV can select any follower replica to handle any read request, considering the different replication speed among followers, if the load balancing granularity is too fine, it might cause significant fluctuation of latency. Currently, the granularity of the Follower Read load balancing policy is at the connection level. For a TiDB client connected to a specific Region, the selected follower is fixed, and is switched only when it fails or the scheduling policy is adjusted.
Because the Follower Read feature guarantees linearizability without affecting Snapshot Isolation, TiDB adopts the round-robin strategy to select the follower replica. Currently, for the coprocessor requests, the granularity of the Follower Read load balancing policy is at the connection level. For a TiDB client connected to a specific Region, the selected follower is fixed, and is switched only when it fails or the scheduling policy is adjusted.

However, for the non-coprocessor requests, such as a point query, the granularity of the Follower Read load balancing policy is at the transaction level. For a TiDB transaction on a specific Region, the selected follower is fixed, and is switched only when it fails or the scheduling policy is adjusted.

0 comments on commit 1f56c6d

Please sign in to comment.