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.96) (envelope-from ) id 1wwImf-001tSZ-0z for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Aug 2026 12:19:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wwImd-00FaNd-0k for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Aug 2026 12:19:12 +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.96) (envelope-from ) id 1wwIX4-00FTLL-1a for pgsql-bugs@lists.postgresql.org; Tue, 18 Aug 2026 12:03:07 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wwIX4-00000001D1S-03Sv for pgsql-bugs@lists.postgresql.org; Tue, 18 Aug 2026 12:03:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=MlE/zWCJ+AMVRpk6WQ4FWMKGii+H+aMsGpP173bE2j4=; b=JPZMzm0cBlUkIjCsxTxfjUdBj8 Ej3rdyOcAuBoS8Hb07IhI1eUuU7ZUgk1KMkusis1w9bhPJVDo9aJcLkxYMSD/v2H314QiUGHrTAUg w+sQYggsrulSyYvUvdkhDPgc4pYcj1rFA1jIX2bTmUoUfMeu0f4uso363pU5Mbirs1Kbz5AlRTLp2 UKxtzmeF09FxBp6yJEEk9LUU3Pl0CtxJgk3IoMo0nSLm1idn0Kq8FbDhx9vv14gKpQrg53OSBpNAu AtmzmWq6T+73x3/jIvGWMbODy9d8kXUxak7T9uPFGOZL7A09ViQQwehTQPn1vpFSXmCFRtShtFn8T 2Zsfgjgg==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wwIX3-003i4J-2P for pgsql-bugs@lists.postgresql.org; Tue, 18 Aug 2026 12:03:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1wwIX1-00000009lLw-41b6 for pgsql-bugs@lists.postgresql.org; Tue, 18 Aug 2026 12:03:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19628: Uninterruptible vacuum during hash index processing To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: sk@zsrv.org Reply-To: sk@zsrv.org, pgsql-bugs@lists.postgresql.org Date: Tue, 18 Aug 2026 12:02:07 +0000 Message-ID: <19628-c2b17d358181a1ea@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19628 Logged by: Sergei Kornilov Email address: sk@zsrv.org PostgreSQL version: 16.14 Operating system: ubuntu Description: =20 Hello! During the installation of minor update (from 16.14 to 16.15), I discovered that PostgreSQL was shutting down for a long time (about 6 minutes) because it was waiting for the autovacuum process to terminate. I was able to find the cause in the vacuum implementation for hash indexes (this database has a fairly big hash index): 1) vacuum executes hashbulkdelete ( src/backend/access/hash/hash.c ) 2) LockBufferForCleanup in loop_top calls HOLD_INTERRUPTS() under the hood 3) then we execute hashbucketcleanup , which can take a long time. Here, the loop calls vacuum_delay_point (which calls CHECK_FOR_INTERRUPTS), but it does nothing because HOLD_INTERRUPTS is still in effect. 4) Only at the end of hashbucketcleanup RESUME_INTERRUPTS is called from LWLockRelease I checked with gdb: hashbucketcleanup is actually executed with a non-zero InterruptHoldoffCount. Breakpoint 1, hashbucketcleanup (rel=3Drel@entry=3D0x7f1cf95ec080, cur_bucket=3Dcur_bucket@entry=3D0, bucket_buf=3Dbucket_buf@entry=3D11847, bucket_blkno=3Dbucket_blkno@entr= y=3D1, bstrategy=3D0x55f74ae62ca8, maxbucket=3D32573, highmask=3D32767, lowmask=3D16383, tuples_removed=3D0x7fff95dc5a98, num_index_tuples=3D0x7fff95dc5a90, split_cleanup=3Dfalse, callback=3D0x55f7395a6fa8 , callback_state=3D0x7f1ce9b6= d048) at hash.c:691 691 { (gdb) n 700 if (split_cleanup) (gdb) n 717 vacuum_delay_point(); (gdb) p InterruptHoldoffCount $1 =3D 1 I'm not sure how to properly fix hashbucketcleanup. At the very least, an additional vacuum_delay_point in hashbulkdelete before LockBufferForCleanup would improve the situation slightly. regards, Sergei