Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w5aNq-003Oj0-1i for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 02:23:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5aMp-000ZTf-0o for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 02:22:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w5aMo-000ZTJ-10 for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2026 02:22:39 +0000 Received: from fout-b7-smtp.messagingengine.com ([202.12.124.150]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w5aMk-00000001D47-3sjY for pgsql-hackers@postgresql.org; Thu, 26 Mar 2026 02:22:38 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id E01911D00178; Wed, 25 Mar 2026 22:22:31 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Wed, 25 Mar 2026 22:22:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1774491751; x=1774578151; bh=vVJEquL6Mm xdaFkYtf2ggArtNBEqhjHTVrSz3IRftn8=; b=QqAkIPUX9LkjAiIj5SzwEYCasQ 7Un4tkY5dcUvIoaDvaYCVU4ZlTGVk1SqNjVFvfduQp3bGE13ihs+6sy1zYusKGg6 PmdYUJPCjUZbQ40ABl6JBTQYuC4y+zQlHaHsrP54UROXJ7MGn/Dr0OA5RY2kxTOw n0SDsDTXG9yYE1DVHpMlQG/f1omjdNwUrx55aUTMWGEMsqTwPnenXGQ/xc3/XXS/ 9aXvOc1JWKKelK5JG05WmV4Vg/VzZIsKPB1G30dsNpejXJAtuis35uq+8a/IBC6R E1Fx6GhTz3zswHminEMOOR+sXM3TqU8so8O+gU15XVvSsGP4ykv8CrYCIJpA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1774491751; x=1774578151; bh=vVJEquL6MmxdaFkYtf2ggArtNBEqhjHTVrS z3IRftn8=; b=iD8tfOZwbhCfKLB2U3S1z/t4hUHyb3zH89RpDIVmbRchj+Ulrf+ IIvfT8ZZE61FFNiYktq/2/7DqRGlrEDXTuFCVpL+v2jlWVHI4re2y/VXfi7qTI52 FTmA7vs65CVSekW3abGkt9w9MPZGx6IOxS5oiClcdOkBOz2LJhPa9O2+g5bp55Uc qnAVgQhSP2xzGNJY+62Tq2ohJD3tT7mUh5z9SsbBMeE024gEOSStveUuHC9HR3g+ DgZD0LOL45ivsVOmsjUjrSm//UK1Nn5EPyqKP6kW79AqTItGtKzegeLJxmAmrpzD 9zYz4eZcq4iWlU1c8x5KvC3MMm4tq0+PT8A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvdeiudegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepnhgrth hhrghnuggsohhsshgrrhhtsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprghnughrvghs segrnhgrrhgriigvlhdruggvpdhrtghpthhtohepiihhohhnghelhedtgeduleesghhmrg hilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgv shhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 25 Mar 2026 22:22:29 -0400 (EDT) Date: Thu, 26 Mar 2026 11:22:25 +0900 From: Michael Paquier To: Nathan Bossart Cc: Andres Freund , shihao zhong , PostgreSQL-development Subject: Re: Fixes inconsistent behavior in vacuum when it processes multiple relations Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="JkLjxvxfux85pUqK" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --JkLjxvxfux85pUqK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 t= he > > copy, otherwise it seems like it could more easily happen that a part o= f the > > code not using the modified version is moved until after a modification= , and > > the code author assumes the modifications now have taken effect. >=20 > 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 --JkLjxvxfux85pUqK Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnEmGEACgkQnvQgOdby QH2aMg/9Fq8PDzanqY/I1ETn+yQqIEQMeOMn4p95BmmAqGx9Dg7omIKDnGc+NZf1 luKXHdLiIHiT4kpQmDkOliox+fLQrpGwtpd67W2rzs50oa/HkpEzHc3tC9B+4jrA fp8BXsZJ4grs2avnZbzAra/4B13knoMxozO5LxNQHzEmo8GaVpVDsmpoacvUac1m yn8gcVP4bd4v10UIU+UiYW8SCwqoEQSv5i4kMJm1jHc/PHDbOnEFwmA306wBMbeF YVJ8iRenjp/o9XcrI8wtbCTpBxlKJQ30Do+ZTlkYjaXs/tbw67OMy1FR+SMwR1v3 tOWZ7MvvfDH1+yZwsH93pUpN37jamqNy6ckVDdMP7tGyAadv9+vGcfYnKnVZ69Zw c8H2b0fWdkxpJxPiIk4+1mGkS1U/fffLc8/Y0NtotjVBRvCARTlILsAT51dM7/m7 fFHUkIbKgOE1Utvv7pwd59Zget5IrPpFasYoQdevbdKNqjrKKrDDCoOIT+Fv01tI BFIM7xHAP1/B3DHwm+MEjoa8tAUfazBb9EwDSQfMmMLOQe5vj4I0yyOI/x53Tjbw /qpnwXrVfRe6BoeUNWdOnFAaqNfO6zmYeXX153SQ/YOY745qKBue2Fvqwffyc7tR br/TEta7FhOehlhgXgxsfuTh/ak/X9i2QcTX8CQtgM9sb5fwnZA= =poS9 -----END PGP SIGNATURE----- --JkLjxvxfux85pUqK--