From: | Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Make RelationFlushRelation() work without ResourceOwner during a |
Date: | 2024-06-06 15:56:59 |
Message-ID: | E1sFFU2-000HYh-UL@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Make RelationFlushRelation() work without ResourceOwner during abort
ReorderBufferImmediateInvalidation() executes invalidation messages in
an aborted transaction. However, RelationFlushRelation sometimes
required a valid resource owner, to temporarily increment the refcount
of the relache entry. Commit b8bff07daa worked around that in the main
subtransaction abort function, AbortSubTransaction(), but missed this
similar case in ReorderBufferImmediateInvalidation().
To fix, introduce a separate function to invalidate a relcache
entry. It does the same thing as RelationClearRelation(rebuild==true)
does when outside a transaction, but can be called without
incrementing the refcount.
Add regression test. Before this fix, it failed with:
ERROR: ResourceOwnerEnlarge called after release started
Reported-by: Alexander Lakhin <exclusion(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/e56be7d9-14b1-664d-0bfc-00ce9772721c@gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/e6cd85772647099563da5ada53bd6ab7d096ce00
Modified Files
--------------
.../test_decoding/expected/decoding_in_xact.out | 48 +++++++++++++++++++
contrib/test_decoding/sql/decoding_in_xact.sql | 27 +++++++++++
src/backend/access/transam/xact.c | 13 ------
src/backend/utils/cache/relcache.c | 54 +++++++++++++++++++---
4 files changed, 122 insertions(+), 20 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2024-06-06 19:17:10 | pgsql: Fix failure with SQL-procedure polymorphic output arguments in v |
Previous Message | Alexander Korotkov | 2024-06-06 10:45:49 | pgsql: Restore preprocess_groupclause() |