Re: pgsql: pg_ctl: Detect current standby state from pg_control

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: pgsql: pg_ctl: Detect current standby state from pg_control
Дата
Msg-id CAB7nPqQfktJ5rd1g+hXhKaSaUQk3y=4eydNLG2sOw8chAvY2cw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pgsql: pg_ctl: Detect current standby state from pg_control  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pgsql: pg_ctl: Detect current standby state from pg_control  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-committers
On Mon, Sep 26, 2016 at 12:54 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
>> pg_ctl: Detect current standby state from pg_control
>
> Coverity thinks that this patch introduced a bunch of
> null-pointer-dereference hazards, and AFAICS it is right.
> The change in get_controlfile()'s API is completely broken
> and needs to be undone.

So you'd rather have a sleep(1) and complicate this code to replace it
with a WaitLatch() when the code is used by the backend? I don't agree
with that as the new API is cleaner as presented, though I agree that
it is a change that caller does not get any result in case of a CRC
mismatch, but who's going to use results that cannot be trusted
anyway? It seems to me that the correct fix here is that
pg_controldata.c should just exit like in the attached patch. Somewhat
I missed that during my lookup of c1dc51d4.

If we would still want callers of get_controlfile() to be allowed to
read untrustworthy results, we could just add a boolean status flag..
--
Michael

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Refer to OS X as "macOS", except for the port name which is stil
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Refactor script execution state machine in pgbench.