Skip to content

jobs: Add MarkIdle API #74747

@miretskiy

Description

@miretskiy

A running job may want to mark itself Idle. And idle job may be shutdown.
MarkIdle should increment a counter keeping track of the number of idle jobs.

Initial Design for the purposes of allowing CDC to function on Serverless:

  • A jobs_[type]_currently_idle metric will track the number of idle jobs of that type. Using metrics allows for serverless to not rely on the jobs table
  • For now, idleness state will only be stored in the Registry rather than worrying about persisted state yet.
  • Idleness should not be updated more often than twice a minute (so jobs should wait at least 1 minute since becoming active before marking themselves idle again). This allows changes to idleness state to be logged.

This doesn't allow for observability into individual jobs, but this can easily be added as followup.

Epic CRDB-8671

Metadata

Metadata

Assignees

Labels

A-jobsC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-jobs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions