pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix bug in the new ResourceOwner implementation.
Date: Wed, 08 Nov 2023 23:48:55 +0000
Message-ID: <E1r0sI2-004Z5s-U5@gemulon.postgresql.org> (raw)

Fix bug in the new ResourceOwner implementation.

When the hash table is in use, ResoureOwnerSort() moves any elements
from the small fixed-size array to the hash table, and sorts it. When
the hash table is not in use, it sorts the elements in the small
fixed-size array directly. However, ResourceOwnerSort() and
ResourceOwnerReleaseAll() had different idea on when the hash table is
in use: ResourceOwnerSort() checked owner->nhash != 0, and
ResourceOwnerReleaseAll() checked owner->hash != NULL. If the hash
table was allocated but was currently empty, you hit an assertion
failure.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://www.postgresql.org/message-id/be58d565-9e95-d417-4e47-f6bd408dea4b@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8f4a1ab471e6a258881e3d7f5883705714cde7e1

Modified Files
--------------
src/backend/utils/resowner/resowner.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)



Message-ID: <E1r0sI2-004Z5s-U5@gemulon.postgresql.org>
Permalink:  ../E1r0sI2-004Z5s-U5@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1r0sI2-004Z5s-U5@gemulon.postgresql.org

 · 

reply

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-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix bug in the new ResourceOwner implementation.
  In-Reply-To: <E1r0sI2-004Z5s-U5@gemulon.postgresql.org>

* 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