Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

point get for update reading from tiflash #39344

Closed
ChenPeng2013 opened this issue Nov 23, 2022 · 1 comment · Fixed by #39388
Closed

point get for update reading from tiflash #39344

ChenPeng2013 opened this issue Nov 23, 2022 · 1 comment · Fixed by #39388
Assignees
Labels
feature/developing the related feature is in development severity/critical sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@ChenPeng2013
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use test;
drop table if exists t;
create table t(a int, b int, c int, primary key(a, b));
insert into t values(1,2,3), (4,5,6);
alter table t set tiflash replica 1;
select sleep(10);
set tidb_enable_tiflash_read_for_write_stmt = on;
set tidb_isolation_read_engines='tidb, tiflash';

begin;
explain select a, b from t where a = 1 and b = 2 for update;

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

MySQL [test]> explain select a, b from t where a = 1 and b = 2 for update;
(1815, "Internal : No access path for table 't' is found with 'tidb_isolation_read_engines' = 'tidb,tiflash', valid values can be 'tikv, tiflash'.")

3. What did you see instead (Required)

MySQL [test]> begin;
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> explain select a, b from t where a = 1 and b = 2 for update;
+--------------------------+---------+--------------+---------------+-------------------------------------------------+
| id                       | estRows | task         | access object | operator info                                   |
+--------------------------+---------+--------------+---------------+-------------------------------------------------+
| SelectLock_6             | 0.01    | root         |               | for update 0                                    |
| └─TableReader_8          | 1.00    | root         |               | data:TableRangeScan_7                           |
|   └─TableRangeScan_7     | 1.00    | cop[tiflash] | table:t       | range:[1 2,1 2], keep order:false, stats:pseudo |
+--------------------------+---------+--------------+---------------+-------------------------------------------------+
3 rows in set (0.00 sec)

4. What is your TiDB version? (Required)

Release Version: v6.5.0-alpha
Edition: Community
Git Commit Hash: 8fc4535575b7cb8b3ed0ef9fe042b510815f423d
Git Branch: heads/refs/tags/v6.5.0-alpha
UTC Build Time: 2022-11-22 14:33:54
GoVersion: go1.19.2
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv
@ChenPeng2013 ChenPeng2013 added type/bug The issue is confirmed as a bug. feature/developing the related feature is in development labels Nov 23, 2022
@gengliqi
Copy link
Contributor

Point get + for update is a particular case for TiDB transaction model.
TiKV will add a lock for the predicate during processing point get even if there is no data.
However, only the existing data can add lock when using coprocessor in the current implementation.

So the plan of using point get is not equal to the plan of using coprocessor in the presence of for update.
/cc @chrysan @Yisaer

@Yisaer Yisaer added the sig/planner SIG: Planner label Nov 23, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 may-affects-6.4 labels Nov 23, 2022
@jebter jebter removed may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 may-affects-6.4 labels Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/developing the related feature is in development severity/critical sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants