public inbox for [email protected]
help / color / mirror / Atom feedFrom: Bossart, Nathan <[email protected]>
To: Bharath Rupireddy <[email protected]>
Cc: Maxim Orlov <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Pre-allocating WAL files
Date: Tue, 7 Dec 2021 21:01:12 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<163352276350.15435.3988688227048304232.pgcf@coridan.postgresql.org>
<[email protected]>
<CALj2ACWsuDrsooXOm0fEx8uj1DojUT0boSzeutqUAc4=rVASWA@mail.gmail.com>
<[email protected]>
On 12/7/21, 9:35 AM, "Bossart, Nathan" <[email protected]> wrote:
> On 12/7/21, 12:29 AM, "Bharath Rupireddy" <[email protected]> wrote:
>> Why can't the walwriter pre-allocate some of the WAL segments instead
>> of a new background process? Of course, it might delay the main
>> functionality of the walwriter i.e. flush and sync the WAL files, but
>> having checkpointer do the pre-allocation makes it do another extra
>> task. Here the amount of walwriter work vs checkpointer work, I'm not
>> sure which one does more work compared to the other.
>
> The argument against adding it to the WAL writer is that we want it to
> run with low latency to flush asynchronous commits. If we added WAL
> pre-allocation to the WAL writer, there could periodically be large
> delays.
To your point on trying to avoid giving the checkpointer extra tasks
(basically what we are talking about on the other thread [0]), WAL
pre-allocation might not be of much concern because it will generally
be a small, fixed (and configurable) amount of work, and it can be
performed concurrently with the checkpoint. Plus, WAL pre-allocation
should ordinarily be phased out as WAL segments become eligible for
recycling. IMO it's not comparable to tasks like
CheckPointSnapBuild() that can delay checkpointing for a long time.
Nathan
[0] https://www.postgresql.org/message-id/flat/C1EE64B0-D4DB-40F3-98C8-0CED324D34CB%40amazon.com
view thread (19+ messages) latest in thread
reply
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: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Pre-allocating WAL files
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox