Skip to content

Commit

Permalink
Update use-tidb-to-read-tiflash.md
Browse files Browse the repository at this point in the history
  • Loading branch information
joey-yez committed Dec 25, 2023
1 parent de49c6c commit 01fb689
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tiflash/use-tidb-to-read-tiflash.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,7 @@ In the above three ways of reading TiFlash replicas, engine isolation specifies

> **Note:**
>
> Before v4.0.3, the behavior of reading from TiFlash replica in a non-read-only SQL statement (for example, `INSERT INTO ... SELECT`, `SELECT ... FOR UPDATE`, `UPDATE ...`, `DELETE ...`) is undefined. In v4.0.3 and later versions, internally TiDB ignores the TiFlash replica for a non-read-only SQL statement to guarantee the data correctness. That is, for [smart selection](#smart-selection), TiDB automatically selects the non-TiFlash replica; for [engine isolation](#engine-isolation) that specifies TiFlash replica **only**, TiDB reports an error; and for [manual hint](#manual-hint), TiDB ignores the hint.
> - Before v4.0.3, the behavior of reading from TiFlash replica in a non-read-only SQL statement (for example, `INSERT INTO ... SELECT`, `SELECT ... FOR UPDATE`, `UPDATE ...`, `DELETE ...`) is undefined.
> - In versions between v4.0.3 and v6.3.0, internally TiDB ignores the TiFlash replica for a non-read-only SQL statement to guarantee the data correctness. That is, for [smart selection](#smart-selection), TiDB automatically selects the non-TiFlash replica; for [engine isolation](#engine-isolation) that specifies TiFlash replica **only**, TiDB reports an error; and for [manual hint](#manual-hint), TiDB ignores the hint.
> - In versions between v6.4.0 and v7.0.0, if the TiFlash replica is enabled, you can use the variable [tidb_enable_tiflash_read_for_write_stmt](/system-variables.md#tidb_enable_tiflash_read_for_write_stmt-new-in-v630) to decide whether to use the TiFlash replica for a non-read-only SQL statement.
> - In v7.1.0 and later versions, if the TiFlash replica is enabled and the [SQL Mode](/sql-mode.md) of the current session is not STRICT Mode(the variable `sql_mode` does not include `STRICT_TRANS_TABLES` or `STRICT_ALL_TABLES`), TiDB will decide automatically whether to use the TiFlash replica based on cost estimation for a non-read-only SQL statement.

0 comments on commit 01fb689

Please sign in to comment.