Re: Allow io_combine_limit up to 1MB

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tomas Vondra <tomas(at)vondra(dot)me>
Subject: Re: Allow io_combine_limit up to 1MB
Date: 2025-04-25 17:35:30
Message-ID: nynhk25a4h4wc53z35rhk2mwx6kwuwlisinw6enqkmfsdvqtqv@4yuezuoahhne
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2025-04-25 10:26:09 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > void
> > assign_io_max_combine_limit(int newval, void *extra)
> > {
> > io_max_combine_limit = newval;
> > io_combine_limit = Min(io_max_combine_limit, io_combine_limit_guc);
> > }
> > void
> > assign_io_combine_limit(int newval, void *extra)
> > {
> > io_combine_limit_guc = newval;
> > io_combine_limit = Min(io_max_combine_limit, io_combine_limit_guc);
> > }
>
> > So we end up with a larger io_combine_limit than
> > io_max_combine_limit. Hilarity ensues.
>
> There's another thing that's rather tin-eared about these assign
> hooks: the hook is not supposed to be setting the GUC variable by
> itself.

Agreed. Without that the bug would have been more apparent... Pushed the fix,
alongside the change you outlined.

It's kinda sad to not have any test that tests a larger
io_combine_limit/io_max_combine_limit - as evidenced by this bug that'd be
good. However, not all platforms have PG_IOV_MAX > 16, so it seems like it'd
be somewhat painful to test?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-04-25 17:37:15 gcc 15 "array subscript 0" warning at level -O3
Previous Message Antonin Houska 2025-04-25 17:34:48 Re: Conflicting updates of command progress