| From: | Greg Smith <gsmith(at)gregsmith(dot)com> | 
|---|---|
| To: | "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com> | 
| Cc: | Simon Riggs <simon(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: Enabling archive_mode without restart | 
| Date: | 2008-11-15 08:53:55 | 
| Message-ID: | Pine.GSO.4.64.0811141614081.13918@westnet.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On Wed, 12 Nov 2008, Jonah H. Harris wrote:
> In a large-scale OLTP environment, uptime is paramount, and having to 
> restart the database to enable PITR is a big PITA.
What I did last time I was stuck with this problem was make the 
archive_command point to a script I could toggle on and off outside of the 
database itself via a settings file.  Then you can leave archive_mode on 
all the time, instead adjusting that settings file to determine whether it 
ships the logs somewhere or just ignores them when it gets called.
A large benefit to that approach is that you can do other upgrades to said 
script without touching the database configuration.  The whole idea of 
implementing the archive_command as a one-line bit is horrifying to me 
anyway.  Put it in a script instead, then you can do error checking and 
basic sanity checks (disk space and number of active WAL segments are two 
good things to monitor) and e-mail or otherwise alert if there's a 
problem.
The primary downside to always having archiving on is you lose the fresh 
table WAL optimization path, but in real systems I haven't found that to 
be so compelling.  When doing initial bulk loading, absolutely a help, but 
if your database doesn't actually create/truncate tables in normal use it 
doesn't buy you anything once you're in production.
--
* Greg Smith gsmith(at)gregsmith(dot)com http://www.gregsmith.com Baltimore, MD
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Unicron | 2008-11-15 09:47:57 | A error reported in patch "clientcert option for pg_hba" | 
| Previous Message | Greg Smith | 2008-11-15 07:45:28 | Re: Updated posix fadvise patch v19 |