[COMMITTERS] pgsql: Try to improve readability of recovery/t/009_twophase.pl test. - Mailing list pgsql-committers

From Tom Lane
Subject [COMMITTERS] pgsql: Try to improve readability of recovery/t/009_twophase.pl test.
Date
Msg-id E1dRkWt-0002ED-8L@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Try to improve readability of recovery/t/009_twophase.pl test.

The original coding here was very confusing, because it named the
two servers it set up "master" and "slave" even though it swapped
their replication roles multiple times.  At any given point in the
script it was very unobvious whether "$node_master" actually referred
to the server named "master" or the other one.  Instead, pick arbitrary
names for the two servers --- I used "london" and "paris" --- and
distinguish those permanent names from the nonce references $cur_master
and $cur_slave.  Add logging to help distinguish which is which at
any given point.  Also, use distinct data and transaction names to
make all the prepared transactions easily distinguishable in the
postmaster logs.  (There was one place where we intentionally tested
that the server could cope with re-use of a transaction name, but
it seems like one place is sufficient for that purpose.)

Also, add checks at the end to make sure that all the transactions
that were supposed to be committed did survive.

Discussion: https://postgr.es/m/28238.1499010855@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4e15387d2d9d4045efd1a7b3634e5922774139fd

Modified Files
--------------
src/test/recovery/t/009_twophase.pl | 353 +++++++++++++++++++++++-------------
1 file changed, 225 insertions(+), 128 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: [COMMITTERS] pgsql: Improve TAP test function PostgresNode::poll_query_until().
Next
From: Tom Lane
Date:
Subject: [COMMITTERS] pgsql: Fix bug in PostgresNode::query_hash's split() call.