tiflash 查询报错No access path for table 'case_temporary_log_20241129' is found with 'tidb_isolation_read_engines' = 'tiflash,tidb', valid values can be 'tikv'.

报错内容:

Error querying database. Cause: java.sql.SQLException: Internal : No access path for table ‘case_temporary_log_20241129’ is found with ‘tidb_isolation_read_engines’ = ‘tiflash,tidb’, valid values can be ‘tikv’

查询tiflash_replica的AVAILABLE一直是0
SELECT * FROM information_schema.tiflash_replica WHERE TABLE_SCHEMA =‘robotai’ and TABLE_NAME=‘case_temporary_log_20241129’;
±-------------±----------------------------±---------±--------------±----------------±----------±---------+
| TABLE_SCHEMA | TABLE_NAME | TABLE_ID | REPLICA_COUNT | LOCATION_LABELS | AVAILABLE | PROGRESS |
±-------------±----------------------------±---------±--------------±----------------±----------±---------+
| robotai | case_temporary_log_20241129 | 127492 | 1 | | 0 | 0 |
±-------------±----------------------------±---------±--------------±----------------±----------±---------+
1 row in set (7.43 sec)
查看region
show table robotai.case_temporary_log_20241129 regions\G
*************************** 1. row ***************************
REGION_ID: 1948435915
START_KEY: t_127492_r
END_KEY: t_127493_
LEADER_ID: 1948435918
LEADER_STORE_ID: 713453789
PEERS: 1948435916, 1948435917, 1948435918, 1948617237
SCATTERING: 0
WRITTEN_BYTES: 167
READ_BYTES: 0
APPROXIMATE_SIZE(MB): 1
APPROXIMATE_KEYS: 0
SCHEDULING_CONSTRAINTS:
SCHEDULING_STATE:
*************************** 2. row ***************************
REGION_ID: 1948617233
START_KEY: t_127490_
END_KEY: t_127492_r
LEADER_ID: 1948617236
LEADER_STORE_ID: 713453789
PEERS: 1948617234, 1948617235, 1948617236
SCATTERING: 0
WRITTEN_BYTES: 0
READ_BYTES: 0
APPROXIMATE_SIZE(MB): 1
APPROXIMATE_KEYS: 0
SCHEDULING_CONSTRAINTS:
SCHEDULING_STATE:
2 rows in set (0.01 sec)
tiflash.log (7.7 KB)
tiflash_error.log (2.1 KB)

如果表确实在TiFlash上有副本,但仍然出现错误,您可能需要调整tidb_isolation_read_engines 变量的设置,确保它包含tikv ,以便在需要时可以从TiKV读取数据。例如,您可以设置为tidb,tikv,tiflash

tiflash不同步tikv的表,大家有遇到过吗,tiflash_replica的AVAILABLE一直是0

看起来你这个表 region 很少说明数据少,但是 tiflash 副本同步一直没成功。

看相关日志感觉也不像有问题。

你要不 alter table tiflash replica 去掉 tiflash 副本,再加一下看看呢?

REGION_ID: 1948617233 这个 region TiFlash 一直没收到,看看 pd 日志里关于这个 region 的调度。