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.94.2) (envelope-from ) id 1rhLFF-00Ax7n-9U for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Mar 2024 03:13:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rhLFD-00Cpwp-JN for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Mar 2024 03:13:32 +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.94.2) (envelope-from ) id 1rhLFC-00Cpwh-32 for pgsql-bugs@lists.postgresql.org; Tue, 05 Mar 2024 03:13:31 +0000 Received: from fout5-smtp.messagingengine.com ([103.168.172.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rhLF8-002p3n-N4 for pgsql-bugs@lists.postgresql.org; Tue, 05 Mar 2024 03:13:30 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id 7FD2D13800BB; Mon, 4 Mar 2024 22:13:24 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 04 Mar 2024 22:13:24 -0500 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=1709608404; x=1709694804; bh=VpOKGYdTBp MHnBcHfdghKLm4tt5Yz76ivTI01+iOrpA=; b=TmvpXeT0216I7RxgfviU/l13PU hvflMT/9F2FfB0ccyv1o1dn9rguvY4H1sdJRchZdwQmyangbZkxBYsEt81O+Cz/f tEjSvaW25GLuIoxm6Mm2IHcCyep6Rdy8WfgxGIO4/tkLuGHkCxoRy7J/kQ2FX6rI n55D1ye8DFsfzXx3M6AtizlKs6FP6KVTSQ6mCSS6pc5DMVOMTsd/966/Z5D+NU/x ZDaOZnk7iog1Fc/cFcxREH4Rw6ksxCwDt0aJh0q+jN0juE8hZJ3SUDRFTQCjyFNv xX2UEnXsA52S7OGmpjufA1L8s3TJ9GDHssX1FpC0IFVKvVy6nTu42jY1qi0A== 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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1709608404; x=1709694804; bh=VpOKGYdTBpMHnBcHfdghKLm4tt5Y z76ivTI01+iOrpA=; b=FLiCnrvt39EOyqx+Yo2xFVTQOsw8TO31v+E2A6GTm4xh CnemaUyYEX3E6u621+MyBoUmAF785fXMfP1JEFpz/MBrmcBpAihmFyqLZiBBGmRV gGF+6nsrjfT8XGPMUG5AuGfakjl8nYr2blvNlbe670se6M0XOYZuw/vYV0j1Taka ajrYU+hgab1c9CdxUjnGac1U5ylYqGZacDHzy7s3W8+Fn9F9CrSB+8YwjzjxHcN5 8YUpP3XarYxu6D+qvUGDZMi99OT+pN9i9sKkxE09hqcr6h8TqG8uZC8NRupRFdgg oYZEAFpQG8dr5nzi47A6EToh4ihagGM7koVbxA7AjA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrheekgdehgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhepfffhvf evuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrh hnpeetleeifedufffhhfdtteelgeeggeffhfekueevteeigfduudevudetgfegiedvjeen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthh grvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 4 Mar 2024 22:13:23 -0500 (EST) Date: Tue, 5 Mar 2024 12:13:08 +0900 From: Michael Paquier To: feichanghong Cc: pgsql-bugs , alvherre Subject: Re: BUG #18371: There are wrong constraint residues when detach hash partiton concurrently Message-ID: References: <18371-7fef49f63de13f02@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="s2EmvHqnClHi4mID" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --s2EmvHqnClHi4mID Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 29, 2024 at 02:21:58PM +0800, feichanghong wrote: > What I said here is wrong, the constraints on the hash partition will als= o take > effect. But this constraint depends on the oid of the parent partition. Something is weird with the format of the messages you have sent, by the way.=20 > Based on the analysis above, should the added constraint for a hash parti= tion > be dropped after detachment?I have initially implemented this logic > in the attached patch and added a testcase. I really hope that > developers can give me some suggestions. I am not much a fan of relying on ATExecDropConstraint(), where the logic introduced is a copy-paste of get_constraint_name() to retrieve the name of the constraint to drop. If any, we ought to rely more on dropconstraint_internal() instead using the pg_constraint tuple based on the OID of the constraint, and not do a cross-operation with the constraint name. But actually, why do you do a drop of the constraint at all? DetachAddConstraintIfNeeded() re-adds the constraint as it is, so instead of re-adding it as-is and then dropping it again, wouldn't it be better to just *not* re-add to begin with it if we don't need it at all? This reproduces down to 14, for what I am assuming is an issue introduced around 7b357cc6ae55. Alvaro, what do you think? -- Michael --s2EmvHqnClHi4mID Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmXmjcQACgkQnvQgOdby QH3oJBAAmB6660/rD1d0dfG6KWC9JpFUf5OrvWu5ZzecJWE2jh7a1+UJCih424PL A63M+fGkq4ang84doQGyZnJEu7FBi8zWq8azH+hUp5N1Pit/O00CPoHiu5YG0PQY l+wdPs6mdKBh/0sFzS7uOZAcNGNBSovnFDI4J4EOUbgIr6DES646WSMWPqeDt+yS S0tkoeJh5jWZOcUJsuiRqACXAHHMfzn6sf2MKhzGWhcLqb4Jg6mAi9LuDRs7RSZ9 rjpqCOOg1CbCkK4Sunz6OG+J+4JuyB80N8VClRb+zareNnFrepy4mL34LdK9uRW1 7O98U4eKiCgckqzPWgm59WYeq36+4eglyZ31N4gRrGAON9C4hMHyj9xc7cU2Jg4M 0d+CeHf+blgt5EhC6/o8XJNYXxM9QbS4dGJJfm8xRHVVHw9fcAqi9YmPX50axWXz GVTsfoa3KTEbDkDlCK/2aMCl1JZQfE9jt0qqZeVDwQkz4QiN2ELtuikt8W/zX2Qc D9+t1aFlmy92CnoKOullpcAWi36NkqfVG4Z2zKzzOQgs20RugkDVxt1pO7R7ApdN mx8dNsI4Srk+o0EnPWdMDNY5qqwAjepT7xCj0drdfNKQslosjuN8GWL/+07cfjns pGp9CQiphRYsW6CIuYWCbxYRSKtGIEGXh1RlUffAyolIIc+ojHo= =yJ4G -----END PGP SIGNATURE----- --s2EmvHqnClHi4mID--