cockroachdb / cockroachdb/cockroach

jobs: clean up `Status` and `RunningStatus` names

Open
#140,704 0 comments 0 reactions 1 assignee Claimed by @msbutler View on GitHub
A-jobs C-cleanup P-3 T-jobs v25.2.0-prerelease
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Currently, we refer to the job's state (e.g. `RUNNING`, `CANCELLED`) as its `status`, and a more descriptive job specific status message, as the `running_status`. These names are confusing for a number of reasons:
- we now store descriptive status messages in the new `system.job_status` page.
- we have always stored the job's state in system.jobs under the `status` column
- we update these descriptive status messages outside of the RUNNING state, so `running_status` isn't a great name

To reduce confusion, I propose that:
- in go code, refactor `status` to `state` and `runningstatus` to `statusMessage`.
- continue to store the job's state, in the system.jobs `status` column because:
- we've got better things to do than build a migration to rename a column
- most users of the jobs system will use higher level apis that correctly use "State"
- in `crdb_internal.jobs` mark the current `status` and `running_status` columns as not visible, and add the `state` and `status_message` columns.

Jira issue: CRDB-47305

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.