pingcap / pingcap/tidb

'show analyze status;' lacks a failed analyze job information

Open
#54,657 1 comment 0 reactions 1 assignee Claimed by @hawkingrei View on GitHub
component/statistics severity/moderate sig/planner type/bug
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)

- Trigger auto analyze, and kill auto analyze job immediately
- execute `show analyze status`

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

### 3. What did you see instead (Required)

- 17:11:47.941 Auto analyze triggered, and killed immediately

> `[2024/07/15 17:11:08.057 +00:00] [INFO] [analyze.go:748] ["analyze table `VKYDMN`.`t` has finished"] [partition=] ["job info"="analyze table all indexes, all columns with 256 buckets, 100 topn, 0.010967098703888335 samplerate"] ["start time"=2024/07/15 17:11:05.094 +00:00] ["end time"=2024/07/15 17:11:08.052 +00:00] [cost=2.957842037s] ["sample rate reason"="use min(1, 110000/10030000) as the sample-rate=0.010967098703888335"]`
`[2024/07/15 17:11:19.721 +00:00] [INFO] [set.go:170] ["set global var"] [conn=4194304766] [name=tidb_auto_analyze_start_time] [val="00:00 +0000"]`
`[2024/07/15 17:11:19.740 +00:00] [INFO] [set.go:170] ["set global var"] [conn=4194304766] [name=tidb_auto_analyze_end_time] [val="23:59 +0000"]`
`[2024/07/15 17:11:19.763 +00:00] [INFO] [set.go:170] ["set global var"] [conn=4194304766] [name=tidb_auto_analyze_ratio] [val=0.0001]`
`[2024/07/15 17:11:47.941 +00:00] [INFO] [refresher.go:101] ["Auto analyze triggered"] [category=stats] [job="NonPartitionedTableAnalysisJob:\n\tAnalyzeType: analyzeTable\n\tIndexes: \n\tSchema: VKYDMN\n\tTable: t\n\tTableID: 115\n\tTableStatsVer: 2\n\tChangePercentage: 0.002991\n\tTableSize: 20120000.00\n\tLastAnalysisDuration: 40.1s\n\tWeight: -0.302602\n"]`
`[2024/07/15 17:11:47.951 +00:00] [ERROR] [exec.go:66] ["auto analyze failed"] [category=stats] [sql="analyze table `VKYDMN`.`t`"] [cost_time=10.613364ms] [error="[executor:1317]Query execution was interrupted"]`

- but `show analyze status` latest information still `17:11:08`

> mysql> show analyze status\G
*************************** 1. row ***************************
Table_schema: VKYDMN
Table_name: t
Partition_name:
Job_info: analyze table all indexes, all columns with 256 buckets, 100 topn, 0.010967098703888335 samplerate
Processed_rows: 10030000
Start_time: 2024-07-15 17:11:05
End_time: 2024-07-15 17:11:08
State: finished
Fail_reason: NULL
Instance:
Process_ID: NULL
Remaining_seconds: NULL
Progress: NULL
Estimated_total_rows: NULL

### 4. What is your TiDB version? (Required)

Git Commit Hash: 9044acbff3a189b26b52ffd2990ce7b4f59021e0

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.