Re: Failover of the Primary database and starting the standby database in Postgresql in PITR configuraiton? - Mailing list pgsql-admin

From salman
Subject Re: Failover of the Primary database and starting the standby database in Postgresql in PITR configuraiton?
Date
Msg-id 47C6DC23.4020702@quietcaresystems.com
Whole thread Raw
In response to Re: Failover of the Primary database and starting the standby database in Postgresql in PITR configuraiton?  ("libra dba" <libra.dba@gmail.com>)
List pgsql-admin
libra dba wrote:
> Hey Salman,
>
> Thanks a lot for  all your guidance and help. It has really been a great
> help. I appreciate your quick replies.
>
> Which replication in postgres is better  ?
> SLONY or WARM STANDBY (usning wal).
>

I use both. Between our two production machines, we replicate data with
slony -- in addition to that, the current master sends its WALs to our
dev machine which has two instances of postgres installed on it (one
used for testing by our dev team, the other is constantly doing a restore).

> Another thing which haunts me is that, if we have a warm standby, the
> recovery process on the standby server reads an archived file only if it is
> 16MB, if it is small, the standby server goes down as shown
>
> *quote from the logfile on standby*
> ~~~~~~~~~~~~~~~~~~~~~~~~~~
> *FATAL:  archive file "000000010000000100000032" has wrong size: 491520
> instead of 16777216
> LOG:  startup process (PID 13177) exited with exit code 1
> LOG:  aborting startup due to startup process failure
> LOG:  database system was interrupted while in recovery at log time
> 2008-02-28 00:47:39 EST
> *
> Usually, an archive file is written every minute. Now, if the last archive
> was written at 12:05:00, and the primary server goes down at 12:05:37, the
> archive is not generated for the last 37 seconds. The archive file which was
> written at 12:05:00 would be applied to the standby. But what will happen to
> transactions which happen in the last 37 seconds before the crash???
>
> Do we loose that data???

I believe so. Looking at the docs
(http://www.postgresql.org/docs/8.1/static/backup-online.html), in such
a case, you can restore to 'within a minute' of the master server.
Perhaps someone else can provide a better answer.

-salman

pgsql-admin by date:

Previous
From: "libra dba"
Date:
Subject: Re: Failover of the Primary database and starting the standby database in Postgresql in PITR configuraiton?
Next
From: "Antonio Grassi"
Date:
Subject: drop database, vacuum full and disk space