cockroachdb / cockroachdb/cockroach

jobs: define internal job owners and access

Open
#96,432 1 comment 0 reactions 0 assignees View on GitHub
C-enhancement T-jobs
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

A user with `CONTROLJOB` cannot modify job created by admins, and there is no discoverable reason for this (see https://cockroachlabs.slack.com/archives/C02DSDS9TM1/p1675194084663479 and https://github.com/cockroachdb/cockroach/pull/51646). We may want to remove this restriction.

One reason we may want to keep this is to prevent users from disrupting internal jobs (ex. migrations). In this case, we can still change the restriction to prevent modifying jobs owned by "root" or "node". However, there are some uncertainties:
- Some internal jobs are owned by "root" and some are owned by "node". Maybe we should make all internal jobs consistently use one of these. You can login as root, but I don't think you can login as "node", so maybe "node" is a better choice
- Some internal jobs, such as schema change and schema change gc don't use "root" or "node" as the job owner. They use the user who executed the query. If a non-admin user kicks off a schema change, a `CONTROLJOB` user can still kill the job. This is undesirable if we want to prevent them from disrupting internal jobs.

Jira issue: CRDB-24122

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.