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

parallel apply does not work with mpp #45299

Closed
windtalker opened this issue Jul 11, 2023 · 0 comments · Fixed by #45302
Closed

parallel apply does not work with mpp #45299

windtalker opened this issue Jul 11, 2023 · 0 comments · Fixed by #45302

Comments

@windtalker
Copy link
Contributor

windtalker commented Jul 11, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> drop table if exists test.t;
mysql> create table test.t (a int, b int);
mysql> alter table test.t set tiflash replica 1;
mysql> insert into test.t values(1,2),(2,1),(10,15),(15,10),(20,25),(25,10),(18,19),(19,18);
mysql> insert into test.t select a + 5, b + 5 from test.t;
mysql> insert into test.t select a + 5, b + 5 from test.t;
mysql> insert into test.t select a + 5, b + 5 from test.t;
mysql> insert into test.t select a + 5, b + 5 from test.t;
mysql> insert into test.t select a + 5, b + 5 from test.t;
mysql> insert into test.t select a + 5, b + 5 from test.t;
mysql> insert into test.t select a + 5, b + 5 from test.t;
mysql> insert into test.t select a + 5, b + 5 from test.t;
mysql> insert into test.t select a + 5, b + 5 from test.t;
mysql> explain select count(*) from t where a > (select a from t t1 where t.a > t1.a limit 1);
+--------------------------------------+---------+--------------+---------------+----------------------------------------------------------+
| id                                   | estRows | task         | access object | operator info                                            |
+--------------------------------------+---------+--------------+---------------+----------------------------------------------------------+
| HashAgg_15                           | 1.00    | root         |               | funcs:count(1)->Column#7                                 |
| └─Apply_18                           | 4091.90 | root         |               | CARTESIAN inner join, other cond:gt(test.t.a, test.t.a)  |
|   ├─TableReader_25(Build)            | 4091.90 | root         |               | MppVersion: 2, data:ExchangeSender_24                    |
|   │ └─ExchangeSender_24              | 4091.90 | mpp[tiflash] |               | ExchangeType: PassThrough                                |
|   │   └─Selection_23                 | 4091.90 | mpp[tiflash] |               | not(isnull(test.t.a))                                    |
|   │     └─TableFullScan_22           | 4096.00 | mpp[tiflash] | table:t       | pushed down filter:empty, keep order:false, stats:pseudo |
|   └─Selection_26(Probe)              | 3273.52 | root         |               | not(isnull(test.t.a))                                    |
|     └─Limit_29                       | 4091.90 | root         |               | offset:0, count:1                                        |
|       └─TableReader_39               | 4091.90 | root         |               | MppVersion: 2, data:ExchangeSender_38                    |
|         └─ExchangeSender_38          | 4091.90 | mpp[tiflash] |               | ExchangeType: PassThrough                                |
|           └─Limit_37                 | 4091.90 | mpp[tiflash] |               | offset:0, count:1                                        |
|             └─Selection_36           | 4091.90 | mpp[tiflash] |               | gt(test.t.a, test.t.a)                                   |
|               └─TableFullScan_35     | 5114.88 | mpp[tiflash] | table:t1      | pushed down filter:empty, keep order:false, stats:pseudo |
+--------------------------------------+---------+--------------+---------------+----------------------------------------------------------+
mysql> set tidb_enable_parallel_apply=0;
mysql> select count(*) from t where a > (select a from t t1 where t.a > t1.a limit 1);
+----------+
| count(*) |
+----------+
|     4095 |
+----------+
1 row in set (0.78 sec)
mysql> set tidb_enable_parallel_apply=1;
mysql> select count(*) from t where a > (select a from t t1 where t.a > t1.a limit 1);
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.78 sec)

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

When enable parallel apply, the query return correct result

3. What did you see instead (Required)

When enable parallel apply, query result is wrong

4. What is your TiDB version? (Required)

master@ 90dabc0

@windtalker windtalker added the type/bug The issue is confirmed as a bug. label Jul 11, 2023
@ti-chi-bot ti-chi-bot bot added 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.1 may-affects-6.5 may-affects-7.1 labels Jul 11, 2023
@windtalker windtalker added affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 affects-6.1 affects-6.2 affects-6.3 affects-6.4 affects-6.5 affects-6.6 affects-7.0 affects-7.1 affects-7.2 and removed 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.1 may-affects-6.5 may-affects-7.1 labels Jul 11, 2023
ti-chi-bot bot pushed a commit that referenced this issue Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants