From: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
---|---|
To: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
Cc: | PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Improve sleep processing of pg_rewind TAP tests |
Date: | 2015-04-16 03:51:05 |
Message-ID: | 20150416035105.GK4369@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2015-04-16 04:00:28 | Re: Improve sleep processing of pg_rewind TAP tests |
Previous Message | Qingqing Zhou | 2015-04-16 03:39:04 | Re: reparsing query |