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(migration9da4a65ef1e3; the autogenerated drop of the trigram index onclassification_translationswas a false positive and is pruned).- The heartbeat writes
runs_jobson insert and in theON CONFLICTupdate, frompod_runs_jobs(settings): the poller switch (deployed worker) or inline dispatch (local dev). A deployed API pod has both off. list_workersfiltersruns_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 withruns_jobs=falseis not listed, one withtrueis.tests/unit/tasks/test_pod_heartbeat_runs_jobs.py: the flag's truth table and the upsert carrying it.