Re: Improve sleep processing of pg_rewind TAP tests - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Improve sleep processing of pg_rewind TAP tests
Date
Msg-id 20150416035105.GK4369@alvh.no-ip.org
Whole thread Raw
In response to Improve sleep processing of pg_rewind TAP tests  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Improve sleep processing of pg_rewind TAP tests
Re: Improve sleep processing of pg_rewind TAP tests
List 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 by date:

Previous
From: Qingqing Zhou
Date:
Subject: Re: reparsing query
Next
From: Michael Paquier
Date:
Subject: Re: Improve sleep processing of pg_rewind TAP tests