postgresql/contrib/test_decoding
Heikki Linnakangas e6cd857726 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
2024-06-06 18:56:28 +03:00
..
expected Make RelationFlushRelation() work without ResourceOwner during abort 2024-06-06 18:56:28 +03:00
specs Remove incidental md5() function uses from several tests 2023-07-04 14:31:57 +02:00
sql Make RelationFlushRelation() work without ResourceOwner during abort 2024-06-06 18:56:28 +03:00
t Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore Improve isolation tests infrastructure. 2017-03-14 15:56:17 -07:00
logical.conf Stabilize streaming tests in test_decoding. 2022-04-20 08:59:55 +05:30
Makefile Fix catalog lookup with the wrong snapshot during logical decoding. 2022-08-11 10:09:24 +05:30
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
test_decoding.c Remove ReorderBufferTupleBuf structure. 2024-01-29 10:37:16 +09:00