[Bucardo-general] MCP PID and automatic syncs

Jon Jensen jon at endpoint.com
Wed Jun 17 19:14:32 UTC 2009

On Wed, 17 Jun 2009, Goran Gugic wrote:

> 1) MCP PID
> I believe that PID written in /var/run/bucardo/bucardo.pid is a wrong one.
> (Consequently also what is reported by bucardo_ctl status for 'PID of
> Bucardo MCP').
> As far as I can read the problem (not very far - I am very new to both
> bucardo and Perl) this is due to the fact that the pid file is created
> before forking in Bucardo.pm (see lines 660, writing to pid file, and then
> on 669 fork which gets a new pid).
> I tried to fix it and only mildy tested it by puting the ## Create a new pid
> file section after the fork section. After this change the status reports
> PID correctly.
> Should I post this (trivial) patch here?

Yes, that would be great. Or you could make a GitHub fork and post it 


> 2) automatic syncs (swap)
> I have also done some work on testing the connections in a way that might be
> interesting - using Net::Ping, the syn variant, which checks if the port at
> dbhost:dbport is open and can be set to timeout very quicky compared to the
> timeout of the connect_database (which for me was at around 3 minutes for
> hosts to which the route has been broken, which is the most common scenario
> that I am trying to address).
> My goal here is to have the syncs go up and down automatically depending on
> the availability of the connections (so that one dropped connection does not
> ruin a day for all the others) and that this works fairly quickly (times
> should be comparable to typical time needed to fix simple connection problem
> on the other end, which is at around 10-30 mins minimum).
> Currently I am working around bucardo_ctl and have a simple daemon that
> pings the secondary masters and if connections go down or up for the syncs
> it manages (syncs which 'should be up') it will stop bucardo, mark their
> status as inactive or active according to the state of the connection to the
> host and start bucardo again.
> This seems to work now and I am wondering - should I leave it to work around
> bucardo_ctl or should I try to integrate with bucardo?

I think that kind of "down link awareness" would be great to have built 
directly into Bucardo. But maybe others can weigh in better than I can on 
how well it would fit into the codebase.


Jon Jensen
End Point Corporation

More information about the Bucardo-general mailing list