Re: Buffer pin leak in hash index bucket splits

From: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Buffer pin leak in hash index bucket splits
Date: 2026-10-11 06:35:55
Message-ID: CAJTYsWVCa3NQmBjcrTjuiQtwEgGrTsoacmAvQHtLu=K9dpn6BA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Sun, 11 Oct 2026 at 10:12, Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
>
> During review of what became bugfix commit 173cf85a, Claude Code found
> an unrelated bug in hash index bucket splits.
>
> Attached bug fix patch adds an isolation test demonstrating the
> problem; with the fix itself reverted, running the Claude-authored
> test shows a buffer pin leak. The leak is caused by _hash_finish_split
> neglecting to release a pin on the primary bucket buffer in its
> failure paths, used when a cleanup lock cannot be acquired. The fix
> just has _hash_finish_split release the pin in those paths.

Thanks for the report and patch. The fix LGTM.

> I doubt that it's worth committing the test itself. It'll add test
> cycles for a trivial issue, that's unlikely to ever regress in the
> future.

+1 on not having one for this.

Regards,
Ayush

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2026-10-11 07:00:01 Re: [PATCH] Two remaining shmem attachment issues in single-user mode
Previous Message Amit Kapila 2026-10-11 05:51:09 Re: Fix WITHOUT OVERLAPS multirange with location replication