repmgr icon indicating copy to clipboard operation
repmgr copied to clipboard

rewrite repmgrd as background worker

Open RekGRpth opened this issue 5 years ago • 4 comments

how about rewrite repmgrd as background worker?

RekGRpth avatar Apr 16 '20 08:04 RekGRpth

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.

ibarwick avatar Apr 20 '20 02:04 ibarwick

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 avatar Apr 20 '20 03:04 RekGRpth

with background worker local sql may be easy via spi

RekGRpth avatar Apr 20 '20 03:04 RekGRpth

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

RekGRpth avatar Apr 20 '20 03:04 RekGRpth