Jan Wieck JanWieck at Yahoo.com
Wed Jun 10 08:04:08 PDT 2009
On 6/1/2009 5:07 AM, Oleg A. Mamontov wrote:
> Hello!
> 
> I am using it on FreeBSD systems for moving PostgreSQL databases between
> servers with minimum downtime, all works fine.
> But when I try to setup permanent master-slave schema some problems  
> occured.
> Some times (accidentally) master system didn't generate sync events,  
> and shutting down
> slon on master systems had long time.
> After debugging session, i found cause of problem (there is two  
> problem, Slony and FreeBSD too).
> IMHO there is a logical mistake in slon/scheduler.c, in sched_mainloop  
> fdsets copied
> for select before checking connections for their timeouts. In timeout  
> case this
> descriptors will be removed with DLLIST_REMOVE and sched_remove_fdset,  
> but stayed in
> select descriptors bit vector.
> There is a race condition: scheduler and libpq client polls same file  
> descriptor and sometime
> scheduler select discover readable descriptor and lipbq poll blocks  
> for infinte time :(
> I tested this on FreeBSD 7.0, trouble repeated in ~60% runs.
> I attach a patch, please, take a look on this code, it seems right,  
> imho...

No need for a test case, Chris. A quick look at the code reveals that 
Oleg is indeed right.

Patch applied.

Good work, thank you.


Jan

-- 
Anyone who trades liberty for security deserves neither
liberty nor security. -- Benjamin Franklin



More information about the Slony1-general mailing list