Re: ResourceOwner refactoring

Heikki Linnakangas <hlinnaka@iki.fi>

From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: Aleksander Alekseev <aleksander@timescale.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Julien Rouhaud <rjuju123@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, Andres Freund <andres@anarazel.de>
Date: 2024-06-06T11:32:38Z
Lists: pgsql-hackers
On 05/06/2024 16:58, Heikki Linnakangas wrote:
> On 04/06/2024 01:49, Heikki Linnakangas wrote:
>> A straightforward fix is to modify RelationFlushRelation() so that if
>> !IsTransactionState(), it just marks the entry as invalid instead of
>> calling RelationClearRelation(). That's what RelationClearRelation()
>> would do anyway, if it didn't hit the assertion first.
> 
> Here's a patch with that straightforward fix. Your test case hit the
> "rd_createSubid != InvalidSubTransactionId" case, I expanded it to also
> cover the "rd_firstRelfilelocatorSubid != InvalidSubTransactionId" case.

For the record, I got the above backwards: your test case covered the 
rd_firstRelfilelocatorSubid case and I expanded it to also cover the 
rd_createSubid case.

> Barring objections, I'll commit this later today or tomorrow. Thanks for
> the report!

Committed.

-- 
Heikki Linnakangas
Neon (https://neon.tech)




Commits

  1. Make RelationFlushRelation() work without ResourceOwner during abort

  2. Fix bug in bulk extending temp relation after failure

  3. Add missing PGDLLIMPORT markings

  4. Add test_dsa module.

  5. Clear CurrentResourceOwner earlier in CommitTransaction.

  6. Fix dsa.c with different resource owners.

  7. Fix bug in the new ResourceOwner implementation.

  8. Change pgcrypto to use the new ResourceOwner mechanism.

  9. Use a faster hash function in resource owners.

  10. Make ResourceOwners more easily extensible.

  11. Move a few ResourceOwnerEnlarge() calls for safety and clarity.