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

Row count maybe inaccurate when adding index with DXF #56942

Closed
tangenta opened this issue Oct 29, 2024 · 2 comments · Fixed by #57063
Closed

Row count maybe inaccurate when adding index with DXF #56942

tangenta opened this issue Oct 29, 2024 · 2 comments · Fixed by #57063
Assignees
Labels
affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.4 affects-8.5 This bug affects the 8.5.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@tangenta
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Add indexes on tables with 10k rows.

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

All adding index jobs row count should be 10000.

3. What did you see instead (Required)

mysql> admin show ddl jobs;
+--------+---------+------------+------------------------+--------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+--------+
| JOB_ID | DB_NAME | TABLE_NAME | JOB_TYPE               | SCHEMA_STATE | SCHEMA_ID | TABLE_ID | ROW_COUNT | CREATE_TIME                | START_TIME                 | END_TIME                   | STATE  |
+--------+---------+------------+------------------------+--------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+--------+
|    596 | test    | sbtest27   | add index /* ingest */ | public       |       195 |      257 |     10000 | 2024-10-29 05:38:35.684000 | 2024-10-29 05:40:26.534000 | 2024-10-29 05:40:28.433000 | synced |
|    595 | test    | sbtest4    | add index /* ingest */ | public       |       195 |      203 |     10000 | 2024-10-29 05:38:35.684000 | 2024-10-29 05:40:26.334000 | 2024-10-29 05:40:30.034000 | synced |
|    594 | test    | sbtest99   | add index /* ingest */ | public       |       195 |      440 |     10000 | 2024-10-29 05:38:35.684000 | 2024-10-29 05:40:24.584000 | 2024-10-29 05:40:26.484000 | synced |
|    593 | test    | sbtest81   | add index /* ingest */ | public       |       195 |      470 |     10000 | 2024-10-29 05:38:35.684000 | 2024-10-29 05:40:24.334000 | 2024-10-29 05:40:26.283000 | synced |
|    592 | test    | sbtest47   | add index /* ingest */ | public       |       195 |      313 |         0 | 2024-10-29 05:38:35.633000 | 2024-10-29 05:40:22.684000 | 2024-10-29 05:40:24.584000 | synced |
|    591 | test    | sbtest91   | add index /* ingest */ | public       |       195 |      422 |     10000 | 2024-10-29 05:38:35.633000 | 2024-10-29 05:40:22.434000 | 2024-10-29 05:40:24.334000 | synced |
|    590 | test    | sbtest85   | add index /* ingest */ | public       |       195 |      476 |         0 | 2024-10-29 05:38:35.584000 | 2024-10-29 05:40:20.683000 | 2024-10-29 05:40:22.634000 | synced |
|    589 | test    | sbtest97   | add index /* ingest */ | public       |       195 |      494 |     10000 | 2024-10-29 05:38:35.584000 | 2024-10-29 05:40:20.483000 | 2024-10-29 05:40:22.434000 | synced |
|    588 | test    | sbtest28   | add index /* ingest */ | public       |       195 |      259 |     10000 | 2024-10-29 05:38:35.584000 | 2024-10-29 05:40:16.933000 | 2024-10-29 05:40:20.683000 | synced |
|    587 | test    | sbtest9    | add index /* ingest */ | public       |       195 |      235 |     10000 | 2024-10-29 05:38:35.484000 | 2024-10-29 05:40:16.734000 | 2024-10-29 05:40:20.483000 | synced |
+--------+---------+------------+------------------------+--------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+--------+
[2024/10/29 05:40:24.552 +00:00] [WARN] [index.go:2684] ["cannot get task"] [category=ddl] [task_key=ddl/backfill/592] [error="task not found"]

4. What is your TiDB version? (Required)

c550aae

@tangenta tangenta added type/bug The issue is confirmed as a bug. severity/moderate affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.4 labels Oct 29, 2024
@tangenta
Copy link
Contributor Author

Similar to GetTaskByIDWithHistory, updateDistTaskRowCount should get the task from both mysql.tidb_global_task and mysql.tidb_global_task_history.

@jebter jebter added the component/ddl This issue is related to DDL of TiDB. label Oct 29, 2024
@fzzf678
Copy link
Contributor

fzzf678 commented Oct 30, 2024

/assign

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

Successfully merging a pull request may close this issue.

3 participants