From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Race-like failure in recovery/t/009_twophase.pl
Date: Sun, 2 Jul 2017 13:32:43 -0400
Message-ID: <20170702173243.n3egcibv4svzthak@alvherre.pgsql> (raw)
In-Reply-To: <28238.1499010855@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Tom Lane wrote:
> I'd kind of like to fix it now, so I can reason in a less confused way
> about the actual problem.
OK, no objections here.
> Last night I didn't have a clear idea of how
> to make it better, but what I'm thinking this morning is:
>
> * Naming the underlying server objects "master" and "slave" is just
> wrong, because the script makes them swap those roles repeatedly.
> Better to choose neutral names, like "alice" and "bob" or "london"
> and "paris".
Check.
> * We could simply make the test script refer directly to the appropriate
> server at each step, ie s/node_master/node_london/ in relevant parts of
> the script and s/node_slave/node_london/ elsewhere. Maybe that's the
> best way, but there is some value in identifying commands as to whether
> we're issuing them to the current master or the current slave. Plan B
> might be to do
> ($cur_master, $cur_slave) = ($node_paris, $node_london);
> at the swap points and use those names where it seems clearer.
Hmm, yeah, using role-based aliases seems like a good idea too.
> * Some effort should be put into emitting text to the log showing
> what's going on, eg print("Now london is master."); as appropriate.
Check. Not "print" though; I think using note(" .. ") (from Test::More)
is more appropriate.
> * Another reason why I had the feeling of being lost in a maze of
> twisty little passages all alike was the relentless sameness of the
> commands being sent to the servers. There is no good reason for the
> prepared transactions to be all alike; they should be all different
> so that you can match up postmaster log entries to points in the
> script.
Check.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us
Subject: Re: Race-like failure in recovery/t/009_twophase.pl
In-Reply-To: <20170702173243.n3egcibv4svzthak@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox