postgresql/src/test/recovery
Tom Lane ec86af9175 Fix another race-condition-ish issue in recovery/t/001_stream_rep.pl.
Buildfarm members hornet and sungazer have shown multiple instances of
"Failed test 'xmin of non-cascaded slot with hs feedback has changed'".
The reason seems to be that the test is checking the current xmin of the
master server's replication slot against a past xmin of the first slave
server's replication slot.  Even though the latter slot is downstream of
the former, it's possible for its reported xmin to be ahead of the former's
reported xmin, because those numbers are updated whenever the respective
downstream walreceiver feels like it (see logic in WalReceiverMain).
Instrumenting this test shows that indeed the slave slot's xmin does often
advance before the master's does, especially if an autovacuum transaction
manages to occur during the relevant window.  If we happen to capture such
an advanced xmin as $xmin, then the subsequent wait_slot_xmins call can
fall through before the master's xmin has advanced at all, and then if it
advances before the get_slot_xmins call, we can get the observed failure.
Yeah, that's a bit of a long chain of deduction, but it's hard to explain
any other way how the test can get past an "xmin <> '$xmin'" check only
to have the next query find that xmin does equal $xmin.

Fix by keeping separate images of the master and slave slots' xmins
and testing their has-xmin-advanced conditions independently.
2017-07-05 23:59:20 -04:00
..
t Fix another race-condition-ish issue in recovery/t/001_stream_rep.pl. 2017-07-05 23:59:20 -04:00
.gitignore Minor tweaks for new src/test/recovery 2016-02-29 18:16:59 -03:00
Makefile Teach xlogreader to follow timeline switches 2017-03-22 07:05:12 +00:00
README Minor tweaks for new src/test/recovery 2016-02-29 18:16:59 -03:00

src/test/recovery/README

Regression tests for recovery and replication
=============================================

This directory contains a test suite for recovery and replication.

Running the tests
=================

    make check

NOTE: This creates a temporary installation, and some tests may
create one or multiple nodes, be they master or standby(s) for the
purpose of the tests.

NOTE: This requires the --enable-tap-tests argument to configure.