Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u3duH-0016r2-2E for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Apr 2025 16:40:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u3duE-006mGQ-GF for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Apr 2025 16:40:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u3duE-006mGI-7d for pgsql-bugs@lists.postgresql.org; Sat, 12 Apr 2025 16:40:34 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u3duC-004V0h-2p for pgsql-bugs@lists.postgresql.org; Sat, 12 Apr 2025 16:40:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 53CGeSGh362682; Sat, 12 Apr 2025 12:40:28 -0400 From: Tom Lane To: Vinod Sridharan cc: niek.brasa@hitachienergy.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18831: Particular queries using gin-indexes are not interruptible, resulting is resource usage concerns. In-reply-to: References: <18831-e845ac44ebc5dd36@postgresql.org> <474911.1741207802@sss.pgh.pa.us> <1026035.1744415680@sss.pgh.pa.us> <1098251.1744426831@sss.pgh.pa.us> <1126691.1744435987@sss.pgh.pa.us> Comments: In-reply-to Vinod Sridharan message dated "Fri, 11 Apr 2025 22:58:52 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <362680.1744476028.1@sss.pgh.pa.us> Date: Sat, 12 Apr 2025 12:40:28 -0400 Message-ID: <362681.1744476028@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Vinod Sridharan writes: > I managed to get a test that fails without my patch, and added it to > the intarray tests. Without the patch, the query returns 0 records. > With my patch, the results are correct (12 records). Cool, thanks. > Please find attached the updated patch with a fix & a test in the > intarray contrib. Thanks for the pointer to the contrib extensions. Pushed with light editorialization. I noticed one other bug in the same area: shimTriConsistentFn wasn't paying attention to the recheck flag returned by its first call to the underlying consistentFn. I think this is probably just a latent issue, because if any of the later calls return recheck = true we'll end with the correct result anyway. And at least for the contrib modules that depend on this, the recheck flag doesn't depend on the key-presence inputs. But it's theoretically possible we'd get the wrong answer. regards, tom lane