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

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: exclusion(at)gmail(dot)com
Subject: BUG #18616: Long-running hash index build can not be interrupted
Date: 2024-09-13 10:00:00
Message-ID: 18616-acbb9e5caf41e964@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Vinay Oli 2024-09-13 10:09:13 Reg: Size difference
Previous Message Duncan Sands 2024-09-13 09:08:16 Re: pg_restore with --disable-triggers discards ENABLE ALWAYS