Re: pg_rewind tests

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_rewind tests
Date: 2015-03-31 07:37:50
Message-ID: CAB7nPqS9CWD=xDb6uUGCbL7id+sDY0b9f9Q7N-AGZK3zmk010Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 31, 2015 at 9:59 AM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:

> There are some small issues with the pg_rewind tests.
>
> This technique
>
> check: all
> $(prove_check) :: local
> $(prove_check) :: remote
>
> for passing arguments to "prove" does not work with the tools included
> in Perl 5.8.
>
> While sorting out the portability issues in the TAP framework during the
> 9.4 release cycle, we had set 5.8 as the oldest Perl version that is
> supported. (It's the Perl version in RHEL 5.) I suggest using
> environment variables instead, unless we want to change that.
>

That's good to know. And I think that by using environment variables it is
necessary to pass an additional flag to prove_check (see
PG_PROVE_TEST_MODE) in the patch attached because prove_check kicks several
instructions, a command mkdir to begin with.

> Moreover,
>
> if ($test_mode == "local")
> ...
> elsif ($test_mode == "remote")
>
> don't work, because those are numerical comparisons, not string
> comparisons. So the remote branch is never actually run.
>

That's "eq" I guess.

> Finally, RewindTest.pm should use
>
> use strict;
> use warnings;
>
> and the warnings caused by that should be addressed.
>

All those things addressed give more or less the patch attached.

While looking at that I noticed two additional issues:
- In remote mode, the connection string to the promoted standby was
incorrect when running pg_rewind, leading to connection errors
- At least in my environment, a sleep of 1 after the standby promotion was
not sufficient to make the tests work.
Regards,
--
Michael

Attachment Content-Type Size
20150330_pgrewind_tap_fixes.patch text/x-patch 6.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2015-03-31 08:28:35 Re: vac truncation scan problems
Previous Message Jehan-Guillaume de Rorthais 2015-03-31 07:21:49 Re: Maximum number of WAL files in the pg_xlog directory