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

subtask can't be re-assigned back when tidb node restart #47298

Closed
seiya-annie opened this issue Sep 26, 2023 · 2 comments · Fixed by #48306
Closed

subtask can't be re-assigned back when tidb node restart #47298

seiya-annie opened this issue Sep 26, 2023 · 2 comments · Fixed by #48306
Labels
affects-7.5 This bug affects the 7.5.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. feature/developing the related feature is in development severity/major type/bug The issue is confirmed as a bug.

Comments

@seiya-annie
Copy link

seiya-annie commented Sep 26, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. run import into command, data in s3, and global-sort mode
  2. check subtask assigned to different tidb node
  3. rolling restart tidb
  4. after tidb recoveried, check subtask

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

runnable subtasks should be assigned to different tidb node

3. What did you see instead (Required)

all subtask are in one tidb node

4. What is your TiDB version? (Required)

master

@seiya-annie seiya-annie added the type/bug The issue is confirmed as a bug. label Sep 26, 2023
@seiya-annie
Copy link
Author

before restart

mysql> select id, state, step, exec_id, cast(error as char) from mysql.tidb_background_subtask where task_key=(select id from mysql.tidb_global_task where task_key='ImportInto/30005' );
+------+---------+------+---------------------------------------------------------------------------------------+---------------------+
| id   | state   | step | exec_id                                                                               | cast(error as char) |
+------+---------+------+---------------------------------------------------------------------------------------+---------------------+
| 1733 | running |    3 | [tc-tidb-4.tc](http://tc-tidb-4.tc/)-tidb-peer.sql-global-sort-and-mvindex-testing-tps-2760376-1-696.svc:4000 | NULL                |
| 1734 | running |    3 | [tc-tidb-1.tc](http://tc-tidb-1.tc/)-tidb-peer.sql-global-sort-and-mvindex-testing-tps-2760376-1-696.svc:4000 | NULL                |
+------+---------+------+---------------------------------------------------------------------------------------+---------------------+
2 rows in set (0.01 sec)

after restart

MySQL [(none)]> select id, state, step, exec_id, cast(error as char) from mysql.tidb_background_subtask where task_key=(select id from mysql.tidb_global_task where task_key='ImportInto/30005');
+------+---------+------+---------------------------------------------------------------------------------------+---------------------+
| id   | state   | step | exec_id                                                                               | cast(error as char) |
+------+---------+------+---------------------------------------------------------------------------------------+---------------------+
| 1733 | running |    3 | [tc-tidb-2.tc](http://tc-tidb-2.tc/)-tidb-peer.sql-global-sort-and-mvindex-testing-tps-2760376-1-696.svc:4000 | NULL                |
| 1734 | pending |    3 | [tc-tidb-2.tc](http://tc-tidb-2.tc/)-tidb-peer.sql-global-sort-and-mvindex-testing-tps-2760376-1-696.svc:4000 | NULL                |
+------+---------+------+---------------------------------------------------------------------------------------+---------------------+
2 rows in set (0.01 sec)

@D3Hunter D3Hunter changed the title [import into]import into subtask can't be re-assigned when tidb node restart subtask can't be re-assigned back when tidb node restart Sep 26, 2023
@seiya-annie seiya-annie added severity/major feature/developing the related feature is in development component/ddl This issue is related to DDL of TiDB. labels Sep 26, 2023
@ti-chi-bot ti-chi-bot bot added 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 Sep 26, 2023
@ywqzzy
Copy link
Contributor

ywqzzy commented Oct 8, 2023

Not a bug.
We can mark it as an enhancement issue since the task behavior will not changed.
We can do some optimization to make the subtasks executor load balanced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.5 This bug affects the 7.5.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. feature/developing the related feature is in development severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants