Describe the problem
A full cluster backup will backup all jobs (including automatic jobs) in the cluster. A cluster restore into a fresh cluster will restore the jobs from the backup into the system table of the cluster being restored into.
The AUTO SPAN CONFIG job is automatically created on cluster startup. Performing a full cluster restore, will result in 2 such entries for the AUTO SPAN CONFIG job. One started by the restoring cluster, and one from the backup.

To Reproduce
- Start a single node cluster
BACKUP INTO 'nodelocal://0/foo'
- Shut down the cluster
- Start a fresh single node cluster that uses the same
cockroach-data/extern directory.
RESTORE FROM LATEST IN 'nodelocal://0/foo'
SHOW AUTOMATIC JOBS
Expected behavior
Semantics need to be ironed out for cluster backup and restore performed in a dedicated environment, and also as a secondary tenant.
BACKUP TENANT and RESTORE TENANT performed by the system tenant should be okay and only result in a single entry for the span config job. This is because a tenant restore runs in the host tenants' registry and simply writes all keys from [TenantPrefix, TenantPrefix.End] in a newly created, empty tenant. The creation of a tenant does not lead to a AUTO SPAN CONFIG job being triggered, therefore the restored job entry should be the only one of that kind.
Environment:
- CockroachDB version: 21.2 onwards
Epic CRDB-8816
Jira issue: CRDB-9970
Describe the problem
A full cluster backup will backup all jobs (including automatic jobs) in the cluster. A cluster restore into a fresh cluster will restore the jobs from the backup into the system table of the cluster being restored into.
The
AUTO SPAN CONFIGjob is automatically created on cluster startup. Performing a full cluster restore, will result in 2 such entries for theAUTO SPAN CONFIGjob. One started by the restoring cluster, and one from the backup.To Reproduce
BACKUP INTO 'nodelocal://0/foo'cockroach-data/externdirectory.RESTORE FROM LATEST IN 'nodelocal://0/foo'SHOW AUTOMATIC JOBSExpected behavior
Semantics need to be ironed out for cluster backup and restore performed in a dedicated environment, and also as a secondary tenant.
BACKUP TENANTandRESTORE TENANTperformed by the system tenant should be okay and only result in a single entry for the span config job. This is because a tenant restore runs in the host tenants' registry and simply writes all keys from[TenantPrefix, TenantPrefix.End]in a newly created, empty tenant. The creation of a tenant does not lead to aAUTO SPAN CONFIGjob being triggered, therefore the restored job entry should be the only one of that kind.Environment:
Epic CRDB-8816
Jira issue: CRDB-9970