]> granicus.if.org Git - postgresql/commit
Try to improve readability of recovery/t/009_twophase.pl test.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 2 Jul 2017 19:27:29 +0000 (15:27 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 2 Jul 2017 19:27:29 +0000 (15:27 -0400)
commit4e15387d2d9d4045efd1a7b3634e5922774139fd
treeb792a49ed46128cf39ca9af6d1add0d21f413808
parentde3de0afd7da7b432e219aa38bde248fc5c5206a
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
src/test/recovery/t/009_twophase.pl