Re: pg_ctl promote wait
От | Michael Paquier |
---|---|
Тема | Re: pg_ctl promote wait |
Дата | |
Msg-id | CAB7nPqR8u9ToOqN2u_7bV_d1tuVQVgK=fkbpugDXG8cB9Z2+0A@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: pg_ctl promote wait (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>) |
Ответы |
Re: pg_ctl promote wait
|
Список | pgsql-hackers |
On Thu, Aug 11, 2016 at 3:24 AM, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote: > On 8/7/16 9:44 PM, Michael Paquier wrote: >>>> This is not a good >>>> >> idea, and the idea of putting a wait argument in get_controlfile does >>>> >> not seem a good interface to me. I'd rather see get_controlfile be >>>> >> extended with a flag saying no_error_on_failure and keep the wait >>>> >> logic within pg_ctl. >>> > >>> > I guess we could write a wrapper function in pg_ctl that encapsulated >>> > the wait logic. >> That's what I would do. > > New patches, incorporating your suggestions. Thanks for the new set! > I moved some of the error handling out of get_controlfile() and back > into the callers, because it was getting too weird that that function > knew so much about the callers' intentions. That way we don't actually > have to change the signature. I have looked at them and the changes are looking fine for me. So I have switched the patch as ready for committer, aka you. Just a nit: + if (wait_seconds > 0) + { + sleep(1); + wait_seconds--; + continue; + } This may be better this pg_usleep() instead of sleep(). -- Michael
В списке pgsql-hackers по дате отправления: