[Bucardo-general] Initial sync of table added to existing sync

Dan Kasak dkasak at viator.com
Mon Jul 23 08:33:08 UTC 2018


Hi all.

I'm trying to automate dealing with schema changes on a 'master'
instance. I'm pretty close ... and hopefully I'll get the all-clear to
open-source what I've done ( should be fine ). My solution involves
dropping and re-adding the table on the target and in bucardo. Change
detection is working great. Anyway, the last part ... adding a table to
a sync ( after it possibly being removed ... or possibly being the 1st
time bucardo has seen it ):

---

echo "Add table ["${NEW_TABLE}"] to database ["${SOURCE_DATABASE}"]"
bucardo add table public.$NEW_TABLE db=${SOURCE_DATABASE}_source
herd=${SOURCE_DATABASE}_tables_herd

bucardo update sync ${SOURCE_DATABASE}_sync onetimecopy=2

bucardo reload ${SOURCE_DATABASE}_sync

---

Now ... my understanding is that updating the sync with "onetimecopy=2"
is supposed to trigger a full sync of *only* tables that are empty in
the target. The problem is ... while I've seen this work sometimes, I've
also seen it *not* work ( and this is more common ). What *does* work is
changing it to "onetimecopy=1" - but this causes a flurry of deletes of
*all* tables that then get re-synced. It's too much of an interruption
for a production system.

So ... how do I diagnose why onetimecopy=2 is not working? I've cranked
up the verbosity of the log, and grepped it for my table. I don't see
anything of use:

(7134) [Sun Jul 22 23:10:40 2018] KID (prod_accounting_sync) Kid 7134
exiting at cleanup_kid. Sync "prod_accounting_sync" public.dan_rocks
Reason: Stop sync request at /usr/share/perl5/vendor_perl/Bucardo.pm
line 3122. Line: 5001
(5903) [Sun Jul 22 23:10:42 2018] MCP   Inspecting source table
"public.dan_rocks" on database "prod_accounting_source"
(5903) [Sun Jul 22 23:10:42 2018] MCP   Set conflict strategy for
public.dan_rocks to "bucardo_latest"
(5903) [Sun Jul 22 23:10:42 2018] MCP    Inspecting target table
"public.dan_rocks" on database "prod_accounting_destination"
(7773) [Sun Jul 22 23:10:51 2018] KID (prod_accounting_sync) Analyze
complete for prod_accounting_destination.public.dan_rocks. Time: 7.79
(7806) [Sun Jul 22 23:10:55 2018] KID (prod_accounting_sync) Delta count
for prod_accounting_source.public.dan_rocks                      :  0
(7806) [Sun Jul 22 23:11:20 2018] KID (prod_accounting_sync) Delta count
for prod_accounting_source.public.dan_rocks                      : 0
(7806) [Sun Jul 22 23:11:35 2018] KID (prod_accounting_sync) Delta count
for prod_accounting_source.public.dan_rocks                      :  0
(7806) [Sun Jul 22 23:11:36 2018] KID (prod_accounting_sync) Delta count
for prod_accounting_source.public.dan_rocks                      : 0
(7806) [Sun Jul 22 23:12:00 2018] KID (prod_accounting_sync) Delta count
for prod_accounting_source.public.dan_rocks                      :  0

So ... No indication of why the table would get skipped for a
onetimesync. But the target has 0 records and the source has 3.

Any ideas?

Thanks.

Dan



More information about the Bucardo-general mailing list