-
Notifications
You must be signed in to change notification settings - Fork 813
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
Spurious streaming state if rogue Postgres server is running #2792
Comments
I think this behavior was already discussed a few times (for example #811).
To do the last thing we compare start time from postmaster.pid (it is written there by postgres) and the time of process creation. But, right after starting Postgres Patroni is already trying to open a connection and run monitoring queries, which obviously succeeds, therefore you sometimes get Maybe you have a good idea how we can better identify running PG (the solution should be cross-platform)? |
@mbanck it seems that in your environment it is fairly easy to reproduce the problem |
What happened?
While trying out some ways to break Patroni and restore from backup, I ended up in a state where an old PostgreSQL process from a previous Patroni instance was stlil running, so it could not start its own Postgres:
The
patronictl list
output oscillates betweencrashed
andstreaming
, the latter due to Patroni being able to login to the rogue Postgres instance locally via the unix socket and queryingpg_stat_get_wal_receiver()
.This is probably a rare corner case, but I wanted to mention it in case there can be done something about this, e.g. due to a global state that knows Postgres was not started successfully so
streaming
cannot be true?Note that the second standby did not recover from the below torture, so it might be timing-related:
How can we reproduce it (as minimally and precisely as possible)?
patronictl remove
What did you expect to happen?
Not sure, but I would expect that the new
streaming
state is only shown if we are positively sure that our own Postgres instance is, in fact, streaming.Patroni/PostgreSQL/DCS version
Patroni configuration file
.
patronictl show-config
Patroni log files
PostgreSQL log files
Have you tried to use GitHub issue search?
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: