Version in base suite: 2.3.3-3 Base version: pglogical_2.3.3-3 Target version: pglogical_2.3.3-3+deb11u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/p/pglogical/pglogical_2.3.3-3.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/p/pglogical/pglogical_2.3.3-3+deb11u1.dsc changelog | 7 patches/17a83481661e531669d6904920a9109424fa3339.patch | 131 +++++++++++++++++ patches/series | 1 postgresql-12-pglogical.debhelper.log | 4 watch | 4 5 files changed, 141 insertions(+), 6 deletions(-) diff -Nru pglogical-2.3.3/debian/changelog pglogical-2.3.3/debian/changelog --- pglogical-2.3.3/debian/changelog 2021-05-19 17:07:56.000000000 +0000 +++ pglogical-2.3.3/debian/changelog 2021-08-26 12:37:18.000000000 +0000 @@ -1,3 +1,10 @@ +pglogical (2.3.3-3+deb11u1) bullseye; urgency=medium + + * Adjust to PostgreSQL 13.4 snapshot handling fixes (PG commit ef9480509). + * debian/watch: Fix github URL. + + -- Christoph Berg Thu, 26 Aug 2021 14:37:18 +0200 + pglogical (2.3.3-3) unstable; urgency=high * debian/patches/cve-2021-3515.patch: New patch (taken from upstream commit diff -Nru pglogical-2.3.3/debian/patches/17a83481661e531669d6904920a9109424fa3339.patch pglogical-2.3.3/debian/patches/17a83481661e531669d6904920a9109424fa3339.patch --- pglogical-2.3.3/debian/patches/17a83481661e531669d6904920a9109424fa3339.patch 1970-01-01 00:00:00.000000000 +0000 +++ pglogical-2.3.3/debian/patches/17a83481661e531669d6904920a9109424fa3339.patch 2021-08-26 12:34:57.000000000 +0000 @@ -0,0 +1,131 @@ +commit 17a83481661e531669d6904920a9109424fa3339 +Author: Peter Eisentraut +Date: Tue Jun 15 15:05:22 2021 +0200 + + Fixes of snapshot handling + + PostgreSQL commit ef94805096229ee3573624465a76ca11d2bd8529 (and in + other branches) made some changes to snapshot handling in SPI. This + also included some fixes to the snapshot handling in logical + replication, for instance that a snapshot needs to be help around + AFTER trigger execution. These changes made pglogical 2 fail on some + assertions. This patch makes the corresponding fixes in pglogical 2. + +diff --git a/pglogical_apply_heap.c b/pglogical_apply_heap.c +index 9882518..9888ace 100644 +--- a/pglogical_apply_heap.c ++++ b/pglogical_apply_heap.c +@@ -250,6 +250,8 @@ init_apply_exec_state(PGLogicalRelation *rel) + { + ApplyExecState *aestate = palloc0(sizeof(ApplyExecState)); + ++ PushActiveSnapshot(GetTransactionSnapshot()); ++ + /* Initialize the executor state. */ + aestate->estate = create_estate_for_relation(rel->rel, true); + aestate->resultRelInfo = aestate->estate->es_result_relation_info; +@@ -286,6 +288,8 @@ finish_apply_exec_state(ApplyExecState *aestate) + /* Free the memory. */ + FreeExecutorState(aestate->estate); + pfree(aestate); ++ ++ PopActiveSnapshot(); + } + + /* +@@ -313,9 +317,6 @@ pglogical_apply_heap_insert(PGLogicalRelation *rel, PGLogicalTupleData *newtup) + ExecSetSlotDescriptor(localslot, RelationGetDescr(rel->rel)); + #endif + +- /* Get snapshot */ +- PushActiveSnapshot(GetTransactionSnapshot()); +- + ExecOpenIndices(aestate->resultRelInfo + #if PG_VERSION_NUM >= 90500 + , false +@@ -356,7 +357,6 @@ pglogical_apply_heap_insert(PGLogicalRelation *rel, PGLogicalTupleData *newtup) + if (aestate->slot == NULL) /* "do nothing" */ + #endif + { +- PopActiveSnapshot(); + finish_apply_exec_state(aestate); + return; + } +@@ -424,7 +424,6 @@ pglogical_apply_heap_insert(PGLogicalRelation *rel, PGLogicalTupleData *newtup) + if (aestate->slot == NULL) /* "do nothing" */ + #endif + { +- PopActiveSnapshot(); + finish_apply_exec_state(aestate); + return; + } +@@ -494,7 +493,6 @@ pglogical_apply_heap_insert(PGLogicalRelation *rel, PGLogicalTupleData *newtup) + #endif + } + +- PopActiveSnapshot(); + finish_apply_exec_state(aestate); + + CommandCounterIncrement(); +@@ -579,7 +577,6 @@ pglogical_apply_heap_update(PGLogicalRelation *rel, PGLogicalTupleData *oldtup, + if (aestate->slot == NULL) /* "do nothing" */ + #endif + { +- PopActiveSnapshot(); + finish_apply_exec_state(aestate); + return; + } +@@ -689,7 +686,6 @@ pglogical_apply_heap_update(PGLogicalRelation *rel, PGLogicalTupleData *oldtup, + } + + /* Cleanup. */ +- PopActiveSnapshot(); + finish_apply_exec_state(aestate); + + CommandCounterIncrement(); +@@ -733,7 +729,6 @@ pglogical_apply_heap_delete(PGLogicalRelation *rel, PGLogicalTupleData *oldtup) + + if (!dodelete) /* "do nothing" */ + { +- PopActiveSnapshot(); + finish_apply_exec_state(aestate); + pglogical_relation_close(rel, NoLock); + return; +@@ -760,7 +755,6 @@ pglogical_apply_heap_delete(PGLogicalRelation *rel, PGLogicalTupleData *oldtup) + } + + /* Cleanup. */ +- PopActiveSnapshot(); + finish_apply_exec_state(aestate); + + CommandCounterIncrement(); +diff --git a/pglogical_output_plugin.c b/pglogical_output_plugin.c +index 11fa818..abbe00c 100644 +--- a/pglogical_output_plugin.c ++++ b/pglogical_output_plugin.c +@@ -28,6 +28,7 @@ + #include "utils/inval.h" + #include "utils/memutils.h" + #include "utils/rel.h" ++#include "utils/snapmgr.h" + #include "replication/origin.h" + + #include "pglogical_output_plugin.h" +@@ -618,6 +619,8 @@ pglogical_change_filter(PGLogicalOutputData *data, Relation relation, + return false; + } + ++ PushActiveSnapshot(GetTransactionSnapshot()); ++ + estate = create_estate_for_relation(relation, false); + econtext = prepare_per_tuple_econtext(estate, tupdesc); + +@@ -643,6 +646,8 @@ pglogical_change_filter(PGLogicalOutputData *data, Relation relation, + + ExecDropSingleTupleTableSlot(econtext->ecxt_scantuple); + FreeExecutorState(estate); ++ ++ PopActiveSnapshot(); + } + + /* Make sure caller is aware of any attribute filter. */ diff -Nru pglogical-2.3.3/debian/patches/series pglogical-2.3.3/debian/patches/series --- pglogical-2.3.3/debian/patches/series 2021-05-18 21:27:18.000000000 +0000 +++ pglogical-2.3.3/debian/patches/series 2021-08-26 12:34:57.000000000 +0000 @@ -7,3 +7,4 @@ alternative_regression_outputs.patch disable-add-table-test cve-2021-3515.patch +17a83481661e531669d6904920a9109424fa3339.patch diff -Nru pglogical-2.3.3/debian/postgresql-12-pglogical.debhelper.log pglogical-2.3.3/debian/postgresql-12-pglogical.debhelper.log --- pglogical-2.3.3/debian/postgresql-12-pglogical.debhelper.log 2020-09-25 11:00:26.000000000 +0000 +++ pglogical-2.3.3/debian/postgresql-12-pglogical.debhelper.log 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -dh_update_autotools_config -dh_auto_configure -dh_auto_build -dh_auto_test diff -Nru pglogical-2.3.3/debian/watch pglogical-2.3.3/debian/watch --- pglogical-2.3.3/debian/watch 2021-05-18 21:28:34.000000000 +0000 +++ pglogical-2.3.3/debian/watch 2021-08-26 12:34:57.000000000 +0000 @@ -1,3 +1,3 @@ version=3 -opts="uversionmangle=s/^REL(\d)_(\d)_(\d)$/$1.$2.$3/" \ -https://github.com/2ndQuadrant/pglogical/releases .*/archive/(.*).tar.gz +opts="uversionmangle=s/^(\d+)_(\d+)_(\d+)$/$1.$2.$3/" \ +https://github.com/2ndQuadrant/pglogical/releases .*/REL(.*).tar.gz