Skip to content

Commit

Permalink
Add workaround about using Stale Read with TiFlash (pingcap#5875)
Browse files Browse the repository at this point in the history
  • Loading branch information
leiysky authored Jul 5, 2021
1 parent 08a34c7 commit c848aa9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions as-of-timestamp.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ This document describes how to perform the [Stale Read](/stale-read.md) feature
> **Warning:**
>
> Currently, Stale Read is an experimental feature. It is not recommended to use it in the production environment.
>
> Currently, you cannot use Stale Read together with TiFlash. If your SQL query contains the `AS OF TIMESTAMP` clause and TiDB might read data from TiFlash replicas, you might encounter an error with a message like `ERROR 1105 (HY000): stale requests require tikv backend`.
>
> To fix the problem, disable TiFlash replicas for your Stale Read query. To do that, perform one of the following operations:
>
> - Use the `set session tidb_isolation_read_engines='tidb,tikv'` variable.
> - Use the [hint](/optimizer-hints.md#read_from_storagetiflasht1_name--tl_name--tikvt2_name--tl_name-) to enforce TiDB to read data from TiKV.
TiDB supports reading historical data through a standard SQL interface, which is the `AS OF TIMESTAMP` SQL clause, without the need for special clients or drivers. After data is updated or deleted, you can read the historical data before the update or deletion using this SQL interface.

Expand Down

0 comments on commit c848aa9

Please sign in to comment.