pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix construction of updated-columns bitmap in logical replicatio
5+ messages / 1 participants
[nested] [flat]

* pgsql: Fix construction of updated-columns bitmap in logical replicatio
@ 2020-07-20 17:40  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2020-07-20 17:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix construction of updated-columns bitmap in logical replication.

Commit b9c130a1f failed to apply the publisher-to-subscriber column
mapping while checking which columns were updated.  Perhaps less
significantly, it didn't exclude dropped columns either.  This could
result in an incorrect updated-columns bitmap and thus wrong decisions
about whether to fire column-specific triggers on the subscriber while
applying updates.  In HEAD (since commit 9de77b545), it could also
result in accesses off the end of the colstatus array, as detected by
buildfarm member skink.  Fix the logic, and adjust 003_constraints.pl
so that the problem is exposed in unpatched code.

In HEAD, also add some assertions to check that we don't access off
the ends of these newly variable-sized arrays.

Back-patch to v10, as b9c130a1f was.

Discussion: https://postgr.es/m/CAH2-Wz=79hKQ4++c5A060RYbjTHgiYTHz=fw6mptCtgghH2gJA@mail.gmail.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2f1f189cf8806a02987dfa1759257b154162fac2

Modified Files
--------------
src/backend/replication/logical/worker.c   | 13 ++++++++++---
src/test/subscription/t/003_constraints.pl | 12 +++++++-----
2 files changed, 17 insertions(+), 8 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix construction of updated-columns bitmap in logical replicatio
@ 2020-07-20 17:40  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2020-07-20 17:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix construction of updated-columns bitmap in logical replication.

Commit b9c130a1f failed to apply the publisher-to-subscriber column
mapping while checking which columns were updated.  Perhaps less
significantly, it didn't exclude dropped columns either.  This could
result in an incorrect updated-columns bitmap and thus wrong decisions
about whether to fire column-specific triggers on the subscriber while
applying updates.  In HEAD (since commit 9de77b545), it could also
result in accesses off the end of the colstatus array, as detected by
buildfarm member skink.  Fix the logic, and adjust 003_constraints.pl
so that the problem is exposed in unpatched code.

In HEAD, also add some assertions to check that we don't access off
the ends of these newly variable-sized arrays.

Back-patch to v10, as b9c130a1f was.

Discussion: https://postgr.es/m/CAH2-Wz=79hKQ4++c5A060RYbjTHgiYTHz=fw6mptCtgghH2gJA@mail.gmail.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e8de627a3e05e201ffb78ad7792d14fd25c857c8

Modified Files
--------------
src/backend/replication/logical/worker.c   | 13 ++++++++++---
src/test/subscription/t/003_constraints.pl | 13 ++++++++-----
2 files changed, 18 insertions(+), 8 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix construction of updated-columns bitmap in logical replicatio
@ 2020-07-20 17:40  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2020-07-20 17:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix construction of updated-columns bitmap in logical replication.

Commit b9c130a1f failed to apply the publisher-to-subscriber column
mapping while checking which columns were updated.  Perhaps less
significantly, it didn't exclude dropped columns either.  This could
result in an incorrect updated-columns bitmap and thus wrong decisions
about whether to fire column-specific triggers on the subscriber while
applying updates.  In HEAD (since commit 9de77b545), it could also
result in accesses off the end of the colstatus array, as detected by
buildfarm member skink.  Fix the logic, and adjust 003_constraints.pl
so that the problem is exposed in unpatched code.

In HEAD, also add some assertions to check that we don't access off
the ends of these newly variable-sized arrays.

Back-patch to v10, as b9c130a1f was.

Discussion: https://postgr.es/m/CAH2-Wz=79hKQ4++c5A060RYbjTHgiYTHz=fw6mptCtgghH2gJA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d5daae47db5e8a61ce6ed7afaa3e3a99af108c06

Modified Files
--------------
src/backend/replication/logical/proto.c    |  1 +
src/backend/replication/logical/worker.c   | 18 +++++++++++++++---
src/include/replication/logicalproto.h     |  7 ++++++-
src/test/subscription/t/003_constraints.pl | 12 +++++++-----
4 files changed, 29 insertions(+), 9 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix construction of updated-columns bitmap in logical replicatio
@ 2020-07-20 17:40  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2020-07-20 17:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix construction of updated-columns bitmap in logical replication.

Commit b9c130a1f failed to apply the publisher-to-subscriber column
mapping while checking which columns were updated.  Perhaps less
significantly, it didn't exclude dropped columns either.  This could
result in an incorrect updated-columns bitmap and thus wrong decisions
about whether to fire column-specific triggers on the subscriber while
applying updates.  In HEAD (since commit 9de77b545), it could also
result in accesses off the end of the colstatus array, as detected by
buildfarm member skink.  Fix the logic, and adjust 003_constraints.pl
so that the problem is exposed in unpatched code.

In HEAD, also add some assertions to check that we don't access off
the ends of these newly variable-sized arrays.

Back-patch to v10, as b9c130a1f was.

Discussion: https://postgr.es/m/CAH2-Wz=79hKQ4++c5A060RYbjTHgiYTHz=fw6mptCtgghH2gJA@mail.gmail.com

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/39d6aec1927cc87942feb4b021360605f0a4ce8a

Modified Files
--------------
src/backend/replication/logical/worker.c   | 13 ++++++++++---
src/test/subscription/t/003_constraints.pl | 13 ++++++++-----
2 files changed, 18 insertions(+), 8 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix construction of updated-columns bitmap in logical replicatio
@ 2020-07-20 17:40  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2020-07-20 17:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix construction of updated-columns bitmap in logical replication.

Commit b9c130a1f failed to apply the publisher-to-subscriber column
mapping while checking which columns were updated.  Perhaps less
significantly, it didn't exclude dropped columns either.  This could
result in an incorrect updated-columns bitmap and thus wrong decisions
about whether to fire column-specific triggers on the subscriber while
applying updates.  In HEAD (since commit 9de77b545), it could also
result in accesses off the end of the colstatus array, as detected by
buildfarm member skink.  Fix the logic, and adjust 003_constraints.pl
so that the problem is exposed in unpatched code.

In HEAD, also add some assertions to check that we don't access off
the ends of these newly variable-sized arrays.

Back-patch to v10, as b9c130a1f was.

Discussion: https://postgr.es/m/CAH2-Wz=79hKQ4++c5A060RYbjTHgiYTHz=fw6mptCtgghH2gJA@mail.gmail.com

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/71e561bd4bc2d6e85f9a1ae8064d8b190dcad2b4

Modified Files
--------------
src/backend/replication/logical/worker.c   | 13 ++++++++++---
src/test/subscription/t/003_constraints.pl | 13 ++++++++-----
2 files changed, 18 insertions(+), 8 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2020-07-20 17:40 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 17:40 pgsql: Fix construction of updated-columns bitmap in logical replicatio Tom Lane <tgl@sss.pgh.pa.us>
2020-07-20 17:40 pgsql: Fix construction of updated-columns bitmap in logical replicatio Tom Lane <tgl@sss.pgh.pa.us>
2020-07-20 17:40 pgsql: Fix construction of updated-columns bitmap in logical replicatio Tom Lane <tgl@sss.pgh.pa.us>
2020-07-20 17:40 pgsql: Fix construction of updated-columns bitmap in logical replicatio Tom Lane <tgl@sss.pgh.pa.us>
2020-07-20 17:40 pgsql: Fix construction of updated-columns bitmap in logical replicatio 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