Re: Deleting old archived WAL files

From: Jaume Sabater <jsabater(at)linuxsilo(dot)net>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Deleting old archived WAL files
Date: 2008-10-30 17:30:45
Message-ID: 21789212.1911225387845942.JavaMail.root@zimbra.linuxsilo.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Chander Ganesan wrote:

> If you are running warm-standby, its presumable that your standby
> server is "consuming" these files as they are being generated. In
> such a case, you can set "log_restartpoints" in your recovery.conf
> file, and use pg_standby with the '%r' (restartwalfile) parameter so
> that it can "prune" old WAL files when necessary. In such a case,
> you wouldn't need to do any pruning yourself, since pg_standby would
> do it for you, when the standby server indicates that it is "safe" to
> remove those old files.
>
> log_restartpoints='true' restore_command='pg_standby /archive_dir %f
> %p %r'
>
> In short, your system that is in "recovery mode" can decide which
> ones it needs to get rid of, once it knows it no longer needs them.

Thanks for your answer. I believe I did not explain myself correctly.
pgpool-II, a middleware, is replicating all transactions into all the
nodes (via sending the SQL statements to all nodes). And does load
balancing of SELECT statements when possible.

Therefore, the online recovery process can happen on what could be
called the master node (the slave node failed) or in the slave node (the
master node failed). In both cases the same happens:

1. pg_start_backup
2. rsync data dir
3. pg_stop_backup
4. Recovery process, scp'ing the necessary archived WAL files from the
existing node to the being-recovered node.

So, what I mean is that it's not a pgsql to pgsql warm standby setup
(both pgsql nodes don't know about each other, and one is not feeding
the other with WAL files so that the other can be kept updated).

In other words, let's imagine it's just a single pgsql installation,
with no pgpool-II stuff, and I am archiving the WAL files because I
fancy it, or as an backup system.

But I don't want to keep archived WAL files forever, but just up to,
let's say, a few gigabytes or something. Therefore I thought I would
have to be doing pg_start_backup/pg_stop_backup "manually" and getting
rid of the now old files myself, as explained in my previous mail.

I hope I have explained myself correctly this time. I read about the
options you mentioned in the pgsql online documentation, but I did not
understand it was the thing I was looking for since there is no pgsql
instance "consuming" the logs.

Thanks again for your reply.

P.S. Sorry guys for the previous mail, as my webmail does not wrap lines.

--
Jaume Sabater
http://linuxsilo.net/

"Ubi sapientas ibi libertas"

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Chander Ganesan 2008-10-30 20:17:44 Re: Deleting old archived WAL files
Previous Message Ori Garin 2008-10-30 16:58:55 Fwd: Problems waking up from a warm standby