Re: WIP: WAL prefetch (another approach)

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Stephen Frost <sfrost(at)snowman(dot)net>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, David Steele <david(at)pgmasters(dot)net>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Jakub Wartak <Jakub(dot)Wartak(at)tomtom(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP: WAL prefetch (another approach)
Date: 2021-12-29 04:29:52
Message-ID: CA+hUKG+b2JWLw1MDsVwjOsN351xeawQ46wBA61X0HH9h_hGWAA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

[Replies to two emails]

On Fri, Dec 10, 2021 at 9:40 PM Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com> wrote:
> I am unable to apply these new set of patches on HEAD. Can you please share the rebased patch or if you have any work branch can you please point it out, I will refer to it for the changes.

Hi Ashutosh,

Sorry I missed this. Rebase attached, and I also have a public
working branch at
https://github.com/macdice/postgres/tree/recovery-prefetch-ii .

On Fri, Nov 26, 2021 at 11:32 AM Tomas Vondra
<tomas(dot)vondra(at)enterprisedb(dot)com> wrote:
> It's great you posted a new version of this patch, so I took a look a
> brief look at it. The code seems in pretty good shape, I haven't found
> any real issues - just two minor comments:
>
> This seems a bit strange:
>
> #define DEFAULT_DECODE_BUFFER_SIZE 0x10000
>
> Why not to define this as a simple decimal value?

Changed to (64 * 1024).

> Is there something
> special about this particular value, or is it arbitrary?

It should be large enough for most records, without being ridiculously
large. This means that typical users of XLogReader (pg_waldump, ...)
are unlikely to fall back to the "oversized" code path for records
that don't fit in the decoding buffer. Comment added.

> I guess it's
> simply the minimum for wal_decode_buffer_size GUC, but why not to use
> the GUC for all places decoding WAL?

The GUC is used only by xlog.c for replay (and has a larger default
since it can usefully see into the future), but frontend tools and
other kinds of backend WAL decoding things (2PC, logical decoding)
don't or can't respect the GUC and it didn't seem worth choosing a
number for each user, so I needed to pick a default.

> FWIW I don't think we include updates to typedefs.list in patches.

Seems pretty harmless? And useful to keep around in development
branches because I like to pgindent stuff...

Attachment Content-Type Size
v20-0001-Add-circular-WAL-decoding-buffer-take-II.patch text/x-patch 48.8 KB
v20-0002-Prefetch-referenced-data-in-recovery-take-II.patch text/x-patch 69.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-12-29 05:27:57 Re: WIP: WAL prefetch (another approach)
Previous Message Peter Smith 2021-12-29 04:21:36 Re: PublicationActions - use bit flags.