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 1qEpRz-0004L0-Ul for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jun 2023 11:04:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qEpRy-0002rW-Sr for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jun 2023 11:04:34 +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 1qEpRy-0002rN-JT for pgsql-hackers@lists.postgresql.org; Thu, 29 Jun 2023 11:04:34 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qEpRv-0015Ms-1L for pgsql-hackers@lists.postgresql.org; Thu, 29 Jun 2023 11:04:33 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id D79352F990E7 for ; Thu, 29 Jun 2023 13:04:26 +0200 (CEST) Received: from s899.loopia.se (unknown [172.22.191.6]) by s807.loopia.se (Postfix) with ESMTP id C8EF32E28BDB; Thu, 29 Jun 2023 13:04:26 +0200 (CEST) Received: from s474.loopia.se (unknown [172.22.191.6]) by s899.loopia.se (Postfix) with ESMTP id C76852C8BA29; Thu, 29 Jun 2023 13:04:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -2.22 X-Spam-Level: X-Spam-Status: No, score=-2.22 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, NICE_REPLY_A=-1.22] autolearn=disabled Received: from s934.loopia.se ([172.22.191.6]) by s474.loopia.se (s474.loopia.se [172.22.190.14]) (amavisd-new, port 10024) with LMTP id LGkIhCtqd1m9; Thu, 29 Jun 2023 13:04:26 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: andreas@proxel.se X-Loopia-Originating-IP: 158.174.129.34 Received: from [192.168.100.115] (h-158-174-129-34.NA.cust.bahnhof.se [158.174.129.34]) (Authenticated sender: andreas@proxel.se) by s934.loopia.se (Postfix) with ESMTPSA id 61B737CEAB7; Thu, 29 Jun 2023 13:04:26 +0200 (CEST) Message-ID: <3c731352-3fbc-c98e-11af-ef5075de584e@proxel.se> Date: Thu, 29 Jun 2023 13:04:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: Does a cancelled REINDEX CONCURRENTLY need to be messy? Content-Language: en-US To: Thom Brown , PostgreSQL Hackers References: From: Andreas Karlsson In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/29/23 11:13, Thom Brown wrote: > I get the feeling that this is deliberate, and perhaps an attempt to > mitigate locking issues, or some other explanation, but the rationale > isn't immediately apparent to me if this is the case. I have always assumed the reason is that there might be other transactions using the index so if we are going to drop it on rollback we might get stuck forever waiting for an exclusive lock on the index. How do you get around that? Rollback being stuck waiting forever is certainly not a nice behavior. Andreas