Re: BUG #5118: start-status-insert-fatal

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #5118: start-status-insert-fatal
Дата
Msg-id 11547.1255631870@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #5118: start-status-insert-fatal  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #5118: start-status-insert-fatal  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: BUG #5118: start-status-insert-fatal  (Pedro Gimeno <pgsql-003@personal.formauri.es>)
Список pgsql-bugs
I wrote:
> "Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
>> ... This would allow pg_ctl or a script to
>> connect to a port and see if it is the expected postmaster process.

> I would rather see us implement the hypothetical pg_ping protocol
> and remember to include the postmaster's PID in the response.

Although on second thought, any such test is worth approximately nothing
anyway.  You can check that the postmaster answering the doorbell
reports the same PID that you see in $PGDATA/postmaster.pid, but that
still doesn't prove that that postmaster is using that data directory.
It could be a random coincidence of PIDs.  And in the case of a start
script, the probability of random PID match to a stale lockfile is many
orders of magnitude higher than you might think; see prior discussions.

This could be addressed by having the postmaster report its $PGDATA
value in the pg_ping response, but I would be against that on security
grounds.  We don't let nonprivileged users know where PGDATA is, why
would we make the information available without any authentication at
all?

[ thinks... ]  Maybe we could have the postmaster generate a random
number at start and include that in both the postmaster.ports file
and its pg_ping responses.  That would have a substantially lower
collision probability than PID, if the number generation process
were well designed; and it wouldn't risk exposing anything sensitive
in the ping response.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #5120: Performance difference between running a query with named cursor and straight SELECT
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: BUG #5118: start-status-insert-fatal