git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 505c008) | patch
Make RelationFlushRelation() work without ResourceOwner during abort
Thu, 6 Jun 2024 15:56:28 +0000 (18:56 +0300)
Thu, 6 Jun 2024 15:56:28 +0000 (18:56 +0300)
commit e6cd85772647099563da5ada53bd6ab7d096ce00
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@gmail.com>
Discussion: https://www.postgresql.org/message-id/e56be7d9-14b1-664d-0bfc-00ce9772721c@gmail.com
contrib/test_decoding/expected/decoding_in_xact.out diff | blob | blame | history
contrib/test_decoding/sql/decoding_in_xact.sql diff | blob | blame | history
src/backend/access/transam/xact.c diff | blob | blame | history
src/backend/utils/cache/relcache.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /