Logical replication from 11.x to 12.x and "unique key violations" - Mailing list pgsql-general

From Thomas Kellerer
Subject Logical replication from 11.x to 12.x and "unique key violations"
Date
Msg-id cfb19a91-e878-6994-4fda-3c64631f72e6@gmx.net
Whole thread Raw
Responses Re: Logical replication from 11.x to 12.x and "unique key violations"
Re: Logical replication from 11.x to 12.x and "unique key violations"
List pgsql-general
Hello,

I have a strange error when using logical replication between a 11.2 (I know!) source database and a 12.3 target.

If I create the publication with all needed tables (about 50) at once, I get "duplicate key value violates unique
constraintxxx_pkey" errors during the initial replication (when creating the subscription). 

When create the publication only with a few tables, the initial data sync works without problems.
To replicate all tables, I add the tables incrementally to the publication, and refresh the subscription.

If I do it like that (step-by-step) everything works fine. Tables that generated the "duplicate key value" error
previouslywill replicate just fine. The tables are quite small, some of them less then 100 rows. 

The table definitions and primary keys are 100% identical between the two systems.

However all tables where this error occurs, have a varchar(100) column as part of the PK definition (don't ask).

The values in the PK columns are 7-bit ASCII only. Both servers are running CentOS 7.x and use UTF-8 as the encoding.

If this was a glibc version issue between the two operating systems, then I would expect the failure to be consistent,
notdepending on the amount of tables for the initial replication. 

I have seen that there were several bugfixes between 11.2 and 11.8 regarding logical replication (including some index
relatedfixes). But I am unsure if they related to 11.2 being the publisher or subscriber 

Could this indeed be caused by the outdated 11.2 on the publisher side?
Is there anything else I could check to identify the root cause?

As I can replicate the tables without problems, this isn't a big issue for me right now, but I would like to know what
theroot cause is. 

Thanks
Thomas



pgsql-general by date:

Previous
From: Ravi Krishna
Date:
Subject: Re: Doubt in mvcc
Next
From: Francisco Olarte
Date:
Subject: Re: Doubt in mvcc