Re: WAL scenario valid? - Mailing list pgsql-admin

From Sergey Konoplev
Subject Re: WAL scenario valid?
Date
Msg-id CAL_0b1tq=hEPX4FyNRpK90TKoXaucc41EcydD0vZ7_bBauPygQ@mail.gmail.com
Whole thread Raw
In response to Re: WAL scenario valid?  (prakhar jauhari <prak840@gmail.com>)
List pgsql-admin
On Tue, Jun 18, 2013 at 11:20 PM, prakhar jauhari <prak840@gmail.com> wrote:
> When a switchover happens DB2 becomes the new master and when DB1 comes up
> it will act as the standby to the new master (.history files from new master
> are copied to DB1 to bump up its timeline so as to setup SR). DB1 is not
> recreated from scratch. This runs fine in normal switchover, but there seems

I am not sure this works fine. You have probably got some silent
corruption on db1.

What you need is to resync db1 from db2. You can do it either the
canonical way, base backup with pg_basebackup or rsync, or using
pg_rewind.

From pg_rewind docs:

pg_rewind is a tool for synchronizing a PostgreSQL data directory with another
PostgreSQL data directory that was forked from the first one. The result is
equivalent to rsyncing the first data directory (referred to as the old cluster
from now on) with the second one (the new cluster). The advantage of pg_rewind
over rsync is that pg_rewind uses the WAL to determine changed data blocks,
and does not require reading through all files in the cluster. That makes it
a lot faster when the database is large and only a small portion of it differs
between the clusters.

https://github.com/vmware/pg_rewind

--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA

Profile: http://www.linkedin.com/in/grayhemp
Phone: USA +1 (415) 867-9984, Russia +7 (901) 903-0499, +7 (988) 888-1979
Skype: gray-hemp
Jabber: gray.ru@gmail.com


pgsql-admin by date:

Previous
From: Craig James
Date:
Subject: Re: Why sequence grant is separated from table?
Next
From: Marcos Cano
Date:
Subject: Re: pg_upgrade issue