Issue with TiFlash Automatically Selecting Engines

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tiflash自动选择engines问题

| username: HACK

【TiDB Usage Environment】Production\Test Environment\POC
【TiDB Version】
【Encountered Issue】
In the current environment with 2 TiFlash nodes, the table TEST is configured with 2 TiFlash replicas.
The current TiDB instance-level engines list includes tikv\tiflash\tidb.
Executing SELECT COUNT(*) FROM TEST WHERE PAD=‘xxx’, the execution plan shows that TiFlash is used.
I shut down both TiFlash nodes and then executed the COUNT statement again, which failed with a tiflash server timeout. The execution plan still shows TiFlash. Normally, it should automatically choose the tikv engine, right?

Do I need to manually specify the tikv engine when all TiFlash node services are stopped?

【Reproduction Path】Operations performed that led to the issue
【Issue Phenomenon and Impact】
【Attachments】

  • Relevant logs, configuration files, Grafana monitoring (https://metricstool.pingcap.com/)
  • TiUP Cluster Display information
  • TiUP Cluster Edit config information
  • TiDB-Overview monitoring
  • Corresponding module Grafana monitoring (if any, such as BR, TiDB-binlog, TiCDC, etc.)
  • Corresponding module logs (including logs from 1 hour before and after the issue)

For questions related to performance optimization or troubleshooting, please download the script and run it. Please select all and copy-paste the terminal output results for upload.

| username: TiDBer_jYQINSnf | Original post link

There is a parameter, whether it will fall back to TiKV if TiFlash goes down.
By default, it does not fall back because it can easily overwhelm TiKV.

| username: HACK | Original post link

My version is 4.0.16, so in the situation I mentioned above, manual intervention is required to use the TiKV engine, right?

| username: TiDBer_jYQINSnf | Original post link

Version 4.0.16 cannot automatically revert; you need to manually add a hint or force specify the engine.
I remember there seems to be a switch to temporarily mark the TiFlash replica as unavailable, but I can’t find it.
If anyone else sees this and can add more information, please do.
That is to say, without deleting the TiFlash replica, temporarily mark the TiFlash replica as unavailable. I’m not sure if I remember this correctly or if this feature actually exists.