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 1k8VPE-0004kL-A6 for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Aug 2020 21:14:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k8VOg-0001cM-3J for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Aug 2020 21:13:26 +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 1k8VOf-0001cF-7W for pgsql-hackers@lists.postgresql.org; Wed, 19 Aug 2020 21:13:25 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k8VOY-0001Ja-M5 for pgsql-hackers@lists.postgresql.org; Wed, 19 Aug 2020 21:13:24 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 4D4115C01A4; Wed, 19 Aug 2020 17:13:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 19 Aug 2020 17:13:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=AIWKqm JmgYf3tWnY7/t/2CMRlpM8Ctpn93ggFIohTiE=; b=k02KmkKm4n+LvTyKxqHj85 M2osZ156EuNjU2Rl8cL5R02jzZaOOqYAvG6eO9mUoS52mRk8iYEbFXMAY8HSNEaQ 28lcYpghELsjeWb1rbOVOJAlIm/G4sblnP6jdJoNOZ66HGnFXwjxv9oc0OBE1k7t 0CHz6c46oJ0rYABYlh59k+FvVOnO43MvO+KLeqrhL73BBedlBXqf9aCSvi/fXruP /K3G2rhbYg6fLdoVtxxusdDLkHjz/8V9/9+o0PKDq37v8RUBP9/vPIJA9cprCE2D 8KHBM7Fdqds1QMZzSyRLBHyDnZFYyQ++LHt5g31UDvl9N9OdZ/UW+nLE3vg9q7qg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedruddtkedgudeffecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgfgesthekredttderudenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepieegueelgfelheehjeeiteeggeeltdeghfduudefvdej vdeihffhuefgfefhiefgnecukfhppeduledtrdelhedrudelrdegjeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.47]) by mail.messagingengine.com (Postfix) with ESMTPA id 71A5D3060067; Wed, 19 Aug 2020 17:13:15 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D4AF92A151A; Wed, 19 Aug 2020 17:13:12 -0400 (-04) Date: Wed, 19 Aug 2020 17:13:12 -0400 From: Alvaro Herrera To: Pg Hackers Cc: Peter Eisentraut , Michael Paquier Subject: "ccold" left by reindex concurrently are droppable? Message-ID: <20200819211312.GA15497@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello The REINDEX CONCURRENTLY documentation states that if a transient index used lingers, the fix is to drop the invalid index and perform RC again; and that this is to be done for "ccnew" indexes and also for "ccold" indexes: The recommended recovery method in such cases is to drop the invalid index and try again to perform REINDEX CONCURRENTLY. The concurrent index created during the processing has a name ending in the suffix ccnew, or ccold if it is an old index definition which we failed to drop. Invalid indexes can be dropped using DROP INDEX, including invalid toast indexes. But this seems misleading to me. It is correct advice for "ccnew" indexes, of course. But if the index is named "ccold", then the rebuild of the index actually succeeded, so you can just drop the ccold index and not rebuild anything. In other words I propose to reword this paragraph as follows: If the transient index created during the concurrent operation is suffixed ccnew, the recommended recovery method is to drop the invalid index using DROP INDEX, and try to perform REINDEX CONCURRENTLY again. If the transient index is instead suffixed ccold, it corresponds to the original index which we failed to drop; the recommended recovery method is to just drop said index, since the rebuild proper has been successful. (The original talks about "the concurrent index", which seems somewhat sloppy thinking. I used the term "transient index" instead.) -- Álvaro Herrera 39°49'30"S 73°17'W