Skip site navigation (1) Skip section navigation (2)

Re: Enabling archive_mode without restart

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Simon Riggs" <simon(at)2ndQuadrant(dot)com>,"pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Enabling archive_mode without restart
Date: 2008-10-31 15:13:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
>>> Simon Riggs <simon(at)2ndQuadrant(dot)com> wrote: 
> Currently we enable archive_mode only at server start. The reason
> this was to protect against people enabling archive_mode half way
> through somebody else running a bulk load without WAL and then having
> incomplete backup.
> All we need to do is this:
> * When we change archive_mode to "on" get the next xid and place it
> xlogctl. When we turn archive_mode "off" clear the value.
> * When we run pg_start_backup() check the xid and then wait for all
> transactions to end that can still see that xid before returning.
> This means there may be a delay after enabling archive_mode before
> can run a backup, but normal running will not be interrupted.
> It's a fairly small change, touching just guc.c and xlog.c, using
> code as DefineIndex() to wait.
This would be a welcome change.  While we do continuous archiving for
most of our databases, there are some big ones where we just turn on
WAL archiving to capture a PITR "snapshot".  Having to restart
PostgreSQL on both sides of the backup complicates things

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2008-10-31 15:15:36
Subject: Re: Enabling archive_mode without restart
Previous:From: Heikki LinnakangasDate: 2008-10-31 15:05:00
Subject: pgsql: Unite ReadBufferWithFork, ReadBufferWithStrategy, and

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group