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

Terminate pg_xlogdump once an iteration #41

Merged
merged 4 commits into from
Oct 13, 2017
Merged

Terminate pg_xlogdump once an iteration #41

merged 4 commits into from
Oct 13, 2017

Conversation

sean-
Copy link
Contributor

@sean- sean- commented Oct 13, 2017

When PostgreSQL is terminated, pg_prefaulter's spawned instances of pg_xlogdump will still have an open file descriptor because pg_xlogdump is being invoked with the -f flag. Introduce a new context that is used and tied to PostgreSQL connections. Unfortunately this means we now sleep for a small duration before actually terminating pg_xlogdump(1) or closing FDs, however the default sleep duration is 1s.

Fixes: #40

pg_xlogdump(1)'s `-f` flag will "tail" a WAL file until a new WAL
entry is appended to the WAL file.  If PostgreSQL has shutdown
or disappeared, pg_xlogdump(1) needs to be aware of this state change
and be terminated by the prefaulter.

Fixes: #40
Required in order to allow pg_xlogdump(1) to complete before having
its context shutdown in the event that PostgreSQL is starting up
and the pg_prefaulter can't connect to the DB.
@sean- sean- added the bug label Oct 13, 2017
@sean- sean- self-assigned this Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants