Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gklTM-0000vo-UZ for pgsql-hackers@arkaria.postgresql.org; Sat, 19 Jan 2019 07:55:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gklTK-0006qy-E3 for pgsql-hackers@arkaria.postgresql.org; Sat, 19 Jan 2019 07:55:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gklTH-0006qr-R1 for pgsql-hackers@lists.postgresql.org; Sat, 19 Jan 2019 07:55:17 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gklT9-0004tQ-TE for pgsql-hackers@postgresql.org; Sat, 19 Jan 2019 07:55:14 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9FABC28CDC; Sat, 19 Jan 2019 02:55:06 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 19 Jan 2019 02:55:06 -0500 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=fm3; bh=kI8ue4ZxvmkbX9bmaISyUXNKqCN uOmxor4TOxb3Pfjw=; b=lO/a2EldLEgOIpXKV6pwmHCVX/O0gBU/0mSDPLuLXDH 5RDC+391d/O7ks26RXZC9Oy0N0mOT7o7qWW8Rg7Fjw4vaGH++J7sni0/vRkqnO1Q vg65ioOfudUiM9RJZ3a+/Jikq6A7ijBWQ0zh45SfUiBCYwVClNPL7JXOZQgVjpRn dr84YxSSAAvT3m8WvfSYEeLR5tdMN8WFl/J/3p+yXa5Cy7rU2Z99K6QXre89PSD9 1Gck/R5dyyzDC29Pg4MhPAkNnuo+kv67n1+64CtbPldCZhEMWpbV4XGapYq5ufy6 z+HmmFuXJnEx0oBnV+Qi13CRaxdq5ehupc8o4HLnX7w== 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=fm1; bh=kI8ue4 ZxvmkbX9bmaISyUXNKqCNuOmxor4TOxb3Pfjw=; b=uZ55AF34Kc16dOliUupyk1 29DupiDE1xJXDLD8S0nkfFbHURnvV9BaNznerlS/YpW4lwI8uqjk1N5y7QWNL5rd eK0UKz/r0wo70gnezSKZzjT2ilBD4IRWlZLOvx+rDpoycJBkYvWU4rYP546GYQmK qM+kxFSusJn6Qto7+fBgpsx5MIQNXp98dIMAngTa1UTgNxfA5RipqsBYGS3WEciy B/VBGQSE9Gq+eecm8qecsZM1qb8modbNcUKoibvL2+JKSfVj6ogoPuMWkIDHKmi5 K0ph16slBx/G+IHe2e9NeTOi9Farupx9RDutjFgIIROcFhLbU+6DGLOf8CFIu8Tw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrhedugdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdejtd dmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgt hhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqne cukfhppeeiuddrvdduhedrudefjedrudeivdenucfrrghrrghmpehmrghilhhfrhhomhep mhhitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 559D2E44A6; Sat, 19 Jan 2019 02:55:02 -0500 (EST) Date: Sat, 19 Jan 2019 16:54:59 +0900 From: Michael Paquier To: Andreas Karlsson Cc: Sergei Kornilov , Peter Eisentraut , Michael Paquier , PostgreSQL mailing lists , Stephen Frost , Craig Ringer , Alvaro Herrera Subject: Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Message-ID: <20190119075459.GF3306@paquier.xyz> References: <20180201062158.GD6398@paquier.xyz> <60052986-956b-4478-45ed-8bd119e9b9cf@2ndquadrant.com> <10797471544200851@myt3-964eae3a5b05.qloud-c.yandex.net> <93a3d2fb-43a0-cf14-e8d0-d2c3195c1e5b@2ndquadrant.com> <20486991544381729@iva5-d3020dc3459d.qloud-c.yandex.net> <36712441546604286@sas1-890ba5c2334a.qloud-c.yandex.net> <20190116082705.GB2550@paquier.xyz> <20190117051101.GD2036@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="w2JjAQZceEVGylhD" Content-Disposition: inline In-Reply-To: <20190117051101.GD2036@paquier.xyz> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --w2JjAQZceEVGylhD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 17, 2019 at 02:11:01PM +0900, Michael Paquier wrote: > Okay, I have begun digging into the patch, and extracted for now two > things which can be refactored first, giving a total of three patches: > - 0001, which creates WaitForOlderSnapshots to snapmgr.c. I think > that this can be useful for external extensions to have a process wait > for snapshots older than a minimum threshold hold by other > transactions. > - 0002, which moves the concurrent index build into its own routine, > index_build_concurrent(). At the same time, index_build() has a > isprimary argument which is not used, so let's remove it. This > simplifies a bit the refactoring as well. > - 0003 is the core patch, realigned with the rest, fixing some typos I > found on the way. Are there any objections if I commit 0001? Introducing WaitForOlderSnapshots() is quite independent from the rest, and the refactoring is obvious. For 0002, I am still not 100% sure if index_build_concurrent() is the best interface but I am planning to look more at this stuff next week, particularly the drop portion which needs more work. -- Michael --w2JjAQZceEVGylhD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlxC19IACgkQnvQgOdby QH3JDg/+JWB/k5iy9QWLR0dKAfciUP9iAEd1/K693lCHiN1m+KYPVdONDPVrjXZj 5xBHjjELeyhBlf4Cok1AhjW4ZjJVtIqFa2UHOSc41lLQG+aPkjiBxBHfi9vFsNIm C9/jixBYfFYmtSglz1htnjjXJbN2AhyZ8e08qkzpf/AaCaoKDPRtFyeTxYR/jGDM NHcsAL0dnnSn5CeMF2/UrhOo9xvqynC9Khi05/ifqTv/R9gt5VOD5LEVSAOUgMEj 0BZnamqBs+CywARcsUuX2PXy0WeJ5m0TN3+kFU2YgRCBsCK3Zgqsfp8bkObyJcPV jIvinCFJugHZZgKdcsk4Ib6gga7VTNrpBKwj0ZfT7RV3xekaCjH/e2/uszMEYTh9 MkAbljgwd4WKopUtajjzFimDUP/q8i13LkXlRI1BV07b+lq2rAxYsSlRYlV+rvK/ Z+sEcMQdferRbT5kRa2yPzPMVBlK+PKZ6gqnkNUq9fhuLQpiJmTwzzUA0cL/uPeE UpGxMYnMmXtdRdK+bZRZsZsHUTnTSnOzm3Ya8Y/ZE4OxwaE71RI2uuZVL0W7/RjG NwBYH2bYG8Jzu5c/U5kRg2q3nFSYj09G1PwlR7pCwWp6+9tAsh91T4NR44USjrB9 0ULE+rSBZVCBHMpTDGxCuEr4ayMj3P4ogxFtEtYj4VnX+RELpyo= =bsRV -----END PGP SIGNATURE----- --w2JjAQZceEVGylhD--