Strategies for validating WAL-shipping replication

Strategies for validating WAL-shipping replication

am 20.10.2008 08:31:08 von Florian Weimer

We've set up WAL-shipping replication on one of our database servers,
and the question is whether it runs correctly. Is there an easy way
to access some tables and see if the data matches (possibly in
single-user mode)?

Stopping replication and starting the server for real on the replica
means that we have to set up things from scratch, right? (This is a
bit annoying because of the amount of data which has to be copied from
the master.)

--=20
Florian Weimer
BFK edv-consulting GmbH http://www.bfk.de/
Kriegsstraße 100 tel: +49-721-96201-1
D-76133 Karlsruhe fax: +49-721-96201-99

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

Re: Strategies for validating WAL-shipping replication

am 20.10.2008 10:08:33 von wstrzalka

There is not such a possibility. However it's on TODO list:
http://wiki.postgresql.org/wiki/Todo
I'm waiting for this feature too.

I can understand your fear about the data, that you can not query for
it. I had the same :)
So script as much as you can, for the rest create a formal procedure -
then repeat it few times and check if everything is correct. After
several tries you'll believe your data are safe. I've a good comfort
level with this.
You can also check & resetup your production from time to time.


On Oct 20, 8:31=A0am, fwei...@bfk.de (Florian Weimer) wrote:
> We've set up WAL-shipping replication on one of our database servers,
> and the question is whether it runs correctly. =A0Is there an easy way
> to access some tables and see if the data matches (possibly in
> single-user mode)?
>
> Stopping replication and starting the server for real on the replica
> means that we have to set up things from scratch, right? =A0(This is a
> bit annoying because of the amount of data which has to be copied from
> the master.)
>
> --
> Florian Weimer =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
> BFK edv-consulting GmbH =A0 =A0 =A0http://www.bfk.de/
> Kriegsstraße 100 =A0 =A0 =A0 =A0 =A0 =A0 =A0tel: +49-721-96201-1
> D-76133 Karlsruhe =A0 =A0 =A0 =A0 =A0 =A0 fax: +49-721-96201-99
>
> --
> Sent via pgsql-admin mailing list (pgsql-ad...@postgresql.org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/p=
gsql-admin


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

Re: Strategies for validating WAL-shipping replication

am 20.10.2008 10:09:19 von Guillaume Lelarge

Florian Weimer a =E9crit :
> We've set up WAL-shipping replication on one of our database servers,
> and the question is whether it runs correctly. Is there an easy way
> to access some tables and see if the data matches (possibly in
> single-user mode)?
>=20

Nope. The only way you can look at data on a "on-recovery" server (the
log shipping slave) is to stop the recovery process.

> Stopping replication and starting the server for real on the replica
> means that we have to set up things from scratch, right? (This is a
> bit annoying because of the amount of data which has to be copied from
> the master.)
>=20

Yes.


--=20
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com

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

Re: Strategies for validating WAL-shipping replication

am 20.10.2008 11:05:40 von Simon Riggs

On Mon, 2008-10-20 at 01:08 -0700, wstrzalka wrote:
> There is not such a possibility. However it's on TODO list:
> http://wiki.postgresql.org/wiki/Todo
> I'm waiting for this feature too.
>
> I can understand your fear about the data, that you can not query for
> it.

Please test the Hot Standby patch...

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support


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

Re: Strategies for validating WAL-shipping replication

am 20.10.2008 15:20:35 von Alvaro Herrera

Florian Weimer wrote:
> We've set up WAL-shipping replication on one of our database servers,
> and the question is whether it runs correctly. Is there an easy way
> to access some tables and see if the data matches (possibly in
> single-user mode)?
>
> Stopping replication and starting the server for real on the replica
> means that we have to set up things from scratch, right? (This is a
> bit annoying because of the amount of data which has to be copied from
> the master.)

The OmniTI guys gave a talk some time ago on how they used Solaris ZFS
to create a filesystem snapshot, on which they stopped the recovery and
started postmaster. This could run queries. The original copy
continues running recovery, and whenever you want to "update your
slave", you stop the second postmaster, delete the snapshot, and create
a new one.

Cumbersome ...

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Re: Strategies for validating WAL-shipping replication

am 20.10.2008 15:54:31 von Simon Riggs

On Mon, 2008-10-20 at 08:31 +0200, Florian Weimer wrote:

> We've set up WAL-shipping replication on one of our database servers,
> and the question is whether it runs correctly.

There's two answers here.

The first is that the code used is exactly the same as crash recovery.
So if you trust crash recovery you should trust archive recovery, which
means WAL shipping. The differences are all about where you start and
stop WAL replay.

The second is that any form of replication requires testing.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support


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