pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix multiple crasher bugs in partitioned-table replication logic 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix multiple crasher bugs in partitioned-table replication logic @ 2021-06-11 20:12 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2021-06-11 20:12 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix multiple crasher bugs in partitioned-table replication logic. apply_handle_tuple_routing(), having detected and reported that the tuple it needed to update didn't exist, tried to update that tuple anyway, leading to a null-pointer dereference. logicalrep_partition_open() failed to ensure that the LogicalRepPartMapEntry it built for a partition was fully independent of that for the partition root, leading to trouble if the root entry was later freed or rebuilt. Meanwhile, on the publisher's side, pgoutput_change() sometimes attempted to apply execute_attr_map_tuple() to a NULL tuple. The first of these was reported by Sergey Bernikov in bug #17055; I found the other two while developing some test cases for this sadly under-tested code. Diagnosis and patch for the first issue by Amit Langote; patches for the others by me; new test cases by me. Back-patch to v13 where this logic came in. Discussion: https://postgr.es/m/17055-9ba800ec8522668b@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/ab55d742eb7162c22ee60f1e15e07d2a60063c4e Modified Files -------------- src/backend/replication/logical/relation.c | 13 ++++-- src/backend/replication/logical/worker.c | 48 ++++++++++--------- src/backend/replication/pgoutput/pgoutput.c | 7 ++- src/test/subscription/t/001_rep_changes.pl | 36 ++++++++++++++- src/test/subscription/t/013_partition.pl | 71 ++++++++++++++++++++++++++++- 5 files changed, 146 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix multiple crasher bugs in partitioned-table replication logic @ 2021-06-11 20:12 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2021-06-11 20:12 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix multiple crasher bugs in partitioned-table replication logic. apply_handle_tuple_routing(), having detected and reported that the tuple it needed to update didn't exist, tried to update that tuple anyway, leading to a null-pointer dereference. logicalrep_partition_open() failed to ensure that the LogicalRepPartMapEntry it built for a partition was fully independent of that for the partition root, leading to trouble if the root entry was later freed or rebuilt. Meanwhile, on the publisher's side, pgoutput_change() sometimes attempted to apply execute_attr_map_tuple() to a NULL tuple. The first of these was reported by Sergey Bernikov in bug #17055; I found the other two while developing some test cases for this sadly under-tested code. Diagnosis and patch for the first issue by Amit Langote; patches for the others by me; new test cases by me. Back-patch to v13 where this logic came in. Discussion: https://postgr.es/m/17055-9ba800ec8522668b@postgresql.org Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b270713fd44b1378cebc3177e092add0155b55b6 Modified Files -------------- src/backend/replication/logical/relation.c | 13 ++++-- src/backend/replication/logical/worker.c | 49 +++++++++++--------- src/backend/replication/pgoutput/pgoutput.c | 7 ++- src/test/subscription/t/001_rep_changes.pl | 36 ++++++++++++++- src/test/subscription/t/013_partition.pl | 71 ++++++++++++++++++++++++++++- 5 files changed, 147 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2021-06-11 20:12 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-06-11 20:12 pgsql: Fix multiple crasher bugs in partitioned-table replication logic Tom Lane <tgl@sss.pgh.pa.us> 2021-06-11 20:12 pgsql: Fix multiple crasher bugs in partitioned-table replication logic Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox