Re: Improve sleep processing of pg_rewind TAP tests

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Improve sleep processing of pg_rewind TAP tests
Дата
Msg-id 20150416035105.GK4369@alvh.no-ip.org
обсуждение исходный текст
Ответ на Improve sleep processing of pg_rewind TAP tests  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: Improve sleep processing of pg_rewind TAP tests  (Michael Paquier <michael.paquier@gmail.com>)
Re: Improve sleep processing of pg_rewind TAP tests  (Heikki Linnakangas <hlinnaka@iki.fi>)
Список pgsql-hackers
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.

> Note that this patch adds a small routine called command_result in
> TestLib.pm, able to return stdout, stderr and the exit code. That's
> really handy, and I am planning to use something like that as well in
> the replication test suite.

Makes sense to me.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Qingqing Zhou
Дата:
Сообщение: Re: reparsing query
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Improve sleep processing of pg_rewind TAP tests