postgresql/src/backend/replication/logical
Amit Kapila f7d25117ba Fix uninitialized access to InitialRunningXacts during decoding after ERROR.
The transactions and subtransactions array that was allocated under
snapshot builder memory context and recorded during decoding was not
cleared in case of errors. This can result in an assertion failure if we
attempt to retry logical decoding within the same session. To address this
issue, we register a callback function under the snapshot builder memory
context to clear the recorded transactions and subtransactions array along
with the context.

This problem doesn't exist in PG16 and HEAD as instead of using
InitialRunningXacts, we added the list of transaction IDs and
sub-transaction IDs, that have modified catalogs and are running during
snapshot serialization, to the serialized snapshot (see commit 7f13ac8123).

Author: Hou Zhijie
Reviewed-by: Amit Kapila
Backpatch-through: 11
Discussion: http://postgr.es/m/18055-ab3beed9f4b7b7d6@postgresql.org
2023-09-12 10:12:51 +05:30
..
Makefile Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
decode.c Fix snapshot handling in logicalmsg_decode 2023-02-22 16:25:45 +01:00
launcher.c Fix off-by-one loop termination condition in pg_stat_get_subscription(). 2022-06-07 15:34:30 -04:00
logical.c Fix the logical replication timeout during large transactions. 2022-05-11 10:51:04 +05:30
logicalfuncs.c Return ReplicationSlotAcquire API to its original form 2021-06-11 15:48:26 -04:00
message.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
origin.c Fix incorrect error code in StartupReplicationOrigin(). 2021-08-30 09:22:28 +05:30
proto.c Fix Logical Replication of Truncate in synchronous commit mode. 2021-04-27 08:28:26 +05:30
relation.c Fix memory leak due to LogicalRepRelMapEntry.attrmap. 2022-06-23 09:20:41 +05:30
reorderbuffer.c Fix ReorderBufferCheckMemoryLimit() comment. 2023-08-02 15:01:05 +09:00
snapbuild.c Fix uninitialized access to InitialRunningXacts during decoding after ERROR. 2023-09-12 10:12:51 +05:30
tablesync.c Fix the Drop Database hang. 2023-01-24 09:02:05 +05:30
worker.c Fix some BufFileRead() error reporting 2023-01-16 09:48:09 +01:00