Skip to content

indexHashJoin hang in handleTask #35638

@yibin87

Description

@yibin87

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

a) use test; create table t1 ( a int, b int, index idx(b)); create table t2 ( c int, d int, index idx(d));
b) Run the script to insert data:
for i in {1..3000}
do
mysql -h127.0.0.1 -P4000 -uroot -D test -e "insert into t1 values($i, $i);"
mysql -h127.0.0.1 -P4000 -uroot -D test -e "insert into t2 values($i, $i);"
done
c) set @@tidb_max_chunk_size=32;
set @@tidb_index_join_batch_size=32;
INSERT INTO mysql.opt_rule_blacklist VALUES("topn_push_down");
ADMIN reload opt_rule_blacklist;
d)
execute the following sql statement twice:

select /*+ inl_hash_join(t2) */ t1.b from t1 left join t2  on t1.b=t2.d order by t1.b limit 1000,1;

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

The two select statements executed successfully, and output:
+------+
| b |
+------+
| 1001 |
+------+
+------+
| b |
+------+
| 1001 |
+------+

3. What did you see instead (Required)

The first one outputs correctly, while the second one hangs.

4. What is your TiDB version? (Required)

| Release Version: v6.2.0-alpha
Edition: Community
Git Commit Hash: e0527ba
Git Branch: heads/refs/tags/v6.2.0-alpha
UTC Build Time: 2022-06-21 14:26:36
GoVersion: go1.18.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
Store: tikv |

Metadata

Metadata

Assignees

Labels

affects-4.0This bug affects 4.0.x versions.affects-5.0This bug affects 5.0.x versions.affects-5.1This bug affects 5.1.x versions.affects-5.2This bug affects 5.2.x versions.affects-5.3This bug affects 5.3.x versions.affects-5.4This bug affects the 5.4.x(LTS) versions.affects-6.0affects-6.1This bug affects the 6.1.x(LTS) versions.severity/majorsig/executionSIG executiontype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions