[Bucardo-general] Patch: fix quoted table/index names

Sean M. Pappalardo spappalardo at renegadetech.com
Sat Nov 12 07:21:30 UTC 2011

Hello again.

On 11/11/2011 05:15 AM, Greg Sabino Mullane wrote:
> I'm not sure how I see this fixes the problem you described. The
> code was wrapping the index in double quotes if it contained
> any quote or space characters.

What was happening is that the field was being wrapped twice: once by 
the qq{} and once by the quotes around the variable, causing an error 
when Perl tried to parse ""foo_bar_Table name_txn""

>> I also couldn't get the .pgpass to work so was forced to use pass=
>> in the add db command.
> That's unfortunate: could you get the .pgpass to work from psql?

I haven't tried. I'm under the gun to finish this project so I'm fine 
with specifying the password manually for now.

Speaking of passwords, that's another problem: I have to specify 
-dbpass=<bucardo password> on every invocation of bucardo_ctl or I get 
an error:

DBI connect('dbname=bucardo','bucardo',...) failed: fe_sendauth: no 
password supplied at /usr/local/bin/bucardo_ctl line 194

(I'm using md5 auth for the bucardo user.)

>> Right now the main problem is that I ran a pushdelta sync and
>> nothing changed on the target! Is there a log somewhere I can look
>> to see what (didn't) happen?
> Yes: there should be a log.bucardo file created from wherever you
> started Bucardo from. That should have some very copious
> logging to wade through.

When I looked there, it just showed that there were 0 changes. I added a 
fullcopy sync and that shows a large number of changes and seems to work 
correctly. However, I just added a swap sync (the one I really need) and 
it gives me this error:

KID Kid exiting at cleanup_kid. Reason: DBD::Pg::db do failed: ERROR: 
permission denied to set parameter "session_replication_role" at 
/usr/local/share/perl/5.10.1/Bucardo.pm line 4061.
  main error: none source error: 7 target error: none States:/42501/

And your response I found in the archives:

> The connecting user must be a superuser, not just the owner of the
> database, so that it can adjust this setting and (in lesser versions of
> Postgres) manipulate the system catalogs directly. I'll look into adding
> an explicit superuser check during startup for a better (and earlier) error
> message.

But which user are we talking about here? The Linux user running the 
bucardo_ctl script, the Bucardo DB user, the user for the source 
DB/herd, or the one for the target DB? (After messing around a bit, I 
got it to proceed having the source and target DB connecting users set 
to superuser.)

But now I get this:
KID Total source delta count: 84
KID Total target delta count: 154
KID Total delta count: 238
KID No conflict, target only for "Schema1"."TableA"."ID": 22
KID No conflict, target only for "Schema1"."TableA"."ID": 21
KID No conflict, target only for "Schema1"."TableA"."ID": 24
KID No conflict, target only for "Schema1"."TableA"."ID": 23
KID No conflict, target only for "Schema1"."TableA"."ID": 15
KID Action summary: 2:5
KID [1/5] "Schema1"."TableA" UPDATE target to source pk 15
CTL Rows updated child 16461 to aborted in q: 1
CTL Warning! Kid 16461 seems to have died. Sync "ProdSync"

It tries again but fails. The source DB log just shows:
EST LOG:  could not receive data from client: Connection reset by peer
EST LOG:  unexpected EOF on client connection

And the target (where the changes actually are) only shows:
CET LOG:  unexpected EOF on client connection
CET LOG:  unexpected EOF on client connection

FWIW, I'm using a local connection to the target and an ssl connection 
to the source.

This is currently blocking me from completing this now time-sensitive 

Also, I thought I specified all of my syncs to be manual but when I 
start the Bucardo service, it tries to run some of them I didn't ask 
for, so I had to delete all but the one I want to run (swap,) since one 
of the others was a fullcopy.

> You might also try out Bucardo 5 and see how many of this issues
> have been addressed there.

I was going to, but the beta-not-for-production notice scared me away 
since I'm working on a production DB.

Sean M. Pappalardo
Sr. Networks Engineer
Renegade Technologies
spappalardo at renegadetech.com
Office: (630) 631-6188
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spappalardo.vcf
Type: text/x-vcard
Size: 333 bytes
Desc: not available
Url : https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20111112/07a48665/attachment.vcf 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4559 bytes
Desc: S/MIME Cryptographic Signature
Url : https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20111112/07a48665/attachment.bin 

More information about the Bucardo-general mailing list