From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: b1000101@pm.me
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: max_slot_wal_keep_size unit is not specified
Date: Thu, 25 Nov 2021 11:37:37 -0300
Message-ID: <202111251437.bfxei7ahcj6i@alvherre.pgsql> (raw)
In-Reply-To: <20211124.095013.1928208020303363469.horikyota.ntt@gmail.com>
On 2021-Nov-24, Kyotaro Horiguchi wrote:
> At Tue, 23 Nov 2021 11:21:05 -0300, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote in
> > 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.
After thinking on it some more, I think rounding down is correct. If
somebody sets max_slot_wal_keep_size=40MB, then by keeping the limit at
32 MB (round down) we're honoring that request better than if we made it
48 MB (round up). But in any case, I think it doesn't matter much:
users need a *rough* size limit, not a super-precise one. After all,
this is only verified at checkpoint time. We're probably dealing with a
few hundreds of megabytes at least, so 16 MB one way or the other don't
change things much.
Here's a proposed patch.
--
Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/
"Las mujeres son como hondas: mientras más resistencia tienen,
más lejos puedes llegar con ellas" (Jonas Nightingale, Leap of Faith)
Attachments:
[text/x-diff] 0001-Document-units-for-max_slot_wal_keep_size.patch (0B, ../202111251437.bfxei7ahcj6i@alvherre.pgsql/2-0001-Document-units-for-max_slot_wal_keep_size.patch)
download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: alvherre@alvh.no-ip.org, horikyota.ntt@gmail.com, b1000101@pm.me, pgsql-docs@lists.postgresql.org
Subject: Re: max_slot_wal_keep_size unit is not specified
In-Reply-To: <202111251437.bfxei7ahcj6i@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox