Re: Race conditions with TAP test for syncrep

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Race conditions with TAP test for syncrep
Date: 2019-06-17 14:50:39
Message-ID: 20190617145039.GA12611@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-Jun-17, Michael Paquier wrote:

> Attached is a patch to improve the stability of the test. The fix I
> am proposing is very simple: in order to make sure that a standby is
> added into the WAL sender array of the primary, let's check after
> pg_stat_replication after a standby is started. This can be done
> consistently with a small wrapper in the tests.
>
> Any thoughts?

Hmm, this introduces a bit of latency: it waits for each standby to be
fully up before initializing the next standby. Maybe it would be more
convenient to split the primitives: keep the current one to start the
standby, and add a separate one to wait for it to be registered. Then
we could do
standby1->start;
standby2->start;
standby3->start;
foreach my $sby (@standbys) {
$sby->wait_for_standby
}

so they all start in parallel, saving a bit of time.

> + print "### Waiting for standby \"$standby_name\" on \"$master_name\"\n";

I think this should be note() rather than print(), or maybe diag(). (I
see that we have a couple of other cases which use print() in the tap
tests, which I think should be note() as well.)

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ian Barwick 2019-06-17 14:51:38 Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Previous Message Ian Barwick 2019-06-17 14:50:33 Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions