pingcap / pingcap/tidb

drop table during analyze command running, analyze process will not fail immediately

Open
#50,980 1 comment 0 reactions 1 assignee Claimed by @hawkingrei View on GitHub
component/statistics sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

1. create table test.items
2. analyze table test.items
3. during analyze, drop table
4. show analyze status

### 2. What did you expect to see? (Required)
the task will be failed for table is not exist
### 3. What did you see instead (Required)
task keep running
```
mysql> drop table test.items;
Query OK, 0 rows affected (0.42 sec)

mysql> show analyze status;
+--------------+------------+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+---------------------+---------------------+----------+-------------+---------------------------------------------------------------------------+------------------+-------------------+----------+----------------------+
| Table_schema | Table_name | Partition_name | Job_info | Processed_rows | Start_time | End_time | State | Fail_reason | Instance | Process_ID | Remaining_seconds | Progress | Estimated_total_rows |
+--------------+------------+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+---------------------+---------------------+----------+-------------+---------------------------------------------------------------------------+------------------+-------------------+----------+----------------------+
| test | items | | auto analyze table columns item_primary_key, item_id, item_set_id, product_id, product_set_id, point_of_sale_country, merchant_id, merchant_item_id, merchant_item_set_id, created_time, arrival_time, updated_time with 256 buckets, 500 topn, 1.5804473995716588e-06 samplerate | 340139379 | 2024-02-03 09:56:46 | NULL | running | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | 2548667953184767 | NULL | 0 | 0 |
| test | items | | analyze table columns item_primary_key, item_id, item_set_id, product_id, product_set_id, point_of_sale_country, merchant_id, merchant_item_id, merchant_item_set_id, created_time, arrival_time, updated_time with 256 buckets, 500 topn, 1.5804473995716588e-06 samplerate | 2259991817 | 2024-02-03 11:17:30 | 2024-02-03 11:36:41 | finished | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | NULL | NULL | NULL | NULL |
| test | items | | analyze index image_signatures | 11300000042 | 2024-02-03 11:17:30 | 2024-02-03 11:20:44 | finished | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | NULL | NULL | NULL | NULL |
| test | items | | analyze index canonical_links | 11296231894 | 2024-02-03 11:17:30 | 2024-02-03 11:20:32 | finished | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | NULL | NULL | NULL | NULL |
| test | items | | analyze index normalized_short_link_clusters | 11296234822 | 2024-02-03 11:17:30 | 2024-02-03 11:20:27 | finished | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | NULL | NULL | NULL | NULL |
| test | items | | analyze index domains | 11300000045 | 2024-02-03 11:17:30 | 2024-02-03 11:20:14 | finished | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | NULL | NULL | NULL | NULL |
| test | items | | analyze index feed_profile_ids | 4294032286 | 2024-02-03 11:17:30 | 2024-02-03 11:18:25 | finished | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | NULL | NULL | NULL | NULL |
| test | items | | analyze index feed_item_ids | 4294045624 | 2024-02-03 11:17:30 | 2024-02-03 11:18:23 | finished | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | NULL | NULL | NULL | NULL |
| test | items | | auto analyze index normalized_short_link_clusters | 0 | NULL | NULL | pending | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | 2548667953184767 | NULL | NULL | NULL |
| test | items | | auto analyze index feed_item_ids | 0 | NULL | NULL | pending | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | 2548667953184767 | NULL | NULL | NULL |
| test | items | | auto analyze index canonical_links | 0 | NULL | NULL | pending | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | 2548667953184767 | NULL | NULL | NULL |
| test | items | | auto analyze index feed_profile_ids | 0 | NULL | NULL | pending | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | 2548667953184767 | NULL | NULL | NULL |
| test | items | | auto analyze index image_signatures | 0 | NULL | NULL | pending | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | 2548667953184767 | NULL | NULL | NULL |
| test | items | | auto analyze index domains | 0 | NULL | NULL | pending | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | 2548667953184767 | NULL | NULL | NULL |
+--------------+------------+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+---------------------+---------------------+----------+-------------+---------------------------------------------------------------------------+------------------+-------------------+----------+----------------------+
14 rows in set (0.00 sec)

mysql> use test;
Database changed
mysql> show tables;
Empty set (0.00 sec)

mysql> show analyze status;
+--------------+------------+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+---------------------+---------------------+----------+-------------+---------------------------------------------------------------------------+------------------+-------------------+----------+----------------------+
| Table_schema | Table_name | Partition_name | Job_info | Processed_rows | Start_time | End_time | State | Fail_reason | Instance | Process_ID | Remaining_seconds | Progress | Estimated_total_rows |
+--------------+------------+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+---------------------+---------------------+----------+-------------+---------------------------------------------------------------------------+------------------+-------------------+----------+----------------------+
| test | items | | auto analyze table columns item_primary_key, item_id, item_set_id, product_id, product_set_id, point_of_sale_country, merchant_id, merchant_item_id, merchant_item_set_id, created_time, arrival_time, updated_time with 256 buckets, 500 topn, 1.5804473995716588e-06 samplerate | 340139379 | 2024-02-03 09:56:46 | NULL | running | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | 2548667953184767 | NULL | 0 | 0 |
| test | items | | analyze table columns item_primary_key, item_id, item_set_id, product_id, product_set_id, point_of_sale_country, merchant_id, merchant_item_id, merchant_item_set_id, created_time, arrival_time, updated_time with 256 buckets, 500 topn, 1.5804473995716588e-06 samplerate | 2259991817 | 2024-02-03 11:17:30 | 2024-02-03 11:36:41 | finished | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | NULL | NULL | NULL | NULL |
| test | items | | analyze index image_signatures | 11300000042 | 2024-02-03 11:17:30 | 2024-02-03 11:20:44 | finished | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | NULL | NULL | NULL | NULL |
| test | items | | analyze index canonical_links | 11296231894 | 2024-02-03 11:17:30 | 2024-02-03 11:20:32 | finished | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | NULL | NULL | NULL | NULL |
| test | items | | analyze index normalized_short_link_clusters | 11296234822 | 2024-02-03 11:17:30 | 2024-02-03 11:20:27 | finished | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | NULL | NULL | NULL | NULL |
| test | items | | analyze index domains | 11300000045 | 2024-02-03 11:17:30 | 2024-02-03 11:20:14 | finished | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | NULL | NULL | NULL | NULL |
| test | items | | analyze index feed_profile_ids | 4294032286 | 2024-02-03 11:17:30 | 2024-02-03 11:18:25 | finished | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | NULL | NULL | NULL | NULL |
| test | items | | analyze index feed_item_ids | 4294045624 | 2024-02-03 11:17:30 | 2024-02-03 11:18:23 | finished | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | NULL | NULL | NULL | NULL |
| test | items | | auto analyze index normalized_short_link_clusters | 0 | NULL | NULL | pending | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | 2548667953184767 | NULL | NULL | NULL |
| test | items | | auto analyze index feed_item_ids | 0 | NULL | NULL | pending | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | 2548667953184767 | NULL | NULL | NULL |
| test | items | | auto analyze index canonical_links | 0 | NULL | NULL | pending | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | 2548667953184767 | NULL | NULL | NULL |
| test | items | | auto analyze index feed_profile_ids | 0 | NULL | NULL | pending | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | 2548667953184767 | NULL | NULL | NULL |
| test | items | | auto analyze index image_signatures | 0 | NULL | NULL | pending | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | 2548667953184767 | NULL | NULL | NULL |
| test | items | | auto analyze index domains | 0 | NULL | NULL | pending | NULL | tc-tidb-0.tc-tidb-peer.sql-mvindex-40t-testing-tps-6510195-1-617.svc:4000 | 2548667953184767 | NULL | NULL | NULL |
+--------------+------------+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+---------------------+---------------------+----------+-------------+---------------------------------------------------------------------------+------------------+-------------------+----------+----------------------+
14 rows in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
7.6.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.