Re: pg_ctl promote wait

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_ctl promote wait
Дата
Msg-id 26741.1455912598@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg_ctl promote wait  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: pg_ctl promote wait  (Andres Freund <andres@anarazel.de>)
Re: pg_ctl promote wait  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> On 2/19/16 10:06 AM, Fujii Masao wrote:
>> One concern is that there can be a "time" after the pg_control's state
>> is changed to DB_IN_PRODUCTION and before the server is able to
>> start accepting normal (not read-only) connections. So if users try to
>> start write transaction just after pg_ctl promote -w ends, they might
>> get an error because the server is still in recovery, i.e., the startup
>> process is running.

> I think that window would be acceptable.

> If not, then the way to deal with it would seem to be to create an
> entirely new mechanism to communicate with pg_ctl (e.g., a file) and
> call that at the very end of StartupXLOG().  I'm not sure that that is
> worth it.

I see no need for an additional mechanism.  Just watch pg_control until
you see DB_IN_PRODUCTION state there, then switch over to the same
connection probing that "pg_ctl start -w" uses.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_ctl promote wait
Следующее
От: Tom Lane
Дата:
Сообщение: Re: FDW: should GetFdwRoutine be called when drop table?