Re: pg_isready docs doesn't specify what exactly it is checking
От | Euler Taveira |
---|---|
Тема | Re: pg_isready docs doesn't specify what exactly it is checking |
Дата | |
Msg-id | d42e67fa-57ca-412d-8055-dca522a091db@www.fastmail.com обсуждение исходный текст |
Ответ на | pg_isready docs doesn't specify what exactly it is checking (PG Doc comments form <noreply@postgresql.org>) |
Ответы |
Re: pg_isready docs doesn't specify what exactly it is checking
|
Список | pgsql-docs |
On Tue, Jan 4, 2022, at 3:11 PM, PG Doc comments form wrote:
`pg_isready` docs don't specify how its different from a port probe - whatdoes on top of checking that a port is open? Does it send some handshakemessage that a server responds to when initialization is finished?
pg_isready uses a PQping function that reports the current Postgres status. The
main advantage of pg_isready is that it uses the Postgres protocol to report
the server status. A port probe is not a sufficient step to determine if the
server is running and accepting connections. Why? A Postgres server can be
running but in a state that disallows connections such as during a startup or
crash recovery phase. pg_isready is capable of reporting such state
(PQPING_REJECT -- 1) [1].
We could include a sentence explaining that a port probe is not a sufficient
condition to successfully connect to a Postgres server because the state
machine has more than 2 states. PQping [1] already states "reports the status
of the server" and describe each state it provides. Feel free to suggest an
improvement to documentation.
People here are telling that `pg_isready` is not reliable and that`pg_isready` may return when database is not actually readyWithout further info about `pg_isready` it is not clear if it should befilled as a bug. Or if it should be filled as a bug only when aninitialization script is involved.
There is no known issues with pg_isready and that report isn't clear. He says
"database and/or user wasn't available". What's the exact error message? If
there is a reproducible test case, share it here.
В списке pgsql-docs по дате отправления: