Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jkoNI-0002OD-5k for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jun 2020 12:38:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jkoNG-0004AH-Pf for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jun 2020 12:38:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jkoNG-0004A9-EB for pgsql-hackers@lists.postgresql.org; Mon, 15 Jun 2020 12:38:02 +0000 Received: from [66.111.4.29] (helo=out5-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jkoND-0001xL-OS for pgsql-hackers@lists.postgresql.org; Mon, 15 Jun 2020 12:38:00 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 0368C5C00E2; Mon, 15 Jun 2020 08:37:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 15 Jun 2020 08:37:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=1xvdS8WsCZLaaBx7s7rmVJrwQxg BNk976kNuLe1TAU0=; b=OoD889i+8WuflEIJcSb+YpTL0dxuCdZKl6qrIG0iwBi 90emKCSv/7vG7X1pIDSye2sUBdsub6AdXrAzYpdG+fu37L9Ad4lbvNEKfV8fo1SR 4t3pT2/oKlutllMEoCH45nkICrEEz5Kgy/ljgJZII6yPk8dM+dIMIVy2bKpcampP 4bdty6ZQxxM1dUqGOOA16V4zXF7VPVYEowHBjP8V2NWY6/1+ojABn1GTZxXS5EfQ bdoOs4RzSBOP4Zu838K3DkCNk++bQqKONcTI5yV79nfF1T1oXDiiCnnB90dXLTa0 YhS8R3+h0SUTsewme8nlvwx152CeR/rTEGjqqZwMRNw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=1xvdS8 WsCZLaaBx7s7rmVJrwQxgBNk976kNuLe1TAU0=; b=f/5nngbk1qc6DI0b0NjO0v knpuAdbUedrLDQ63Gd9VQUFFGYPD02WoHB/zTFlItkQgFdyg6Qm2E9O4SIQSZTqm JtR6t+T14Yer8/51cW/4pWNo9Y3AQC7E8Ny2PP79eE2wVn/Oxz25/4zroe8WlRYS AAuhLxpa+uuOfXN2c5wrDGP2x+tVj0VF3YF0zGw4ijN9X7ecPEllAtph5YHBTRdc QenQQZUdTH00TEp6/29kQWEYbjkGzj8XK+HhEHjQHNg2JyRjP9OPHV4s4g4ExsXU PdDDqPDU5SZGVIO8t69jGVkfUjgc9mW8kEwz+bzo/I1aqSSgrmYp0CbTMFxKZ/Vg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeikedgheefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt jeenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeevfefgueegvdejfeejffekhfef teekledvgedvfeegfedujeeutdekheeigfelueenucfkphepudduuddruddtvddrudektd drudekheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id C77B7328005D; Mon, 15 Jun 2020 08:37:46 -0400 (EDT) Date: Mon, 15 Jun 2020 21:37:42 +0900 From: Michael Paquier To: =?utf-8?B?5p2O5p2wKOaFjui/vSk=?= Cc: Justin Pryzby , pgsql-hackers , =?utf-8?B?5pu+5paH5peMKOS5ieS7jik=?= , Alvaro Herrera Subject: Re: =?utf-8?B?5Zue5aSN77yaaG8=?= =?utf-8?Q?w?= to create index concurrently on partitioned table Message-ID: <20200615123742.GL52676@paquier.xyz> References: <3c2edeb5-e216-4411-9a74-f27fcc0f6793.adger.lj@alibaba-inc.com> <20200612072017.GE3362@paquier.xyz> <20200612181542.GJ14879@telsasoft.com> <55841c84-4ab6-4c79-9d1c-f67db2b229db.adger.lj@alibaba-inc.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VnOTrGv5LmZxna7m" Content-Disposition: inline In-Reply-To: <55841c84-4ab6-4c79-9d1c-f67db2b229db.adger.lj@alibaba-inc.com> X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.29 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --VnOTrGv5LmZxna7m Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 15, 2020 at 08:15:05PM +0800, =E6=9D=8E=E6=9D=B0(=E6=85=8E=E8= =BF=BD) wrote: > As shown above, an error occurred while creating an index in the second p= artition.=20 > It can be clearly seen that the index of the partitioned table is invalid= =20 > and the index of the first partition is normal, the second partition is i= nvalid,=20 > and the Third Partition index does not exist at all. That's a problem. I really think that we should make the steps of the concurrent operation consistent across all relations, meaning that all the indexes should be created as invalid for all the parts of the partition tree, including partitioned tables as well as their partitions, in the same transaction. Then a second new transaction gets used for the index build, followed by a third one for the validation that switches the indexes to become valid. -- Michael --VnOTrGv5LmZxna7m Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl7na5YACgkQnvQgOdby QH19sw/+I404N/6a/3lTxoDnE8iG+cgHnPKIIt7QsFI9Rk2aXVsOdcGoHuy2xbgi g+uHs5/hZs9v2ym/4qinq6ozS4ELORh6sMnT6nABA9f+Snz4/DASGQuli5IX3SON /KnRUg+z/J5Ccx+pEdvS83VRndzVJAuyxw3mY0vmmTBlAan5XC0d5TYKG8UCg7Gx T79pFO0Eq1EH/McG029x3bvtny9NkWUm5/zTR4IpcgImEkki5mDqTrRGwOxQTk5V IOeBWuPs087/tLTRdLGt33oFGxeeF0EPs1qYcvgRflkonHxXaGEN9UizHu9tt1it czgFJVis+r/8l2x6Uz7O24Cd+MTSlBU5Ml8BfIXibNb/qjnuZC67420D0EOUtUVG ehVQI4nwKsy4ratowp7TKCKsCkHlwkFdQNH94LtpbXMVCS4EqHYyN2XghFIJPlC2 IViCpnGVI/W4DD+i7tmdE4Xvz2q6eVar5qKxCPLyG65hIhZAtbvW1/ntxieWxhIZ UFUG3hc/yrcmkfPJdqvjWBDD+icvp9UxozhTH/e3cEQo6exE25vWeZr2jArUxWnS BSQbv8f7X7vhcL3nhszuGiERSrh4mkDHbzPB90OwIeNh28mP+cZLOED/lNJD8UbK vHiE+g44rIRjx/idww7r7wKnW/wMqINr7nW3QxrwxXyJM3MIynk= =S7eI -----END PGP SIGNATURE----- --VnOTrGv5LmZxna7m--