Skip to content

ddl: ROW_COUNT display abnormally in txn mode when adding index #60145

@fzzf678

Description

@fzzf678

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. Use sysbench prepare 100w data
  2. Add index in txn mode and use admin show ddl jobs check the row_count
mysql> SET GLOBAL tidb_enable_dist_task= off;set global tidb_ddl_enable_fast_reorg = off;
Query OK, 0 rows affected (0.02 sec)
mysql> alter table sbtest1 add index(id);
Query OK, 0 rows affected (13.02 sec)
mysql> admin show ddl jobs where job_id = 116;
+--------+---------+------------+-----------+----------------------+-----------+----------+-----------+----------------------------+----------------------------+----------+---------+----------+
| JOB_ID | DB_NAME | TABLE_NAME | JOB_TYPE  | SCHEMA_STATE         | SCHEMA_ID | TABLE_ID | ROW_COUNT | CREATE_TIME                | START_TIME                 | END_TIME | STATE   | COMMENTS |
+--------+---------+------------+-----------+----------------------+-----------+----------+-----------+----------------------------+----------------------------+----------+---------+----------+
|    116 | test    | sbtest1    | add index | write reorganization |         2 |      110 |         0 | 2025-03-18 15:44:26.041000 | 2025-03-18 15:44:26.041000 | NULL     | running | txn      |
+--------+---------+------------+-----------+----------------------+-----------+----------+-----------+----------------------------+----------------------------+----------+---------+----------+
1 row in set (0.00 sec)

mysql> admin show ddl jobs where job_id = 116;
+--------+---------+------------+-----------+--------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+--------+----------+
| JOB_ID | DB_NAME | TABLE_NAME | JOB_TYPE  | SCHEMA_STATE | SCHEMA_ID | TABLE_ID | ROW_COUNT | CREATE_TIME                | START_TIME                 | END_TIME                   | STATE  | COMMENTS |
+--------+---------+------------+-----------+--------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+--------+----------+
|    116 | test    | sbtest1    | add index | public       |         2 |      110 |   1000000 | 2025-03-18 15:44:26.041000 | 2025-03-18 15:44:26.041000 | 2025-03-18 15:44:39.042000 | synced | txn      |
+--------+---------+------------+-----------+--------------+-----------+----------+-----------+----------------------------+----------------------------+----------------------------+--------+----------+
1 row in set (0.00 sec)

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

Show median values in ROW_COUNT when adding index.

3. What did you see instead (Required)

Only 0 and final rows can be seen in the whole process. I check the v7.5.6, it can display normally.

4. What is your TiDB version? (Required)

v8.5.1

Metadata

Metadata

Assignees

Labels

affects-8.5This bug affects the 8.5.x(LTS) versions.component/ddlThis issue is related to DDL of TiDB.report/customerCustomers have encountered this bug.severity/moderatetype/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