Re: Deleting old archived WAL files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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"


-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux