On Wed, Mar 25, 2026 at 10:33:48AM -0500, Nathan Bossart wrote:
> On Tue, Mar 24, 2026 at 11:29:52PM -0400, Andres Freund wrote:
> > I wonder if more of the code in the function should be updated to use the
> > copy, otherwise it seems like it could more easily happen that a part of the
> > code not using the modified version is moved until after a modification, and
> > the code author assumes the modifications now have taken effect.
> 
> Yeah, I was waffling on this.  I updated the rest of the function to use
> params_local instead.

Fine by me with these extra forward declarations and the pointer
manipulations across these VACUUM/ANALYZE calls.  That would be
protective enough in terms of the original intention of these const
markers added in 2252fcd4276c.

Once vacuum_rel() has its VacuumParams changed to a pointer, renaming
it to params_local and use params_local in all its code paths looks
sensible.  On top of what you are doing, I would add a big warning
comment at the top of the routine to mention that "params" should not
be used directly in the routine.  The local copies should be used.
--
Michael

Attachment: signature.asc
Description: PGP signature

Reply via email to