Re: Race conditions with TAP test for syncrep - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Race conditions with TAP test for syncrep
Date
Msg-id 20190618005908.GB1744@paquier.xyz
Whole thread Raw
In response to Re: Race conditions with TAP test for syncrep  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: Race conditions with TAP test for syncrep
Re: Race conditions with TAP test for syncrep
List pgsql-hackers
On Mon, Jun 17, 2019 at 10:50:39AM -0400, Alvaro Herrera wrote:
> 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
> }

It seems to me that this sequence could still lead to inconsistencies:
1) standby 1 starts, reaches consistency so pg_ctl start -w exits.
2) standby 2 starts, reaches consistency.
3) standby 2 starts a WAL receiver, gets the first WAL sender slot of
the primary.
4) standby 1 starts a WAL receiver, gets the second slot.

> 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.)

OK.  Let's change it for this patch.  For the rest, I can always send
a different patch.  Just writing down your comment..
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Fix typos and inconsistencies for v11+
Next
From: Steve Singer
Date:
Subject: Re: PG 12 beta 1 segfault during analyze