EnterpriseDB / repmgr

A lightweight replication manager for PostgreSQL (Postgres)
https://repmgr.org/
Other
1.54k stars 251 forks source link

rewrite repmgrd as background worker #631

Open RekGRpth opened 4 years ago

RekGRpth commented 4 years ago

how about rewrite repmgrd as background worker?

ibarwick commented 4 years ago

Thanks for the suggestion - however the whole point of repmgrd is to have a durable monitoring instance which can run even when the monitored PostgreSQL instance is down; a background worker would be of no use if that happened. There are however some ideas floating about to provide auxiliary functionality via a background worker, but nothing which has made it towards the top of the priority list.

RekGRpth commented 4 years ago

can run even when the monitored PostgreSQL instance is down

but repmgrd does not start without local postgres working

[2020-04-19 17:15:16] [NOTICE] repmgrd (repmgrd 5.0.0) starting up
[2020-04-19 17:15:16] [INFO] connecting to database "host=repmgr2 user=repmgr dbname=repmgr connect_timeout=2"
[2020-04-19 17:15:16] [ERROR] connection to database failed
[2020-04-19 17:15:16] [DETAIL] 
could not connect to server: Connection refused
    Is the server running on host "repmgr2" (172.19.0.11) and accepting
    TCP/IP connections on port 5432?
[2020-04-19 17:15:16] [DETAIL] attempted to connect using:
  user=repmgr connect_timeout=2 dbname=repmgr host=repmgr2 fallback_application_name=repmgr
RekGRpth commented 4 years ago

with background worker local sql may be easy via spi

RekGRpth commented 4 years ago

if You want to combine local sql via spi and async remote sql via libpq, You may see how I do it in my pg_task