Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Healthcheck could break update #59

Closed
wuast94 opened this issue Oct 9, 2024 · 11 comments
Closed

Healthcheck could break update #59

wuast94 opened this issue Oct 9, 2024 · 11 comments
Assignees

Comments

@wuast94
Copy link
Member

wuast94 commented Oct 9, 2024

i run this image in a swarm cluster that checks for health and if the container is unhealthy it restarts the container and try to get it running. this will happn in the upgrade process which dont work.

i used

healthcheck:
    test: [CMD-SHELL, "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
    start_period: 20s
    interval: 30s
    retries: 5
    timeout: 5s

i think nothing we can do about directly (maybee providing a script that does this healthcheck but will also exit code 0 when an update is running?) but more a think we should mention?

@justinclift
Copy link
Member

justinclift commented Oct 9, 2024

Oh, yeah that's a good point.

That sounds like a good idea too. Having some kind of health check script which takes into account that a potential upgrade might be in progress.

We could probably use some kind of placeholder file (ie touch $PGDATA/.pgautoupgrade_occuring or similar) in the docker entrypoint script as a way for other processes in the container to check if an upgrade is in progress.

Want to throw together a PR with a script to get this all working ok? 😄

@justinclift justinclift changed the title healthcheck could brake update Healthcheck could break update Oct 9, 2024
@wuast94
Copy link
Member Author

wuast94 commented Oct 9, 2024

i can look into it the next days :)

@justinclift
Copy link
Member

As a data point, the PR for this is now #63 rather than #60. 😄

@justinclift
Copy link
Member

Merged that PR. Lets see how it goes in actual use. 😄

@wuast94
Copy link
Member Author

wuast94 commented Oct 27, 2024

had an upgrade from 14 to 17 on a friends db without problems. also my dbs are running fine. lets see what the next major release will do :) dont have any old db to test atm

@justinclift
Copy link
Member

justinclift commented Oct 27, 2024

Yeah. It passes all of the automated testing too, so the main upgrade functionality is ok at a minimum. 😉

@andyundso
Copy link
Member

if I have one input: I could imagine that a couple of folks keep their standard healthcheck with pg_ready when swapping out their PG container for ours. maybe we can add a small section in the README that clarifies that we bake in a healthcheck now.

@justinclift
Copy link
Member

That's a decent idea. Anyone feel like writing it? 😄

@wuast94
Copy link
Member Author

wuast94 commented Oct 28, 2024

That's a decent idea. Anyone feel like writing it? 😄

i think another one for me :P

@justinclift
Copy link
Member

A wild volunteer appears! 😁

@wuast94
Copy link
Member Author

wuast94 commented Nov 8, 2024

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants