Re: Deleting old archived WAL files

Поиск
Список
Период
Сортировка
От Jaume Sabater
Тема Re: Deleting old archived WAL files
Дата
Msg-id 21789212.1911225387845942.JavaMail.root@zimbra.linuxsilo.net
обсуждение исходный текст
Ответ на Re: Deleting old archived WAL files  (Chander Ganesan <chander@otg-nc.com>)
Ответы Re: Deleting old archived WAL files
Список 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"


В списке pgsql-admin по дате отправления:

Предыдущее
От: "Ori Garin"
Дата:
Сообщение: Fwd: Problems waking up from a warm standby
Следующее
От: Chander Ganesan
Дата:
Сообщение: Re: Deleting old archived WAL files