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 1lEZaF-0004W3-SY for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Feb 2021 15:26:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lEZaE-0000KX-R9 for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Feb 2021 15:26:42 +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 1lEZaE-0000KQ-1d for pgsql-hackers@lists.postgresql.org; Tue, 23 Feb 2021 15:26:42 +0000 Received: from [64.147.123.24] (helo=wout1-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEZaB-0005E3-Od for pgsql-hackers@lists.postgresql.org; Tue, 23 Feb 2021 15:26:41 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 9D098F78; Tue, 23 Feb 2021 10:26:27 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 23 Feb 2021 10:26:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=eG/E+JkQWowkSPTMarjPHilu1mhIOJjATXHz5yTC8/I=; b=H479zFSg Lqjvu7SV9OweSkHOQIWowraQsAaDXGE0VLwH2h9IzzQUR2GrmtcydKtFCUC8ipgn v9PEbNRz4RVqsn3abUlgJIwvibsstDdTHE9XqmFz+5tdsWXCSkZKShff42OfOnZ/ X9s2uNyx9uSh2AnzrDbtCRgfNgQG9mLH5aJLbj9o0hsNPAjXl/NLxTHX8kLkbA/y iK1cZGvSRZ9znSQRDbvvnXOKQfWq03aGqVhykKJ5XcfkLoOCeYVBHksUB0atrYgF XiwDaLFWdRt6gMeHERHAZNkS5F+4Ou3NGFXk4IDj/lUfpX04XVVbWr+fUs0EFatK 1exldML2rIOs1Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeehgdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjggfsehtkeertddtredunecuhfhrohhmpemllhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeetgfdvvedvleeuhedtieduuddtjefghfffudegvdekffdv kedtkeffueeukeevfeenucfkphepudeltddrleehrdduledrudejjeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id 9D3E11080057; Tue, 23 Feb 2021 10:26:26 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id B82422A0F80; Tue, 23 Feb 2021 12:26:23 -0300 (-03) Date: Tue, 23 Feb 2021 12:26:23 -0300 From: =?iso-8859-1?Q?=C1lvaro?= Herrera To: Masahiko Sawada Cc: Matthias van de Meent , Hamid Akhtar , PostgreSQL Hackers Subject: Re: {CREATE INDEX, REINDEX} CONCURRENTLY improvements Message-ID: <20210223152623.GA2638@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.24 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2021-Feb-23, Masahiko Sawada wrote: > I've looked at the v3 patch and it looks good to me. A minor comment is: > > + /* Catalog tables need to consider all backends. */ > + h->catalog_oldest_nonremovable = > + TransactionIdOlder(h->catalog_oldest_nonremovable, xmin); > + > > I think that the above comment is not accurate since we consider only > backends on the same database in some cases. You're right. Adjusted. > the patch makes the following change: > > @@ -1847,7 +1871,6 @@ ComputeXidHorizons(ComputeXidHorizonsResult *h) > h->shared_oldest_nonremovable = > TransactionIdOlder(h->shared_oldest_nonremovable, > h->slot_catalog_xmin); > - h->catalog_oldest_nonremovable = h->data_oldest_nonremovable; > h->catalog_oldest_nonremovable = > TransactionIdOlder(h->catalog_oldest_nonremovable, > h->slot_catalog_xmin); > > In the original code, catalog_oldest_nonremovable is initialized with > data_oldest_nonremovable that considered slot_xmin. Therefore, IIUC > catalog_oldest_nonremovable is the oldest transaction id among > data_oldest_nonremovable, slot_xmin, and slot_catalog_xmin. But with > the patch, catalog_oldest_nonremovable doesn't consider slot_xmin. It > seems okay to me as catalog_oldest_nonremovable is interested in only > slot_catalog_xmin. I tend to agree -- it seems safe to ignore slot_xmin in that case. However, tracing through the maze of xmin vs. catalog_xmin transmission across the whole system is not trivial. I changed the patch so that we adjust to slot_xmin first, then to slot_catalog_xmin. I *think* the end effect should be the same. But if we want to make that claim to save that one assignment, we can make it in a separate commit. However, given that this comparison and assignment is outside the locked area, I don't think it's worth bothering with. Thanks for the input! I have pushed this patch. -- Álvaro Herrera Valdivia, Chile "El sentido de las cosas no viene de las cosas, sino de las inteligencias que las aplican a sus problemas diarios en busca del progreso." (Ernesto Hernández-Novich)