Re: Fix a relcache reference leak in reorderbuffer.c

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix a relcache reference leak in reorderbuffer.c
Date: 2026-08-18 05:55:32
Message-ID: aoPz09eY2dpQ2oxx@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 18, 2026 at 11:51:48AM +0800, Chao Li wrote:
> In the loop, each relation that is appended to relations is closed
> after the loop. However, when RelationIsLogicallyLogged(rel) returns
> false, the relation is skipped without being closed, causing the
> leak.

Good catch. This code may over-allocate the set of relations it is
working on, and we would forget to close the once not logged. That's
wrong since 5dfd1e5a6696.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Xuneng Zhou 2026-08-18 05:59:01 Re: Fix a relcache reference leak in reorderbuffer.c
Previous Message jian he 2026-08-18 05:54:38 Re: [BUG] hstore integer overflow when constructing large values