cockroachdb / cockroachdb/cockroach
sql: automatically cancel stats jobs that are running for too long
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
**Is your feature request related to a problem? Please describe.**
We have seen cases where stats jobs get stuck for various reasons (e.g., a bug in the jobs system). Since we only allow one stats job at a time in the entire cluster, this can block stats collection for all tables in the cluster until the job is cancelled.
**Describe the solution you'd like**
We should have a way to detect when a stats job has been running for too long, and automatically cancel it. For example, if a stats job has been running for longer than one day (this period should be configurable), we might want to cancel the job.
Even if we eventually allow multiple stats jobs to run at the same time, we should probably still cancel long-running stats jobs. There is no downside to canceling (other than some wasted work), and it will ensure that no table goes too long without a stats refresh.
Jira issue: CRDB-35799
Contributor guide
Assessment
This issue has not been assessed yet.