[Bucardo-general] How to add tables to existing sync with 5.4.1?

Erik Jones mage2k at gmail.com
Wed Dec 30 20:18:52 UTC 2015


Using 5.4.1.

What is the proper way to add new tables to an existing sync, ensuring that
it gets it's copy.  For example, say I'm using pgbench (with a pkey added
to pgbench_history for simplicity's sake) for a test, here's what I've got
right now that isn't working:

1. Set up both dbs, named test1 and test2 (data in test1, just schema in
test2)

`bucardo add db test1 dbname=pgbench host= ...`
`bucardo add db test2 dbname=pgbench host= ...`

2. I'll initially set up and sync just two tables (although pgbench_history
is empty):

`bucardo add table pgbench_tellers relgroup=testgroup`
`bucardo add table pgbench_history relgroup=testgroup`

3. Create and kick off the sync with onetimecopy=2

`bucardo add sync testsync relgroup=testgroup dbs=test1:source,test2:target
onetimecopy=2`
`bucardo start`

Watching the logs and checking pgbench_tellers on test2 I see that they get
copied over.

4. Now, say I want to add pgbench_accounts, which I have set up with 20K
rows:

`bucardo add table pgbench_accounts relgroup=testgroup`
`bucardo update sync testsync onetimecopy=2`
`bucardo reload`

5. Looking at the logs I see that the table is scanned and added to the
sync but no copy happens. If I kick it:

`bucardo kick testsync`

then the logs (with log_level=debug) show this:

---
(6989) [Wed Dec 30 20:13:35 2015] VAC Running bucardo_purge_delta on
database "testy1"
(6989) [Wed Dec 30 20:13:35 2015] VAC Finish and fetch bucardo_purge_delta
on database "testy1"
(6989) [Wed Dec 30 20:13:35 2015] VAC Purge on db "testy1" gave: Tables
processed: 3
(6984) [Wed Dec 30 20:14:03 2015] MCP Got NOTICE kick_sync_testsync from
9893 (line 982)
(6984) [Wed Dec 30 20:14:03 2015] MCP Sending NOTIFY "ctl_kick_testsync"
(line 1390) skip_commit=0
(6984) [Wed Dec 30 20:14:03 2015] MCP Sent a kick to controller 8665 for
sync "testsync"
(8665) [Wed Dec 30 20:14:04 2015] CTL Got NOTICE kick_testsync from 6985
(Bucardo DB) (line 2196)
(8665) [Wed Dec 30 20:14:04 2015] CTL Sending NOTIFY "kid_run_testsync"
(line 2400) skip_commit=0
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Got NOTICE run_testsync
from 8666 (Bucardo DB) (line 3110)
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Adding entry to syncrun
table
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Populating the dbrun table
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Adding note to the syncrun
table
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Doing final maindbh commit
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Set database "testy1" to
repeatable read read write
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Set database "testy2" to
repeatable read read write
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) For fullcopy, we are using
source database "testy1"
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Target table
"testy2.public.pgbench_tellers" has rows and we are in onetimecopy if empty
mode, so we will not COPY
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Source table
"testy1.public.pgbench_history" has no rows and we are in onetimecopy if
empty mode, so we will not COPY
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Setting push_rows to
fullcopy mode
Use of uninitialized value in concatenation (.) or string at
/usr/lib64/perl5/site_perl/5.12.4/Bucardo.pm line 4657.
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Total target rows deleted:
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Total target rows copied: 0
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Issuing final commit for
all databases
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) All databases committed
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Total time for sync
"testsync" (0 rows, 0 tables): 0.02 seconds
---

Note, in particular, this:

```
(8668) [Wed Dec 30 20:14:04 2015] KID (testsync) Setting push_rows to
fullcopy mode
Use of uninitialized value in concatenation (.) or string at
/usr/lib64/perl5/site_perl/5.12.4/Bucardo.pm line 4657.
```

Is that the problem or am I simply doing something wrong or missing a step?

-- 
Erik Jones
mage2k at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20151230/38c7bf69/attachment.html>


More information about the Bucardo-general mailing list