Unix Technical Forum

Warm-standby robustness question

This is a discussion on Warm-standby robustness question within the pgsql Admins forums, part of the PostgreSQL category; --> Hi, We have two PostgreSQL 8.2 database servers: A master and a warm-standby server. We plan on making an ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 09:18 AM
David F. Skoll
 
Posts: n/a
Default Warm-standby robustness question

Hi,

We have two PostgreSQL 8.2 database servers: A master and a warm-standby
server. We plan on making an initial backup of the master onto the standby
and then use log-shipping with "real-time" WAL-file processing as described
in http://www.postgresql.org/docs/8.2/s...m-standby.html

My question is this: If the master database is fairly busy, gets
VACUUMed once a day, etc. can we expect the warm standby server
to work correctly after days/weeks/months/years of log shipping,
or should we periodically take new base backups?

How long would you go between base backups? Or is one initial copy
really sufficient with WAL-shipping-and-consuming working perfectly
thereafter?

Regards,

David.

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 09:18 AM
Tom Lane
 
Posts: n/a
Default Re: Warm-standby robustness question

"David F. Skoll" <dfs@roaringpenguin.com> writes:
> My question is this: If the master database is fairly busy, gets
> VACUUMed once a day, etc. can we expect the warm standby server
> to work correctly after days/weeks/months/years of log shipping,
> or should we periodically take new base backups?


I don't think the time period is at issue. Log-shipping should keep the
slave a perfect replica of the master (if it doesn't, we have problems
anyway). The operational question you need to ask yourself is: if
you haven't swapped to the slave lately, how do you know it will work
when you need it to?

The current backup/restore docs suggest as best practice that you
intentionally swap master and slave periodically, ie, fail over
to the slave and then re-initialize the master as a new slave.
This provides a periodic test that your fail-over mechanisms actually
work, and as a bonus gives you a chance for a maintenance window
on the ex-master before it's brought up as new slave.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 09:18 AM
Kevin Grittner
 
Posts: n/a
Default Re: Warm-standby robustness question

>>> On Tue, Dec 18, 2007 at 12:55 PM, in message <3149.1198004157@sss.pgh.pa.us>,
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "David F. Skoll" <dfs@roaringpenguin.com> writes:
>> My question is this: If the master database is fairly busy, gets
>> VACUUMed once a day, etc. can we expect the warm standby server
>> to work correctly after days/weeks/months/years of log shipping,
>> or should we periodically take new base backups?

>
> I don't think the time period is at issue. Log-shipping should keep the
> slave a perfect replica of the master (if it doesn't, we have problems
> anyway).


Except for hint bits. This becomes more of a post-recovery
performance issue as the base backup ages, since they are included
in base backups, but not in WAL files.

http://archives.postgresql.org/pgsql...2/msg00203.php

> The operational question you need to ask yourself is: if
> you haven't swapped to the slave lately, how do you know it will work
> when you need it to?


Absolutely. Nobody should ever assume they have a working backup
system without periodic tests that the backups can actually be used
to create a working system. Ever.

-Kevin




---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 09:18 AM
Alvaro Herrera
 
Posts: n/a
Default Re: Warm-standby robustness question

Kevin Grittner wrote:
> >>> On Tue, Dec 18, 2007 at 12:55 PM, in message <3149.1198004157@sss.pgh.pa.us>,

> Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > "David F. Skoll" <dfs@roaringpenguin.com> writes:
> >> My question is this: If the master database is fairly busy, gets
> >> VACUUMed once a day, etc. can we expect the warm standby server
> >> to work correctly after days/weeks/months/years of log shipping,
> >> or should we periodically take new base backups?

> >
> > I don't think the time period is at issue. Log-shipping should keep the
> > slave a perfect replica of the master (if it doesn't, we have problems
> > anyway).

>
> Except for hint bits. This becomes more of a post-recovery
> performance issue as the base backup ages, since they are included
> in base backups, but not in WAL files.


But hint bits should be replicated on the next full-page-write anyhow,
no?

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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:08 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com