Re: BUG #18616: Long-running hash index build can not be interrupted

From: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
To: exclusion(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18616: Long-running hash index build can not be interrupted
Date: 2024-09-13 14:51:30
Message-ID: CALT9ZEF8uLBizGLFEQArNv1t6aoQnjKuo04yEQfyup9nodj6Bg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi, Alexander!

On Fri, 13 Sept 2024 at 18:02, PG Bug reporting form <noreply(at)postgresql(dot)org>
wrote:

> The following bug has been logged on the website:
>
> Bug reference: 18616
> Logged by: Alexander Lakhin
> Email address: exclusion(at)gmail(dot)com
> PostgreSQL version: 17rc1
> Operating system: Ubuntu 22.04
> Description:
>
> The following script:
> CREATE TABLE t(i int);
> INSERT INTO t SELECT 1 FROM generate_series(1, 10000000);
>
> SET maintenance_work_mem = '1GB';
>
> SET statement_timeout = '90s';
> CREATE INDEX hi ON t USING hash (i);
>
> reaches a state, when the backend can not be interrupted.
>
> gdb shows that the code execution loops inside:
> #0 _h_indexbuild (...) at hashsort.c:151
> #1 0x0000557f3671cbf3 in hashbuild (...)
> at hash.c:183
> ...
> with tups_done increasing slowly (given the total number of tuples).
>
> Reproduced on all supported versions.
>
I was unable to reproduce it on my machine with these settings. Tried
statement timeouts 30-120s. Index build appears to be in interruptible
phase on my system.
But could you check in your environment with the following patch?

Kind regards,
Pavel Borisov
Supabase

Attachment Content-Type Size
0001-Check-for-interrupts-during-hash-index-builds.patch application/octet-stream 882 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Erik Wienhold 2024-09-13 16:17:43 Re: BUG #18617: PostgreSQL Server Subprocess Crashes by the XPATH Function Expression with Crafted Arguments
Previous Message PG Bug reporting form 2024-09-13 12:31:20 BUG #18617: PostgreSQL Server Subprocess Crashes by the XPATH Function Expression with Crafted Arguments