Re: Standby WAL Cleanup?

From: Don Seiler <don(at)seiler(dot)us>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Standby WAL Cleanup?
Date: 2017-08-14 21:08:40
Message-ID: CAHJZqBDZRTVtj63W2aPTurofn-CHQsNLwupe+i6+GPBAX5zUNw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Aug 14, 2017 at 3:58 PM, Guillaume Lelarge <guillaume(at)lelarge(dot)info>
wrote:

>
> The server removes the WAL files it doesn't need anymore, weither it is a
> primary (after a checkpoint) or a secondary node (after a restartpoint).
> That's just part of the usual process.
>

I know the documentation says this about a standalone database regarding
the "archive_command" parameter.

"It is important that the archive command return zero exit status if and
> only if it succeeds. Upon getting a zero result, PostgreSQL will assume
> that the file has been successfully archived, and will remove or recycle
> it."

However on a standby, my understanding is that the archive_command
parameter is not used. I know for sure that it would fail on the standby
that I'm looking at.

Although I did search for restartpoints and see this now:

In archive recovery or standby mode, the server periodically performs
> restartpoints which are similar to checkpoints in normal operation: the
> server forces all its state to disk, updates the pg_control file to
> indicate that the already-processed WAL data need not be scanned again, and *then
> recycles any old log segment files in pg_xlog directory*.

So I guess that's all the info I need then. Is there any to control that
behavior if (for reasons I can't think of right now other than cascading
standby) I wanted to delay that file recycling? Just curious.

Don.
--
Don Seiler
www.seiler.us

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Guillaume Lelarge 2017-08-14 21:26:36 Re: Standby WAL Cleanup?
Previous Message Guillaume Lelarge 2017-08-14 20:58:30 Re: Standby WAL Cleanup?