Re: Enabling archive_mode without restart - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Enabling archive_mode without restart
Date
Msg-id 490ADA51.EE98.0025.0@wicourts.gov
Whole thread Raw
In response to Enabling archive_mode without restart  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
>>> Simon Riggs <simon@2ndQuadrant.com> wrote: 
> Currently we enable archive_mode only at server start. The reason
for
> this was to protect against people enabling archive_mode half way
> through somebody else running a bulk load without WAL and then having
an
> incomplete backup.
> 
> All we need to do is this:
> 
> * When we change archive_mode to "on" get the next xid and place it
in
> 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
we
> 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
same
> 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
operationally.
-Kevin


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Enabling archive_mode without restart
Next
From: Tom Lane
Date:
Subject: Re: Enabling archive_mode without restart