Re: pgsql: Use streaming read I/O in VACUUM's third phase

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: pgsql: Use streaming read I/O in VACUUM's third phase
Date: 2025-02-14 20:29:07
Message-ID: CAAKRu_aH-h91fQPK6Ltthu-kU8U4bH_fv9z--vDPwaQ6pURY6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Fri, Feb 14, 2025 at 1:31 PM Melanie Plageman
<melanieplageman(at)gmail(dot)com> wrote:
>
> On Fri, Feb 14, 2025 at 12:59 PM Melanie Plageman
> <melanieplageman(at)gmail(dot)com> wrote:
> >
> > Use streaming read I/O in VACUUM's third phase
> >
> > Make vacuum's third phase (its second pass over the heap), which reaps
> > dead items collected in the first phase and marks them as reusable, use
> > the read stream API. This commit adds a new read stream callback,
> > vacuum_reap_lp_read_stream_next(), that looks ahead in the TidStore and
> > returns the next block number to read for vacuum.
> >
> > Author: Melanie Plageman <melanieplageman(at)gmail(dot)com>
> > Co-authored-by: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
> > Reviewed-by: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
> > Discussion: https://postgr.es/m/CA%2BhUKGKN3oy0bN_3yv8hd78a4%2BM1tJC9z7mD8%2Bf%2ByA%2BGeoFUwQ%40mail.gmail.com
> >
> > Branch
> > ------
> > master
> >
> > Details
> > -------
> > https://git.postgresql.org/pg/commitdiff/c3e775e608f2a6d0bcfba147bf08a506827cc567
> >
> > Modified Files
> > --------------
> > src/backend/access/heap/vacuumlazy.c | 55 ++++++++++++++++++++++++++++++++----
> > 1 file changed, 49 insertions(+), 6 deletions(-)
>
> I'm looking into the valgrind failures [1].
>
> ==1526248== VALGRINDERROR-END
> {
> <insert_a_suppression_name_here>
> Memcheck:Addr1
> fun:lazy_scan_heap
> fun:heap_vacuum_rel
> fun:table_relation_vacuum
> fun:vacuum_rel
> fun:vacuum_rel
> fun:vacuum
> fun:ExecVacuum
> fun:standard_ProcessUtility
> fun:ProcessUtility
> fun:PortalRunUtility
> fun:PortalRunMulti
> fun:PortalRun
> fun:exec_simple_query
> }

Looks like there is something wrong with the read stream API. This is
the first read stream user taking advantage of per_buffer_data. Thomas
and I are investigating further. It is trivially reproducible when
running intidb under valgrind.

- Melanie

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-02-14 20:45:40 Re: pgsql: Convert heap_vac_scan_next_block() boolean parameters to flags
Previous Message Daniel Gustafsson 2025-02-14 20:29:04 pgsql: pgcrypto: Add support for CFB mode in AES encryption