pgsql: Make RelationFlushRelation() work without ResourceOwner during a

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Make RelationFlushRelation() work without ResourceOwner during a
Дата
Msg-id E1sFFU2-000HYh-UL@gemulon.postgresql.org
обсуждение исходный текст
Список 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@gmail.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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: pgsql: Restore preprocess_groupclause()
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix failure with SQL-procedure polymorphic output arguments in v