pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix negative bitmapset member not allowed error in logical repli
5+ messages / 2 participants
[nested] [flat]

* pgsql: Fix negative bitmapset member not allowed error in logical repli
@ 2019-11-09 08:17 Peter Eisentraut <peter@eisentraut.org>
  2019-11-09 11:17 ` Re: pgsql: Fix negative bitmapset member not allowed error in logical repli Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Peter Eisentraut @ 2019-11-09 08:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix negative bitmapset member not allowed error in logical replication

This happens when we add a replica identity column on a subscriber
that does not yet exist on the publisher, according to the mapping
maintained by the subscriber.  Code that checks whether the target
relation on the subscriber is updatable would check the replica
identity attribute bitmap with a column number -1, which would result
in an error.  To fix, skip such columns in the bitmap lookup and
consider the relation not updatable.  The result is consistent with
the rule that the replica identity columns on the subscriber must be a
subset of those on the publisher, since if the column doesn't exist on
the publisher, the column set on the subscriber can't be a subset.

Reported-by: Tim Clarke <tim.clarke@minerva.info>
Analyzed-by: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Discussion: https://www.postgresql.org/message-id/flat/a9139c29-7ddd-973b-aa7f-71fed9c38d75%40minerva.info

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1c60e40ad54b18685436443da3c56a7018a35475

Modified Files
--------------
src/backend/replication/logical/relation.c |  3 ++-
src/test/subscription/t/008_diff_schema.pl | 37 ++++++++++++++++++++++++++++--
2 files changed, 37 insertions(+), 3 deletions(-)



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

* Re: pgsql: Fix negative bitmapset member not allowed error in logical repli
  2019-11-09 08:17 pgsql: Fix negative bitmapset member not allowed error in logical repli Peter Eisentraut <peter@eisentraut.org>
@ 2019-11-09 11:17 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Peter Eisentraut @ 2019-11-09 11:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

On 2019-11-09 09:17, Peter Eisentraut wrote:
> Fix negative bitmapset member not allowed error in logical replication

I see that there are timing errors in the tests on the build farm.  I'm 
working on a fix.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





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

* pgsql: Fix negative bitmapset member not allowed error in logical repli
@ 2019-11-09 08:17 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Peter Eisentraut @ 2019-11-09 08:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix negative bitmapset member not allowed error in logical replication

This happens when we add a replica identity column on a subscriber
that does not yet exist on the publisher, according to the mapping
maintained by the subscriber.  Code that checks whether the target
relation on the subscriber is updatable would check the replica
identity attribute bitmap with a column number -1, which would result
in an error.  To fix, skip such columns in the bitmap lookup and
consider the relation not updatable.  The result is consistent with
the rule that the replica identity columns on the subscriber must be a
subset of those on the publisher, since if the column doesn't exist on
the publisher, the column set on the subscriber can't be a subset.

Reported-by: Tim Clarke <tim.clarke@minerva.info>
Analyzed-by: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Discussion: https://www.postgresql.org/message-id/flat/a9139c29-7ddd-973b-aa7f-71fed9c38d75%40minerva.info

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/replication/logical/relation.c |  3 ++-
src/test/subscription/t/008_diff_schema.pl | 37 ++++++++++++++++++++++++++++--
2 files changed, 37 insertions(+), 3 deletions(-)



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

* pgsql: Fix negative bitmapset member not allowed error in logical repli
@ 2019-11-09 08:17 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Peter Eisentraut @ 2019-11-09 08:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix negative bitmapset member not allowed error in logical replication

This happens when we add a replica identity column on a subscriber
that does not yet exist on the publisher, according to the mapping
maintained by the subscriber.  Code that checks whether the target
relation on the subscriber is updatable would check the replica
identity attribute bitmap with a column number -1, which would result
in an error.  To fix, skip such columns in the bitmap lookup and
consider the relation not updatable.  The result is consistent with
the rule that the replica identity columns on the subscriber must be a
subset of those on the publisher, since if the column doesn't exist on
the publisher, the column set on the subscriber can't be a subset.

Reported-by: Tim Clarke <tim.clarke@minerva.info>
Analyzed-by: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Discussion: https://www.postgresql.org/message-id/flat/a9139c29-7ddd-973b-aa7f-71fed9c38d75%40minerva.info

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7961da1887afb04184fd9169dec01870d1003d4a

Modified Files
--------------
src/backend/replication/logical/relation.c |  3 ++-
src/test/subscription/t/008_diff_schema.pl | 37 ++++++++++++++++++++++++++++--
2 files changed, 37 insertions(+), 3 deletions(-)



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

* pgsql: Fix negative bitmapset member not allowed error in logical repli
@ 2019-11-09 08:17 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Peter Eisentraut @ 2019-11-09 08:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix negative bitmapset member not allowed error in logical replication

This happens when we add a replica identity column on a subscriber
that does not yet exist on the publisher, according to the mapping
maintained by the subscriber.  Code that checks whether the target
relation on the subscriber is updatable would check the replica
identity attribute bitmap with a column number -1, which would result
in an error.  To fix, skip such columns in the bitmap lookup and
consider the relation not updatable.  The result is consistent with
the rule that the replica identity columns on the subscriber must be a
subset of those on the publisher, since if the column doesn't exist on
the publisher, the column set on the subscriber can't be a subset.

Reported-by: Tim Clarke <tim.clarke@minerva.info>
Analyzed-by: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Discussion: https://www.postgresql.org/message-id/flat/a9139c29-7ddd-973b-aa7f-71fed9c38d75%40minerva.info

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/replication/logical/relation.c |  3 ++-
src/test/subscription/t/008_diff_schema.pl | 37 ++++++++++++++++++++++++++++--
2 files changed, 37 insertions(+), 3 deletions(-)



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


end of thread, other threads:[~2019-11-09 11:17 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-11-09 08:17 pgsql: Fix negative bitmapset member not allowed error in logical repli Peter Eisentraut <peter@eisentraut.org>
2019-11-09 11:17 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2019-11-09 08:17 pgsql: Fix negative bitmapset member not allowed error in logical repli Peter Eisentraut <peter@eisentraut.org>
2019-11-09 08:17 pgsql: Fix negative bitmapset member not allowed error in logical repli Peter Eisentraut <peter@eisentraut.org>
2019-11-09 08:17 pgsql: Fix negative bitmapset member not allowed error in logical repli Peter Eisentraut <peter@eisentraut.org>

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