[Bucardo-general] Replication isn't working and status all gives a persistent error that doesn't match the state of the replicated databases

Jeff Silverman jsilverman at blispay.com
Wed Feb 7 22:01:00 UTC 2018

Hi. We have a master/slave replication set up. It was working well until
this morning, when I added some new tables. The error I'm getting makes no
sense to us though.

# bucardo status all
Last good                : Feb 07, 2018 16:05:04 (time to run: 1s)
Rows deleted/inserted    : 1 / 2
Last bad                 : May 08, 2017 16:57:40 (time until fail: 10s)
Sync name                : oltpdb_to_olapdw_sync
Current state            : Good
Source relgroup/database : oltpdb_relgroup / oltpdb
Tables in sync           : 143
Status                   : Active
Check time               : None
Overdue time             : 00:00:00
Expired time             : 00:00:00
Stayalive/Kidsalive      : Yes / Yes
Rebuild index            : No
Autokick                 : Yes
Onetimecopy              : No
Post-copy analyze        : Yes
Last error:              : Failed : DBD::Pg::db pg_putcopyend failed:
ERROR:  duplicate key value violates unique constraint
DETAIL:  Key (merchant_id)=(d649d732-cd1e-47db-b327-b5f190259866) already
CONTEXT:  COPY merchant_fraud_data, line 1 at
/usr/local/share/perl/5.18.2/Bucardo.pm line 9879. Line: 5041 Main DB
state: ? Error: none DB olapdb state: 23505 Error: 7 DB oltpdb state: ?
Error: none  (KID 14206)

The error "Key (merchant_id)=(d649d732-cd1e-47db-b327-b5f190259866) already
exists" doesn't make sense for several reasons:

1) The tables I added this morning do not have this column, or this
2) The table that is actually mentioned, 'merchant_fraud_data', has zero
rows in both master and slave
3) When I removed the constraint from the slave, i.e. ALTER TABLE...DROP
CONSTRAINT..., and tried to resume bucardo sync, the error persists
4) The value of this key isn't anywhere in the master database. (i.e. this
key is a FK for the 'merchants' table but that table does not have a row
with that PK)

How can I clear this error? Or otherwise convince bucardo that everything
is ok?

Thank you,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20180207/16691b0f/attachment.html>

More information about the Bucardo-general mailing list