Skip to content

Workers view lists job-running pods only

Problem

GET /v1/sync/workers returned every live row in pods. Since the worker split (#2050 Track B) the three API replicas never claim a job, yet they showed on the pipeline page as workers. They cannot stop heartbeating: pod_ip on that row is how the cross-pod cache broadcast finds them (#2258).

What shipped

  • pods.runs_jobs boolean NOT NULL DEFAULT false (migration 9da4a65ef1e3; the autogenerated drop of the trigram index on classification_translations was a false positive and is pruned).
  • The heartbeat writes runs_jobs on insert and in the ON CONFLICT update, from pod_runs_jobs(settings): the poller switch (deployed worker) or inline dispatch (local dev). A deployed API pod has both off.
  • list_workers filters runs_jobs = true. Response shape unchanged.

Other readers of pods are untouched on purpose: the taxonomy-cache broadcast needs every live pod, and the internal pod lookup by IP is not role-specific.

Tests

  • tests/integration/services/data_ingestion/test_workers_endpoint_pg.py: a pod with runs_jobs=false is not listed, one with true is.
  • tests/unit/tasks/test_pod_heartbeat_runs_jobs.py: the flag's truth table and the upsert carrying it.