Florian,

is_slave implements 2 different checks:

1. without a parameter
check if the I/O or SQL threads are running. If either is running, this 
machine is configured as slave

2. with parameter
check if both I/O and SQL threads are running. If both are not running, this 
machine is a slave but not running as one so we should not finish with 
$OCF_SUCCESS.

For mysql_demote        the parameter actually defines that the function is 
called 
from the notify and we should check the CRM_meta_notify_demote_uname.

But both, is_slave and mysql_demote have bugs :)

is_slave is using slave_user which is not defined and should use master_user 
instead.
mysql_demote should not return $OCF_ERR_GENERIC when the hostname doesn't 
match, it should return $OCF_SUCCESS. Since this will finish the notify and 
will not stop the resource.

I'm currently testing the changes, when I'm finished I'll send you the patches. 
Meanwhile if you have any comments, please share them :)

Marian

On Tuesday 02 March 2010 18:41:22 Florian Haas wrote:
> Marian,
> 
> can you please explain what you are trying to achieve with is_slave()
> and mysql_demote() acting differently depending on whether they are
> invoked as "is_slave | mysql_demote 1" vs. just "is_slave | mysql_demote"?
> 
> Thanks.
> 
> Cheers,
> Florian
> 
> On 03/02/2010 02:00 AM, Marian Marinov wrote:
> > I have introduced preference points calculation based on the log
> > position. I haven't tested the points, they will need some ajustments and
> > I have to test some situatiations which will be problematic for points
> > calclulation. I have fixed a problem that I introduced into is_slave
> > function when I was removing the bashisms. I'll finish the set readonly
> > patch tomorrow and commit it after that.
> >
> > Best regards,
> > Marian
> 

-- 
Best regards,
Marian Marinov

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to