fly-apps / postgres-flex

Postgres HA setup using repmgr
67 stars 32 forks source link

Supervise cron process for better logging/signal handling/environment management #229

Closed ndarilek closed 2 weeks ago

ndarilek commented 2 weeks ago

I'd appreciate it if someone could test this. There was an incident with Launchpad this morning that blocked me from downloading repmgr and building the image. It seems to be resolved but I still can't get the file via curl. Going to keep trying in the hope that it's a caching issue somewhere and gets resolved soon, I'll remove this comment if I manage to test this today.

davissp14 commented 2 weeks ago

@ndarilek I will take a look!

ndarilek commented 2 weeks ago

I updated the machine, removed the original crontab so it regenerated, and confirmed that the script appeared to run successfully (I.e. just ran silently without error.)

I then updated the barman command to echo 2>& Test, manually set the exit code to 1, and got the following in the machine logs:

2024-06-25T16:57:01Z app[d8dd957fedde38] dfw [info]cron   | Barman cron failed with exit code 1: Test

So I think this one's ready. I did just push another commit to always rewrite the crontab--I can't imagine we'll change it often but if we do then I doubt having the slight performance boost of checking existence first would be a game-changer. Let me know if I'm missing something WRT that.

ndarilek commented 2 weeks ago

Also updated the nolan/postgres-flex image with the most recent changes (I.e. not checking for crontab existence.)