Re: WAL "low watermark" during base backup

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WAL "low watermark" during base backup
Date: 2011-09-04 17:02:57
Message-ID: CA+U5nML4Ku+Rq-exO7k5KN4wvpRi1RDKcy3qVaNkZehvB+We=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 2, 2011 at 6:52 PM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:

> Attached patch implements a "low watermark wal location" in the
> walsender shmem array. Setting this value in a walsender prevents
> transaction log removal prior to this point - similar to how
> wal_keep_segments work, except with an absolute number rather than
> relative. For now, this is set when running a base backup with WAL
> included - to prevent the required WAL to be recycled away while the
> backup is running, without having to guestimate the value for
> wal_keep_segments. (There could be other ways added to set it in the
> future, but that's the only one I've done for now)
>
> It obviously needs some documentation updates as well, but I wanted to
> get some comments on the way it's done before I work on those.

I'm not yet fully available for a discussion on this, but not sure I like this.

You don't have to guess the setting of wal_keep_segments, you
calculate it exactly from the size of your WAL disk. No other
calculation is easy or accurate.

This patch implements "fill disk until primary croaks" behaviour which
means you are making a wild and risky guess as to whether it will
work. If it does not, you are hosed.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kohei KaiGai 2011-09-04 18:55:21 Re: force_not_null option support for file_fdw
Previous Message Tom Lane 2011-09-04 16:21:09 Re: regress test failed