Hi,
On 2025-04-25 10:26:09 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.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