Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 9D7922E00C8 for ; Thu, 28 Feb 2008 12:07:06 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 68073-04 for ; Thu, 28 Feb 2008 12:06:51 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from livingmail01.inetu.net (unknown [209.235.247.80]) by postgresql.org (Postfix) with ESMTP id 6C41F2E00AC for ; Thu, 28 Feb 2008 12:07:00 -0400 (AST) Received: (qmail 13633 invoked by uid 0); 28 Feb 2008 16:06:59 -0000 Received: from unknown (HELO ?192.168.0.23?) (salmanb@quietcaresystems.com@127.0.0.1) by livingmail01.inetu.net with SMTP; 28 Feb 2008 16:06:59 -0000 Message-ID: <47C6DC23.4020702@quietcaresystems.com> Date: Thu, 28 Feb 2008 11:06:59 -0500 From: salman User-Agent: Mozilla-Thunderbird 2.0.0.6 (X11/20071009) MIME-Version: 1.0 To: libra dba CC: pgsql-admin@postgresql.org Subject: Re: Failover of the Primary database and starting the standby database in Postgresql in PITR configuraiton? References: <84D57263D486374587DA0820E60A2CC601B07E23@srit_mail.renaissance-it.com> <1203409158.16770.821.camel@ebony.site> <9abe84da0802190623o2a24f2a5u9a44299fd634618e@mail.gmail.com> <47BAFC47.4060902@quietcaresystems.com> <9abe84da0802200849w1f462558n270f4320a7465b6c@mail.gmail.com> <9abe84da0802271254j3a6463c8j7ccbe603bcdbf477@mail.gmail.com> <47C5D0AB.7070102@quietcaresystems.com> <9abe84da0802280636n499f162co8d966d1ffcb7f78e@mail.gmail.com> In-Reply-To: <9abe84da0802280636n499f162co8d966d1ffcb7f78e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/401 X-Sequence-Number: 28475 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