Skip to content

TiFlash plan returns No access path error in RC isolation level #65059

Closed

Description

@pcqz7

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t1(a int primary key, b int);
create table t2(a int primary key, b int);
alter table t1 set tiflash replica 1;
alter table t2 set tiflash replica 1;
set tx_isolation="READ-COMMITTED";
begin;
explain select /*+ set_var(tidb_isolation_read_engines='tidb,tiflash'),set_var(tidb_enforce_mpp=on) */ * from t1 join t2 on t1.a=t2.b where t1.a in (1,2);

2. What did you expect to see? (Required)

TiFlash plan is shown without error.

3. What did you see instead (Required)

ERROR 1815 (HY000): Internal : No access path for table 't1' is found with 'tidb_isolation_read_engines' = 'tidb,tiflash', valid values can be 'tikv'.

4. What is your TiDB version? (Required)

v8.5.1

Activity

  1. pcqz7 commented on Dec 16, 2025

    @pcqz7
    Author

    /report customer

  2. pcqz7 commented on Dec 16, 2025

    @pcqz7
    Author

    The error could be an expected behavior after the fix #39543, but TiFlash supports RC isolation level that's not exactly the same as for update.

  3. elsa0520 commented on Dec 16, 2025

    @elsa0520
    Contributor

    I try to reproduce this problem and I found
    If query the t1 without where predicate, it is ok.

    mysql> explain  select  /*+ set_var(tidb_isolation_read_engines='tidb,tiflash'),set_var(tidb_enforce_mpp=on) */ * from t1 ;
    +-------------------------+----------+--------------+---------------+--------------------------------------+
    | id                      | estRows  | task         | access object | operator info                        |
    +-------------------------+----------+--------------+---------------+--------------------------------------+
    | TableReader_10          | 10000.00 | root         |               | MppVersion: 2, data:ExchangeSender_9 |
    | └─ExchangeSender_9      | 10000.00 | mpp[tiflash] |               | ExchangeType: PassThrough            |
    |   └─TableFullScan_8     | 10000.00 | mpp[tiflash] | table:t1      | keep order:false, stats:pseudo       |
    +-------------------------+----------+--------------+---------------+--------------------------------------+
    3 rows in set (0.00 sec)
    

    But if query the t1 with where predicate, it is error

    mysql> explain  select  /*+ set_var(tidb_isolation_read_engines='tidb,tiflash'),set_var(tidb_enforce_mpp=on) */ * from t1 where t1.a in (1,2);
    ERROR 1815 (HY000): Internal : No access path for table 't1' is found with 'tidb_isolation_read_engines' = 'tidb,tiflash', valid values can be 'tikv'.
    
  4. elsa0520 commented on Dec 16, 2025

    @elsa0520
    Contributor

    If the query is inside of transaction, it failed.

    So the trigger condition are:

    1. In the RC isolation level: begin transaction
    2. Query the table with primary key condition : can short path to batch point get
    mysql> explain  select  /*+ set_var(tidb_isolation_read_engines='tidb,tiflash'),set_var(tidb_enforce_mpp=on) */ * from t1 where t1.a in (1,2);
    +--------------------------+---------+--------------+---------------+----------------------------------------------------+
    | id                       | estRows | task         | access object | operator info                                      |
    +--------------------------+---------+--------------+---------------+----------------------------------------------------+
    | TableReader_11           | 2.00    | root         |               | MppVersion: 2, data:ExchangeSender_10              |
    | └─ExchangeSender_10      | 2.00    | mpp[tiflash] |               | ExchangeType: PassThrough                          |
    |   └─TableRangeScan_9     | 2.00    | mpp[tiflash] | table:t1      | range:[1,1], [2,2], keep order:false, stats:pseudo |
    +--------------------------+---------+--------------+---------------+----------------------------------------------------+
    3 rows in set (0.00 sec)
    
    mysql> begin;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> explain  select  /*+ set_var(tidb_isolation_read_engines='tidb,tiflash'),set_var(tidb_enforce_mpp=on) */ * from t1 where t1.a in (1,2);
    ERROR 1815 (HY000): Internal : No access path for table 't1' is found with 'tidb_isolation_read_engines' = 'tidb,tiflash', valid values can be 'tikv'.
    
  5. added
    type/questionThe issue belongs to a question.
    and removed
    type/bugThe issue is confirmed as a bug.
    on Dec 16, 2025
  6. pcqz7 commented on Dec 16, 2025

    @pcqz7
    Author

    After the fix #39553, the error is reported

    mysql> create table t1(a int primary key, b int);
    Query OK, 0 rows affected (0.12 sec)
    
    mysql> create table t2(a int primary key, b int);
    Query OK, 0 rows affected (0.11 sec)
    
    mysql> alter table t1 set tiflash replica 1;
    Query OK, 0 rows affected (0.11 sec)
    
    mysql> alter table t2 set tiflash replica 1;
    Query OK, 0 rows affected (0.10 sec)
    
    mysql> set tx_isolation="READ-COMMITTED";
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> begin;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> explain select /*+ set_var(tidb_isolation_read_engines='tidb,tiflash'),set_var(tidb_enforce_mpp=on) */ * from t1 join t2 on t1.a=t2.b where t1.a in (1,2);
    +---------------------------------+----------+--------------+---------------+----------------------------------------------+
    | id                              | estRows  | task         | access object | operator info                                |
    +---------------------------------+----------+--------------+---------------+----------------------------------------------+
    | HashJoin_21                     | 2.50     | root         |               | inner join, equal:[eq(test.t1.a, test.t2.b)] |
    | ├─Batch_Point_Get_28(Build)     | 2.00     | root         | table:t1      | handle:[1 2], keep order:false, desc:false   |
    | └─TableReader_27(Probe)         | 20.00    | root         |               | data:Selection_26                            |
    |   └─Selection_26                | 20.00    | cop[tiflash] |               | in(test.t2.b, 1, 2), not(isnull(test.t2.b))  |
    |     └─TableFullScan_25          | 10000.00 | cop[tiflash] | table:t2      | keep order:false, stats:pseudo               |
    +---------------------------------+----------+--------------+---------------+----------------------------------------------+
    5 rows in set, 4 warnings (0.00 sec)
    
    mysql> show warnings;
    +---------+------+--------------------------------------------------------------------------+
    | Level   | Code | Message                                                                  |
    +---------+------+--------------------------------------------------------------------------+
    | Warning | 3637 | Variable 'tidb_isolation_read_engines' cannot be set using SET_VAR hint. |
    | Warning | 3637 | Variable 'tidb_enforce_mpp' cannot be set using SET_VAR hint.            |
    | Warning | 3637 | Variable 'tidb_isolation_read_engines' cannot be set using SET_VAR hint. |
    | Warning | 3637 | Variable 'tidb_enforce_mpp' cannot be set using SET_VAR hint.            |
    +---------+------+--------------------------------------------------------------------------+
    4 rows in set (0.00 sec)
    
    mysql> set tidb_isolation_read_engines='tidb,tiflash';
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> set tidb_enforce_mpp=on;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> explain select /*+ set_var(tidb_isolation_read_engines='tidb,tiflash'),set_var(tidb_enforce_mpp=on) */ * from t1 join t2 on t1.a=t2.b where t1.a in (1,2);
    ERROR 1815 (HY000): Internal : No access path for table 't1' is found with 'tidb_isolation_read_engines' = 'tidb,tiflash', valid values can be 'tikv'.
    mysql> select tidb_version();
    +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | tidb_version()                                                                                                                                                                                                                                                                                |
    +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Release Version: v6.5.0-alpha-274-g35319e8
    Edition: Community
    Git Commit Hash: 35319e8f2a237b548326cc97fe99fb8d72b81385
    Git Branch: HEAD
    UTC Build Time: 2025-12-16 09:54:27
    GoVersion: go1.19.9
    Race Enabled: false
    TiKV Min Version: 6.2.0-alpha
    Check Table Before Drop: false
    Store: tikv |
    +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)
    
  7. self-assigned this
    on Dec 18, 2025
  8. added a commit that references this issue on Dec 29, 2025
    1776433
  9. added a commit that references this issue on Jan 14, 2026
    084304b
  10. added a commit that references this issue on Mar 17, 2026
    e6de890
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions