In-core regression tests for replication, cascading, archiving, PITR, etc.

Started by Michael Paquierover 12 years ago157 messageshackers
Jump to latest
#1Michael Paquier
michael@paquier.xyz

Hi all,

The data replication bug causing data corruption on hot slaves found
lately (http://wiki.postgresql.org/wiki/Nov2013ReplicationIssue) is
causing a certain amount of damage among the users of Postgres, either
companies or individuals, and impacts a lot of people. So perhaps it
would be a good time to start thinking about adding some dedicated
regression tests for replication, archiving, PITR, data integrity,
parameter reloading, etc. The possible number of things or use-cases
that could be applied to that is very vast, but let's say that it
involves the manipulation of multiple Postgres nodes and structures
(like a WAL archive) defining a Postgres cluster.

The main purpose of those test would be really simple: using a given
GIT repository, a buildfarm or developer should be able to run a
single "make check" command that runs those tests on a local machine
in a fashion similar to isolation or regression tests and validate
builds or patches.

I imagine that there would be roughly two ways to implement such a facility:
1) Use of a smart set of bash scripts. This would be easy to implement
but reduces pluggability of custom scripts (I am sure that each
user/company has already its own set of scenarios.). pg_upgrade uses
something similar with its test.sh.
2) Use a scripting language, in a way similar to how isolation tests
are done. This would make custom test more customizable.
Here is for example an approach that has been presented at the
unconference of PGcon 2013 (would be something different though as
this proposal does not include node manipulation *during* the tests
like promotion):
https://wiki.postgresql.org/images/1/14/Pg_testframework.pptx
3) Import (and improve) solutions that other projects based on
Postgres technology use for those things.

In all cases, here are the common primary actions that could be run for a test:
- Define and perform actions on a node: init, start, stop, promote,
create_archive, base_backup. So it is a sort of improved wrapper of
pg_ctl.
- Pass parameters to a configuration file, either postgresql.conf,
recovery.conf, or anything.
- Launch SQL commands to a node.
Things like the creation of folders for WAL archiving should be simply
harcoded to simplify the life of developer... As well, the facility
should be smart enough to be allow the use of custom commands that are
the combination of primary actions above, like for example the
possibility to define a sync slave, linked to a root node, is simply
1) create a base backup from a node, 2) pass parameters to
postgresql.conf and recovery.conf, 3) start the node.

Let me know your thoughts.
Regards,
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Michael Paquier (#1)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On 12/02/2013 08:40 AM, Michael Paquier wrote:

The data replication bug causing data corruption on hot slaves found
lately (http://wiki.postgresql.org/wiki/Nov2013ReplicationIssue) is
causing a certain amount of damage among the users of Postgres, either
companies or individuals, and impacts a lot of people. So perhaps it
would be a good time to start thinking about adding some dedicated
regression tests for replication, archiving, PITR, data integrity,
parameter reloading, etc. The possible number of things or use-cases
that could be applied to that is very vast, but let's say that it
involves the manipulation of multiple Postgres nodes and structures
(like a WAL archive) defining a Postgres cluster.

The main purpose of those test would be really simple: using a given
GIT repository, a buildfarm or developer should be able to run a
single "make check" command that runs those tests on a local machine
in a fashion similar to isolation or regression tests and validate
builds or patches.

+1. The need for such a test suite has been mentioned every single time
that a bug or new feature related to replication, PITR or hot standby
has come up. So yes please! The only thing missing is someone to
actually write the thing. So if you have the time and energy, that'd be
great!

- Heikki

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Michael Paquier
michael@paquier.xyz
In reply to: Heikki Linnakangas (#2)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On Mon, Dec 2, 2013 at 6:24 PM, Heikki Linnakangas
<hlinnakangas@vmware.com> wrote:

+1. The need for such a test suite has been mentioned every single time that
a bug or new feature related to replication, PITR or hot standby has come
up. So yes please! The only thing missing is someone to actually write the
thing. So if you have the time and energy, that'd be great!

I am sure you know who we need to convince in this case :)
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Andres Freund
andres@anarazel.de
In reply to: Michael Paquier (#3)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On 2013-12-02 18:45:37 +0900, Michael Paquier wrote:

On Mon, Dec 2, 2013 at 6:24 PM, Heikki Linnakangas
<hlinnakangas@vmware.com> wrote:

+1. The need for such a test suite has been mentioned every single time that
a bug or new feature related to replication, PITR or hot standby has come
up. So yes please! The only thing missing is someone to actually write the
thing. So if you have the time and energy, that'd be great!

I am sure you know who we need to convince in this case :)

If you're alluding to Tom, I'd guess he doesn't need to be convinced of
such a facility in general. I seem to remember him complaining about the
lack of testing that as well.
Maybe that it shouldn't be part of the main regression schedule...

+many from me as well. I think the big battle will be how to do it, not
if in general.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, 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

#5Michael Paquier
michael@paquier.xyz
In reply to: Andres Freund (#4)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On Mon, Dec 2, 2013 at 7:07 PM, Andres Freund <andres@2ndquadrant.com> wrote:

Maybe that it shouldn't be part of the main regression schedule...

Yes, like isolation tests, it don't see those new tests in the main
flow as well.

+many from me as well. I think the big battle will be how to do it, not
if in general.

Yeah, that's why we should gather first feedback about the methods
that other projects (Slony, Londiste, Pgpool) are using as well before
heading to a solution or another. Having smth, whatever small for 9.4
would also be of great help.

I am however sure that getting a small prototype integrated with some
of my in-house scripts would not take that much time though...
Regards,
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#4)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

Andres Freund <andres@2ndquadrant.com> writes:

Maybe that it shouldn't be part of the main regression schedule...

It *can't* be part of the main regression tests; those are supposed to
be runnable against an already-installed server, and fooling with that
server's configuration is off-limits too. But I agree that some
other facility to simplify running tests like this would be handy.

At the same time, I'm pretty skeptical that any simple regression-test
type facility would have caught the bugs we've fixed lately ...

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#7Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#6)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On 2013-12-02 09:41:39 -0500, Tom Lane wrote:

At the same time, I'm pretty skeptical that any simple regression-test
type facility would have caught the bugs we've fixed lately ...

Agreed, but it would make reorganizing stuff to be more robust more
realistic. At the moment for everything you change you have to hand-test
everyting possibly affected which takes ages.

I think we also needs support for testing xid/multixid wraparound. It
currently isn't realistically testable because of the timeframes
involved.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, 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

#8Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#7)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

Andres Freund <andres@2ndquadrant.com> writes:

I think we also needs support for testing xid/multixid wraparound. It
currently isn't realistically testable because of the timeframes
involved.

When I've wanted to do that in the past, I've used pg_resetxlog to
adjust a cluster's counters. It still requires some manual hacking
though because pg_resetxlog isn't bright enough to create the new
pg_clog files needed when you move the xid counter a long way.
We could fix that, or we could make the backend more forgiving of
not finding the initial clog segment present at startup ...

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#9Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Tom Lane (#8)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

Tom Lane escribi�:

When I've wanted to do that in the past, I've used pg_resetxlog to
adjust a cluster's counters. It still requires some manual hacking
though because pg_resetxlog isn't bright enough to create the new
pg_clog files needed when you move the xid counter a long way.
We could fix that, or we could make the backend more forgiving of
not finding the initial clog segment present at startup ...

FWIW we already have some new code that creates segments when not found.
It's currently used in multixact, and the submitted "commit timestamp"
module uses it too.

--
�lvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, 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

#10Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#8)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On 2013-12-02 09:59:12 -0500, Tom Lane wrote:

Andres Freund <andres@2ndquadrant.com> writes:

I think we also needs support for testing xid/multixid wraparound. It
currently isn't realistically testable because of the timeframes
involved.

When I've wanted to do that in the past, I've used pg_resetxlog to
adjust a cluster's counters.

I've done that as well, but it's painful and not neccessarily testing
the right thing. E.g. I am far from sure we handle setting the
anti-wraparound limits correctly when promoting a standby - a restart to
adapt pg_control changes things and it might get rolled back because of
a already logged checkpoints.

What I'd love is a function that gives me the opportunity to
*efficiently* move forward pg_clog, pg_multixact/offset,members by large
chunks. So e.g. I could run a normal pgbench alongside another pgbench
moving clog forward in 500k chunks, but so it creates the necessary
files I could possibly need to access.

If you do it naivly you get into quite some fun with hot standby btw. I
can tell you that from experience :P

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, 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

#11Michael Paquier
michael@paquier.xyz
In reply to: Tom Lane (#6)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On Mon, Dec 2, 2013 at 11:41 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Andres Freund <andres@2ndquadrant.com> writes:
At the same time, I'm pretty skeptical that any simple regression-test
type facility would have caught the bugs we've fixed lately ...

The replication bug would have been reproducible at least, Heikki
produced a simple test case able to reproduce it. For the MultiXact
stuff... well some more infrastructure in core might be needed before
having a wrapper calling test scripts aimed to manipulate cluster of
nodes.
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#12Michael Paquier
michael@paquier.xyz
In reply to: Andres Freund (#4)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On Mon, Dec 2, 2013 at 7:07 PM, Andres Freund <andres@2ndquadrant.com> wrote:

On 2013-12-02 18:45:37 +0900, Michael Paquier wrote:

On Mon, Dec 2, 2013 at 6:24 PM, Heikki Linnakangas
<hlinnakangas@vmware.com> wrote:

+1. The need for such a test suite has been mentioned every single time that
a bug or new feature related to replication, PITR or hot standby has come
up. So yes please! The only thing missing is someone to actually write the
thing. So if you have the time and energy, that'd be great!

I am sure you know who we need to convince in this case :)

If you're alluding to Tom, I'd guess he doesn't need to be convinced of
such a facility in general. I seem to remember him complaining about the
lack of testing that as well.
Maybe that it shouldn't be part of the main regression schedule...

+many from me as well. I think the big battle will be how to do it, not
if in general.

(Reviving an old thread)
So I am planning to seriously focus soon on this stuff, basically
using the TAP tests as base infrastructure for this regression test
suite. First, does using the TAP tests sound fine?

On the top of my mind I got the following items that should be tested:
- WAL replay: from archive, from stream
- hot standby and read-only queries
- node promotion
- recovery targets and their interferences when multiple targets are
specified (XID, name, timestamp, immediate)
- timelines
- recovery_target_action
- recovery_min_apply_delay (check that WAL is fetch from a source at
some correct interval, can use a special restore_command for that)
- archive_cleanup_command (check that command is kicked at each restart point)
- recovery_end_command (check that command is kicked at the end of recovery)
- timeline jump of a standby after reconnecting to a promoted node

Regards,
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#13Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Michael Paquier (#12)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On 3/8/15 6:19 AM, Michael Paquier wrote:

On Mon, Dec 2, 2013 at 7:07 PM, Andres Freund <andres@2ndquadrant.com> wrote:

On 2013-12-02 18:45:37 +0900, Michael Paquier wrote:

On Mon, Dec 2, 2013 at 6:24 PM, Heikki Linnakangas
<hlinnakangas@vmware.com> wrote:

+1. The need for such a test suite has been mentioned every single time that
a bug or new feature related to replication, PITR or hot standby has come
up. So yes please! The only thing missing is someone to actually write the
thing. So if you have the time and energy, that'd be great!

I am sure you know who we need to convince in this case :)

If you're alluding to Tom, I'd guess he doesn't need to be convinced of
such a facility in general. I seem to remember him complaining about the
lack of testing that as well.
Maybe that it shouldn't be part of the main regression schedule...

+many from me as well. I think the big battle will be how to do it, not
if in general.

(Reviving an old thread)
So I am planning to seriously focus soon on this stuff, basically
using the TAP tests as base infrastructure for this regression test
suite. First, does using the TAP tests sound fine?

On the top of my mind I got the following items that should be tested:
- WAL replay: from archive, from stream
- hot standby and read-only queries
- node promotion
- recovery targets and their interferences when multiple targets are
specified (XID, name, timestamp, immediate)
- timelines
- recovery_target_action
- recovery_min_apply_delay (check that WAL is fetch from a source at
some correct interval, can use a special restore_command for that)
- archive_cleanup_command (check that command is kicked at each restart point)
- recovery_end_command (check that command is kicked at the end of recovery)
- timeline jump of a standby after reconnecting to a promoted node

If we're keeping a list, there's also hot_standby_feedback,
max_standby_archive_delay and max_standby_streaming_delay.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#14Noah Misch
noah@leadboat.com
In reply to: Michael Paquier (#12)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On Sun, Mar 08, 2015 at 08:19:39PM +0900, Michael Paquier wrote:

So I am planning to seriously focus soon on this stuff, basically
using the TAP tests as base infrastructure for this regression test
suite. First, does using the TAP tests sound fine?

Yes.

On the top of my mind I got the following items that should be tested:
- WAL replay: from archive, from stream
- hot standby and read-only queries
- node promotion
- recovery targets and their interferences when multiple targets are
specified (XID, name, timestamp, immediate)
- timelines
- recovery_target_action
- recovery_min_apply_delay (check that WAL is fetch from a source at
some correct interval, can use a special restore_command for that)
- archive_cleanup_command (check that command is kicked at each restart point)
- recovery_end_command (check that command is kicked at the end of recovery)
- timeline jump of a standby after reconnecting to a promoted node

Those sound good. The TAP suites still lack support for any Windows target.
If you're inclined to fix that, it would be a great contribution. The more we
accrue tests before doing that, the harder it will be to dig out.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#15Michael Paquier
michael@paquier.xyz
In reply to: Noah Misch (#14)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On Wed, Mar 11, 2015 at 2:47 PM, Noah Misch <noah@leadboat.com> wrote:

On Sun, Mar 08, 2015 at 08:19:39PM +0900, Michael Paquier wrote:

So I am planning to seriously focus soon on this stuff, basically
using the TAP tests as base infrastructure for this regression test
suite. First, does using the TAP tests sound fine?

Yes.

Check.

On the top of my mind I got the following items that should be tested:
- WAL replay: from archive, from stream
- hot standby and read-only queries
- node promotion
- recovery targets and their interferences when multiple targets are
specified (XID, name, timestamp, immediate)
- timelines
- recovery_target_action
- recovery_min_apply_delay (check that WAL is fetch from a source at
some correct interval, can use a special restore_command for that)
- archive_cleanup_command (check that command is kicked at each restart point)
- recovery_end_command (check that command is kicked at the end of recovery)
- timeline jump of a standby after reconnecting to a promoted node

Those sound good. The TAP suites still lack support for any Windows target.
If you're inclined to fix that, it would be a great contribution. The more we
accrue tests before doing that, the harder it will be to dig out.

Yeah, that's already on my TODO list.
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#16Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#15)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On Wed, Mar 11, 2015 at 3:04 PM, Michael Paquier wrote:

On Wed, Mar 11, 2015 at 2:47 PM, Noah Misch <noah@leadboat.com> wrote:

On Sun, Mar 08, 2015 at 08:19:39PM +0900, Michael Paquier wrote:

So I am planning to seriously focus soon on this stuff, basically
using the TAP tests as base infrastructure for this regression test
suite. First, does using the TAP tests sound fine?

Yes.

Check.

On the top of my mind I got the following items that should be tested:
- WAL replay: from archive, from stream
- hot standby and read-only queries
- node promotion
- recovery targets and their interferences when multiple targets are
specified (XID, name, timestamp, immediate)
- timelines
- recovery_target_action
- recovery_min_apply_delay (check that WAL is fetch from a source at
some correct interval, can use a special restore_command for that)
- archive_cleanup_command (check that command is kicked at each restart point)
- recovery_end_command (check that command is kicked at the end of recovery)
- timeline jump of a standby after reconnecting to a promoted node

So, as long as I had a clear picture of what I wanted to do regarding
this stuff (even if this is a busy commit fest, sorry), I have been
toying around with perl and I have finished with the patch attached,
adding some base structure for a new test suite covering recovery.

This patch includes basic tests for the following items:
- node promotion, test of archiving, streaming, replication cascading
- recovery targets XID, name, timestamp, immediate and PITR
- Timeline jump of a standby when reconnecting to a newly-promoted standby
- Replay delay
Tests are located in src/test/recovery, and are not part of the main
test suite, similarly to the ssl stuff.
I have dropped recovery_target_action for the time being as long as
the matter on the other thread is not set
(/messages/by-id/20150315132707.GB19792@alap3.anarazel.de),
and I don't think that it would be complicated to create tests for
that btw.

The most important part of this patch is not the tests themselves, but
the base set of routines allowing to simply create nodes, take
backups, create standbys from backups, and set up nodes to do stuff
like streaming, archiving, or restoring from archives. There are many
configurations possible of course in recovery.conf, but the set of
routines that this patch present are made to be *simple* to not
overcomplicate the way tests can be written.

Feedback is of course welcome, but note that I am not seriously
expecting any until we get into 9.6 development cycle and I am adding
this patch to the next CF.

Regards,
--
Michael

Attachments:

20150318_recovery_regressions.patchtext/x-patch; charset=US-ASCII; name=20150318_recovery_regressions.patchDownload+759-1
#17Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#16)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On Wed, Mar 18, 2015 at 1:59 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

Feedback is of course welcome, but note that I am not seriously
expecting any until we get into 9.6 development cycle and I am adding
this patch to the next CF.

I have moved this patch to CF 2015-09, as I have enough patches to
take care of for now... Let's focus on Windows support and improvement
of logging for TAP in the first round. That will be already a good
step forward.
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#18Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#17)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On Mon, Jun 29, 2015 at 10:11 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

On Wed, Mar 18, 2015 at 1:59 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

Feedback is of course welcome, but note that I am not seriously
expecting any until we get into 9.6 development cycle and I am adding
this patch to the next CF.

I have moved this patch to CF 2015-09, as I have enough patches to
take care of for now... Let's focus on Windows support and improvement
of logging for TAP in the first round. That will be already a good
step forward.

OK, attached is a new version of this patch, that I have largely
reworked to have more user-friendly routines for the tests. The number
of tests is still limited still it shows what this facility can do:
that's on purpose as it does not make much sense to code a complete
and complicated set of tests as long as the core routines are not
stable, hence let's focus on that first.
I have not done yet tests on Windows, I am expecting some tricks
needed for the archive and recovery commands generated for the tests.
Regards,
--
Michael

Attachments:

20150814_recovery_regressions.patchtext/x-diff; charset=US-ASCII; name=20150814_recovery_regressions.patchDownload+748-34
#19Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#18)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On Fri, Aug 14, 2015 at 12:54 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:

On Mon, Jun 29, 2015 at 10:11 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

On Wed, Mar 18, 2015 at 1:59 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

Feedback is of course welcome, but note that I am not seriously
expecting any until we get into 9.6 development cycle and I am adding
this patch to the next CF.

I have moved this patch to CF 2015-09, as I have enough patches to
take care of for now... Let's focus on Windows support and improvement
of logging for TAP in the first round. That will be already a good
step forward.

OK, attached is a new version of this patch, that I have largely
reworked to have more user-friendly routines for the tests. The number
of tests is still limited still it shows what this facility can do:
that's on purpose as it does not make much sense to code a complete
and complicated set of tests as long as the core routines are not
stable, hence let's focus on that first.
I have not done yet tests on Windows, I am expecting some tricks
needed for the archive and recovery commands generated for the tests.

Attached is v3. I have tested and fixed the tests such as they can run
on Windows. archive_command and restore_command are using Windows'
copy when needed. There was also a bug with the use of a hot standby
instead of a warm one, causing test 002 to fail.
I am rather happy with the shape of this patch now, so feel free to review it...
Regards,
--
Michael

Attachments:

20150814_recovery_regressions_v3.patchtext/x-diff; charset=US-ASCII; name=20150814_recovery_regressions_v3.patchDownload+755-34
#20Amir Rohan
amir.rohan@mail.com
In reply to: Michael Paquier (#19)
Re: In-core regression tests for replication, cascading, archiving, PITR, etc.

On 08/14/2015 06:32 AM, Michael Paquier wrote:

On Fri, Aug 14, 2015 at 12:54 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:

On Mon, Jun 29, 2015 at 10:11 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

On Wed, Mar 18, 2015 at 1:59 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

Feedback is of course welcome, but note that I am not seriously
expecting any until we get into 9.6 development cycle and I am adding
this patch to the next CF.

I have moved this patch to CF 2015-09, as I have enough patches to
take care of for now... Let's focus on Windows support and improvement
of logging for TAP in the first round. That will be already a good
step forward.

OK, attached is a new version of this patch, that I have largely
reworked to have more user-friendly routines for the tests. The number
of tests is still limited still it shows what this facility can do:
that's on purpose as it does not make much sense to code a complete
and complicated set of tests as long as the core routines are not
stable, hence let's focus on that first.
I have not done yet tests on Windows, I am expecting some tricks
needed for the archive and recovery commands generated for the tests.

Attached is v3. I have tested and fixed the tests such as they can run
on Windows. archive_command and restore_command are using Windows'
copy when needed. There was also a bug with the use of a hot standby
instead of a warm one, causing test 002 to fail.
I am rather happy with the shape of this patch now, so feel free to review it...
Regards,

Michael, I've ran these and it worked fine for me.
See attached patch with a couple of minor fixes.

Amir

Attachments:

20150925_recovery_regressions_amir_fixes.patchtext/x-patch; name=20150925_recovery_regressions_amir_fixes.patchDownload+3-4
#21Michael Paquier
michael@paquier.xyz
In reply to: Amir Rohan (#20)
#22Amir Rohan
amir.rohan@mail.com
In reply to: Michael Paquier (#21)
#23Michael Paquier
michael@paquier.xyz
In reply to: Amir Rohan (#22)
#24Amir Rohan
amir.rohan@mail.com
In reply to: Michael Paquier (#23)
#25Michael Paquier
michael@paquier.xyz
In reply to: Amir Rohan (#24)
#26Amir Rohan
amir.rohan@mail.com
In reply to: Michael Paquier (#25)
#27Michael Paquier
michael@paquier.xyz
In reply to: Amir Rohan (#26)
#28Amir Rohan
amir.rohan@zoho.com
In reply to: Michael Paquier (#27)
#29Amir Rohan
amir.rohan@zoho.com
In reply to: Amir Rohan (#28)
#30Michael Paquier
michael@paquier.xyz
In reply to: Amir Rohan (#28)
#31Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#30)
#32Amir Rohan
amir.rohan@zoho.com
In reply to: Michael Paquier (#25)
#33Andres Freund
andres@anarazel.de
In reply to: Amir Rohan (#32)
#34Amir Rohan
amir.rohan@zoho.com
In reply to: Andres Freund (#33)
#35Robert Haas
robertmhaas@gmail.com
In reply to: Michael Paquier (#27)
#36Michael Paquier
michael@paquier.xyz
In reply to: Robert Haas (#35)
#37Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#36)
#38Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#37)
#39Amir Rohan
amir.rohan@zoho.com
In reply to: Michael Paquier (#38)
#40Michael Paquier
michael@paquier.xyz
In reply to: Amir Rohan (#39)
#41Amir Rohan
amir.rohan@zoho.com
In reply to: Michael Paquier (#40)
#42Craig Ringer
craig@2ndquadrant.com
In reply to: Michael Paquier (#21)
#43Michael Paquier
michael@paquier.xyz
In reply to: Amir Rohan (#41)
#44Amir Rohan
amir.rohan@zoho.com
In reply to: Michael Paquier (#43)
#45Michael Paquier
michael@paquier.xyz
In reply to: Amir Rohan (#44)
#46Amir Rohan
amir.rohan@zoho.com
In reply to: Michael Paquier (#45)
#47Michael Paquier
michael@paquier.xyz
In reply to: Amir Rohan (#46)
#48Amir Rohan
amir.rohan@zoho.com
In reply to: Michael Paquier (#47)
#49Michael Paquier
michael@paquier.xyz
In reply to: Amir Rohan (#48)
#50Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#49)
#51Amir Rohan
amir.rohan@zoho.com
In reply to: Michael Paquier (#50)
#52Michael Paquier
michael@paquier.xyz
In reply to: Amir Rohan (#51)
#53Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#52)
#54Amir Rohan
amir.rohan@zoho.com
In reply to: Michael Paquier (#53)
#55Michael Paquier
michael@paquier.xyz
In reply to: Amir Rohan (#54)
#56Amir Rohan
amir.rohan@zoho.com
In reply to: Michael Paquier (#55)
#57Amir Rohan
amir.rohan@zoho.com
In reply to: Michael Paquier (#55)
#58Michael Paquier
michael@paquier.xyz
In reply to: Amir Rohan (#57)
#59Amir Rohan
amir.rohan@zoho.com
In reply to: Michael Paquier (#58)
#60Michael Paquier
michael@paquier.xyz
In reply to: Amir Rohan (#59)
#61Amir Rohan
amir.rohan@zoho.com
In reply to: Michael Paquier (#60)
#62Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#53)
#63Erik Rijkers
er@xs4all.nl
In reply to: Alvaro Herrera (#62)
#64Noah Misch
noah@leadboat.com
In reply to: Alvaro Herrera (#62)
#65Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#62)
#66Robert Haas
robertmhaas@gmail.com
In reply to: Alvaro Herrera (#62)
#67Mike Blackwell
mike.blackwell@rrd.com
In reply to: Robert Haas (#66)
#68David Steele
david@pgmasters.net
In reply to: Robert Haas (#66)
#69Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#53)
#70Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#65)
#71Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#70)
#72Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#69)
#73Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#72)
#74Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#73)
#75Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#74)
#76Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#75)
#77Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#76)
#78Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#77)
#79Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#78)
#80Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#79)
#81Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#80)
#82Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#81)
#83Noah Misch
noah@leadboat.com
In reply to: Alvaro Herrera (#79)
#84Andrew Dunstan
andrew@dunslane.net
In reply to: Noah Misch (#83)
#85Michael Paquier
michael@paquier.xyz
In reply to: Noah Misch (#83)
#86Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#85)
#87Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#86)
#88Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#87)
#89Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#88)
#90Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#89)
#91Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#90)
#92Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#91)
#93Noah Misch
noah@leadboat.com
In reply to: Alvaro Herrera (#88)
#94Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Noah Misch (#93)
#95Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#92)
#96Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#95)
#97Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#95)
#98Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#97)
#99Noah Misch
noah@leadboat.com
In reply to: Alvaro Herrera (#94)
#100Michael Paquier
michael@paquier.xyz
In reply to: Noah Misch (#99)
#101Noah Misch
noah@leadboat.com
In reply to: Michael Paquier (#100)
#102Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Noah Misch (#99)
#103Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#98)
#104Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#103)
#105Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#84)
#106Noah Misch
noah@leadboat.com
In reply to: Alvaro Herrera (#95)
#107Michael Paquier
michael@paquier.xyz
In reply to: Noah Misch (#106)
#108Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#107)
#109Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#97)
#110Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#108)
#111Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Tom Lane (#110)
#112Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#109)
#113Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#97)
#114Noah Misch
noah@leadboat.com
In reply to: Michael Paquier (#107)
#115Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#113)
#116Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Noah Misch (#114)
#117Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#116)
#118Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#117)
#119Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#118)
#120Noah Misch
noah@leadboat.com
In reply to: Michael Paquier (#119)
#121Michael Paquier
michael@paquier.xyz
In reply to: Noah Misch (#120)
#122Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#121)
#123Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#122)
#124Stas Kelvich
s.kelvich@postgrespro.ru
In reply to: Michael Paquier (#123)
#125Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Michael Paquier (#123)
#126Michael Paquier
michael@paquier.xyz
In reply to: Stas Kelvich (#124)
#127Victor Wagner
vitus@wagner.pp.ru
In reply to: Michael Paquier (#126)
#128Michael Paquier
michael@paquier.xyz
In reply to: Victor Wagner (#127)
#129Victor Wagner
vitus@wagner.pp.ru
In reply to: Michael Paquier (#128)
#130Victor Wagner
vitus@wagner.pp.ru
In reply to: Michael Paquier (#123)
#131Michael Paquier
michael@paquier.xyz
In reply to: Victor Wagner (#130)
#132Noah Misch
noah@leadboat.com
In reply to: Victor Wagner (#129)
#133Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#91)
#134Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#131)
#135Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#134)
#136Craig Ringer
craig@2ndquadrant.com
In reply to: Michael Paquier (#135)
#137Michael Paquier
michael@paquier.xyz
In reply to: Craig Ringer (#136)
#138Craig Ringer
craig@2ndquadrant.com
In reply to: Michael Paquier (#137)
#139Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Victor Wagner (#130)
#140Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#134)
#141Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Kyotaro Horiguchi (#125)
#142Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Craig Ringer (#138)
#143Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#142)
#144Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#143)
#145Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#144)
#146Craig Ringer
craig@2ndquadrant.com
In reply to: Michael Paquier (#143)
#147Michael Paquier
michael@paquier.xyz
In reply to: Craig Ringer (#146)
#148Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#147)
#149Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#145)
#150Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#149)
#151Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#150)
#152Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Alvaro Herrera (#141)
#153Michael Paquier
michael@paquier.xyz
In reply to: Kyotaro Horiguchi (#152)
#154Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#140)
#155Craig Ringer
craig@2ndquadrant.com
In reply to: Michael Paquier (#153)
#156Craig Ringer
craig@2ndquadrant.com
In reply to: Craig Ringer (#155)
#157Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#153)