pgadmin-org / pgagent

pgAgent - A job scheduler for PostgreSQL
https://www.pgadmin.org/
Other
97 stars 41 forks source link

Does not work with PGPool #10

Closed djantzen closed 5 years ago

djantzen commented 7 years ago

Configuration: Postgres 9.5, PGAgent 3.4.1-2, PGPool 3.4.3. Ubuntu 16. PGAgent daemon connects to the PGPool load balancer.

I found that PGAgent causes PGPool backends to get out of sync due to the way it ascertains agent pid for the pgagent.pga_jobagent table. Because job agent Id comes from a call to pg_backend_pid() you get different PIDs in each backend in the cluster. (Line 93 of https://github.com/postgres/pgagent/blob/master/pgAgent.cpp seems to be the place).

From the looks of it, I'd expect it to break with statement based replication of any kind. The result is that when the job runs, you get a foreign key violation on one of the backend nodes that happens to have the "wrong" job id (b/c the postgres process doesn't exist on that box) and no jobs can run.

Is there another candidate for job ID besides backend PID?

repo-lockdown[bot] commented 5 years ago

Thanks for your Pull Request! :smile: This repo on GitHub is just a mirror of our real git repositories though, and can't really handle PRs. :frowning: Hopefully you can redo the PR, and direct it to the git.postgresql.org repos? We have a developer guide, if that helps: https://wiki.postgresql.org/wiki/So,_you_want_to_be_a_developer%3F. If this was a PR for pgAdmin, please visit https://www.pgadmin.org/docs/pgadmin4/dev/submitting_patches.html.