Re: Enabling archive_mode without restart

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Enabling archive_mode without restart
Date: 2009-01-08 21:16:11
Message-ID: 200901082116.n08LGCj13354@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Added to TODO:

Allow archive_mode to be changed without server restart?

* http://archives.postgresql.org/pgsql-hackers/2008-10/msg01655.php

---------------------------------------------------------------------------

Simon Riggs 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.
>
> Objections?
>
> --
> Simon Riggs www.2ndQuadrant.com
> PostgreSQL Training, Services and Support
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2009-01-08 21:31:48 Re: Solve a problem of LC_TIME of windows.
Previous Message D'Arcy J.M. Cain 2009-01-08 21:03:06 Re: Proposal: new border setting in psql