Re: max_slot_wal_keep_size unit is not specified

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: alvherre(at)alvh(dot)no-ip(dot)org
Cc: b1000101(at)pm(dot)me, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: max_slot_wal_keep_size unit is not specified
Date: 2021-11-24 00:50:13
Message-ID: 20211124.095013.1928208020303363469.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

At Tue, 23 Nov 2021 11:21:05 -0300, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote in
> On 2021-Nov-22, PG Doc comments form wrote:
>
> > The unit (I assume it's MB) of max_slot_wal_keep_size is not explicitly
> > specified in the docs. If it's intentional then please, disregards, but I've
> > not been able to deduct that from this page alone. Thanks!
>
> Well, that's embarrasing. I'll see about fixing it.

(facepalm..)

> It is a size-based unit. You would typically specify some unit (say,
> MB) together with the number; internally, because the way this works is
> in terms of whole files, it is rounded down to an integer number of WAL
> segments. If you don't specify a unit, it is taken to be a number of
> megabytes.
>
> I wonder why did we make it round down rather than up. Does this mean
> that if you have max_slot_wal_keep_size=8MB and wal segments of 16 MB,
> the slot gets invalidated with more than zero reserved segments?

That rounding behavior is the way we are generally doing on similar
variables. It is based on the behavior of ConvertToXSegs(). So
max_wal_size for example is rounded-up the same way.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Alvaro Herrera 2021-11-25 14:37:37 Re: max_slot_wal_keep_size unit is not specified
Previous Message Jonathan S. Katz 2021-11-23 18:11:08 Re: ORDER BY in materialized view example?