From: Alexander Lakhin <exclusion@gmail.com>
To: Pavel Borisov <pashkin.elfe@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18616: Long-running hash index build can not be interrupted
Date: Fri, 13 Sep 2024 21:00:00 +0300
Message-ID: <20a57c76-7aaf-a641-add3-147541a4dccf@gmail.com> (raw)
In-Reply-To: <CALT9ZEF8uLBizGLFEQArNv1t6aoQnjKuo04yEQfyup9nodj6Bg@mail.gmail.com>
References: <18616-acbb9e5caf41e964@postgresql.org>
<CALT9ZEF8uLBizGLFEQArNv1t6aoQnjKuo04yEQfyup9nodj6Bg@mail.gmail.com>
Hi Pavel,
13.09.2024 17:51, Pavel Borisov wrote:
>
>
> 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?
>
Thank you for paying attention to this!
Yes, the patch works for me. The query is interrupted as expected.
But I wonder, why don't you the see same?
Could you please show the server log, with the following change applied and
log_statement = 'all'
backtrace_functions = 'ProcessInterrupts'
?
--- a/src/backend/access/hash/hashsort.c+++ b/src/backend/access/hash/hashsort.c@@ -125,6 +125,7 @@ _h_indexbuild(HSpool *hspool, Relation heapRel)
uint32 hashkey = 0;
#endif
+elog(LOG, "_h_indexbuild() start");
tuplesort_performsort(hspool->sortstate);
while ((itup = tuplesort_getindextuple(hspool->sortstate, true)) != NULL)
@@ -151,4 +152,5 @@ _h_indexbuild(HSpool *hspool, Relation heapRel)
pgstat_progress_update_param(PROGRESS_CREATEIDX_TUPLES_DONE,
++tups_done);
}
+elog(LOG, "_h_indexbuild() end; tups_done: %ld", tups_done);
}
Best regards,
Alexander
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: exclusion@gmail.com, pashkin.elfe@gmail.com, 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>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox