Re: Improve sleep processing of pg_rewind TAP tests

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Improve sleep processing of pg_rewind TAP tests
Дата
Msg-id CAB7nPqSQfTfge-whbpRD99BEbJOX3Z+Pepwa+TUBxA0fDtuVyg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Improve sleep processing of pg_rewind TAP tests  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Improve sleep processing of pg_rewind TAP tests  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On Thu, Apr 16, 2015 at 12:51 PM, Alvaro Herrera wrote:
> Michael Paquier wrote:
>
>> However after discussion with a colleague we have noticed that those
>> values may not be enough in slow environments, a value of up to 10s
>> being sometimes needed after promotion to make tests pass.
>
> Yeah, hardcoded sleep times are not reliable.  (/me would love to get
> rid of hardcoded times in isolationtester timeout.spec test ...)
>
>> Attached is a patch improving this sleep logic and doing the following things:
>> 1) To ensure that standby has caught up, check replay position on the
>> standby and compare it with the current WAL position of master.
>
>> 2) To ensure that promotion is effective, use pg_is_in_recovery() and
>> continue processing until we are sure that the standby is out of
>> recovery.
>
> Seems reasonable, but why are you sleeping 1s if pg_ctl -w is in use?  I
> thought the -w would wait until promotion has taken effect, so there's
> no need to sleep additional time.

Visibly that's not the case for this test case, the timing issues that
we saw happened not because of the standby not catching up, but
because of the promotion not taking effect in a timely fashion. And
that's as well something I saw on my OSX box some days ago as well,
explaining why the sleep time has been increased from 1 to 2 in
53ba1077. This patch just takes it the careful way. In perl, system
waits for the process of pg_ctl to exit before moving on, perhaps the
problem is that pg_ctl thinks that promotion is done, but the node is
not quite ready, explaining why the test fails.
-- 
Michael



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Improve sleep processing of pg_rewind TAP tests
Следующее
От: Lukas Fittl
Дата:
Сообщение: Re: reparsing query