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 1spBsG-00HIPE-V4 for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Sep 2024 19:22:33 +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 1spBsF-00ADUV-Uh for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Sep 2024 19:22:31 +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 1spBsF-00ADRj-Lx for pgsql-bugs@lists.postgresql.org; Fri, 13 Sep 2024 19:22:31 +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.94.2) (envelope-from ) id 1spBsC-0010gw-Kh for pgsql-bugs@lists.postgresql.org; Fri, 13 Sep 2024 19:22:30 +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 48DJMQK8122465; Fri, 13 Sep 2024 15:22:26 -0400 From: Tom Lane To: Alexander Lakhin cc: Pavel Borisov , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18616: Long-running hash index build can not be interrupted In-reply-to: <20a57c76-7aaf-a641-add3-147541a4dccf@gmail.com> References: <18616-acbb9e5caf41e964@postgresql.org> <20a57c76-7aaf-a641-add3-147541a4dccf@gmail.com> Comments: In-reply-to Alexander Lakhin message dated "Fri, 13 Sep 2024 21:00:00 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <122463.1726255346.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 13 Sep 2024 15:22:26 -0400 Message-ID: <122464.1726255346@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Lakhin writes: > 13.09.2024 17:51, Pavel Borisov wrote: >> I was unable to reproduce it on my machine with these settings. Tried s= tatement timeouts 30-120s. Index build appears = >> to be in interruptible phase on my system. > Yes, the patch works for me. The query is interrupted as expected. > But I wonder, why don't you the see same? I see the same result as Alexander: the query fails to time out after the expected 90 seconds, and it's looping in _h_indexbuild. Looking at hashbuild, the effective sort_threshold depends on NBuffers, so maybe if you have that set to a high enough value it fails to go into the sort path? If I use SET maintenance_work_mem =3D '128MB'; instead of the suggested 1GB, I don't see the problem. regards, tom lane