Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Dev

[Patch 3]Change avoiding the stop error of the mysql resource agent.

 

 

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded


renayama19661014 at ybb

Aug 30, 2011, 1:20 AM

Post #1 of 10 (543 views)
Permalink
[Patch 3]Change avoiding the stop error of the mysql resource agent.

Hi,

When a process of mysql falls just after the check of the pid file of monitor, the mysql resource agent causes an error by a stop.

This is caused by the fact that a resource agent checks pid of the mysql process that fell at the time of a stop.
The resource agent should check the effectiveness of the pid file before a check again.

I send a patch.

Please examine this patch.


Best Regards,
Hideo Yamauchi.
Attachments: mysql.1651-3.patch (0.44 KB)


renayama19661014 at ybb

Sep 11, 2011, 6:19 PM

Post #2 of 10 (507 views)
Permalink
Re: [Patch 3]Change avoiding the stop error of the mysql resource agent. [In reply to]

Hi Raoul,

How about the modified patch of this place?

Best Regards,
Hidoe Yamauchi.

--- On Tue, 2011/8/30, renayama19661014 [at] ybb <renayama19661014 [at] ybb> wrote:

> Hi,
>
> When a process of mysql falls just after the check of the pid file of monitor, the mysql resource agent causes an error by a stop.
>
> This is caused by the fact that a resource agent checks pid of the mysql process that fell at the time of a stop.
> The resource agent should check the effectiveness of the pid file before a check again.
>
> I send a patch.
>
> Please examine this patch.
>
>
> Best Regards,
> Hideo Yamauchi.
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


r.bhatia at ipax

Sep 14, 2011, 5:47 AM

Post #3 of 10 (493 views)
Permalink
Re: [Patch 3]Change avoiding the stop error of the mysql resource agent. [In reply to]

Hi Hideo-san!


On 09/12/2011 03:19 AM, renayama19661014 [at] ybb wrote:
> Hi Raoul,
>
> How about the modified patch of this place?

unfortunatly, i'm currently a little swamped.
i'll look into that asap. please bear with me a little longer!

thanks,
raoul
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


renayama19661014 at ybb

Sep 14, 2011, 2:33 PM

Post #4 of 10 (489 views)
Permalink
Re: [Patch 3]Change avoiding the stop error of the mysql resource agent. [In reply to]

Hi Raoul,

Thank you for comment.
I wait for your result.

Best Regards,
Hideo Yamauchi.

--- On Wed, 2011/9/14, Raoul Bhatia [IPAX] <r.bhatia [at] ipax> wrote:

> Hi Hideo-san!
>
>
> On 09/12/2011 03:19 AM, renayama19661014 [at] ybb wrote:
> > Hi Raoul,
> >
> > How about the modified patch of this place?
>
> unfortunatly, i'm currently a little swamped.
> i'll look into that asap. please bear with me a little longer!
>
> thanks,
> raoul
>
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


r.bhatia at ipax

Sep 19, 2011, 10:50 AM

Post #5 of 10 (467 views)
Permalink
Re: [Patch 3]Change avoiding the stop error of the mysql resource agent. [In reply to]

hello hideo-san!

On 08/30/2011 10:20 AM, renayama19661014 [at] ybb wrote:
> Hi,
>
> When a process of mysql falls just after the check of the pid file of monitor, the mysql resource agent causes an error by a stop.
>
> This is caused by the fact that a resource agent checks pid of the mysql process that fell at the time of a stop.
> The resource agent should check the effectiveness of the pid file before a check again.

...
> diff -r cb5f9b84cc5f heartbeat/mysql
> --- a/heartbeat/mysql Wed Aug 31 01:38:15 2011 +0900
> +++ b/heartbeat/mysql Wed Aug 31 01:38:55 2011 +0900
> @@ -897,9 +897,10 @@
> $CRM_MASTER -D
> fi
>
> - if [ ! -f $OCF_RESKEY_pid ]; then
> - ocf_log info "MySQL is not running"
> - return $OCF_SUCCESS
> + mysql_status info
> + rc=$?
> + if [ $rc = $OCF_NOT_RUNNING ]; then
> + return $OCF_SUCCESS
> fi
>
> pid=`cat $OCF_RESKEY_pid 2> /dev/null `

i'm sorry but i do not understand the problem you're addressing.
can you please describe with different words?

thanks,
raoul
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


renayama19661014 at ybb

Sep 19, 2011, 5:19 PM

Post #6 of 10 (465 views)
Permalink
Re: [Patch 3]Change avoiding the stop error of the mysql resource agent. [In reply to]

Hi Raoul,

Thank you for comment.

> > diff -r cb5f9b84cc5f heartbeat/mysql
> > --- a/heartbeat/mysql Wed Aug 31 01:38:15 2011 +0900
> > +++ b/heartbeat/mysql Wed Aug 31 01:38:55 2011 +0900
> > @@ -897,9 +897,10 @@
> > $CRM_MASTER -D
> > fi
> >
> > - if [ ! -f $OCF_RESKEY_pid ]; then
> > - ocf_log info "MySQL is not running"
> > - return $OCF_SUCCESS
> > + mysql_status info
> > + rc=$?
> > + if [ $rc = $OCF_NOT_RUNNING ]; then
> > + return $OCF_SUCCESS
> > fi
> >
> > pid=`cat $OCF_RESKEY_pid 2> /dev/null `
>
> i'm sorry but i do not understand the problem you're addressing.
> can you please describe with different words?

Sorry....

For example, mysql fails in stop processing and causes an error when the next trouble happens.

Step1 ) For example, for switch over, stop handling of Mysql begins.
Step2 ) However, Mysql fell by process trouble just after that. The pid file is left.
Step3 ) When pid file is left by the current stop processing, an error happens.

* The stop processing is finished normally by checking pid file and the existence of the process by this patch definitely.
* And the switch over excess succeeds.

Best Regards,
Hideo Yamauchi.



--- On Tue, 2011/9/20, Raoul Bhatia [IPAX] <r.bhatia [at] ipax> wrote:

> hello hideo-san!
>
> On 08/30/2011 10:20 AM, renayama19661014 [at] ybb wrote:
> > Hi,
> >
> > When a process of mysql falls just after the check of the pid file of monitor, the mysql resource agent causes an error by a stop.
> >
> > This is caused by the fact that a resource agent checks pid of the mysql process that fell at the time of a stop.
> > The resource agent should check the effectiveness of the pid file before a check again.
>
> ...
> > diff -r cb5f9b84cc5f heartbeat/mysql
> > --- a/heartbeat/mysql    Wed Aug 31 01:38:15 2011 +0900
> > +++ b/heartbeat/mysql    Wed Aug 31 01:38:55 2011 +0900
> > @@ -897,9 +897,10 @@
> >       $CRM_MASTER -D
> >       fi
> >
> > -    if [ ! -f $OCF_RESKEY_pid ]; then
> > -    ocf_log info "MySQL is not running"
> > -        return $OCF_SUCCESS
> > +    mysql_status info
> > +    rc=$?
> > +    if [ $rc = $OCF_NOT_RUNNING ]; then
> > +       return $OCF_SUCCESS
> >       fi
> >
> >       pid=`cat $OCF_RESKEY_pid 2>  /dev/null `
>
> i'm sorry but i do not understand the problem you're addressing.
> can you please describe with different words?
>
> thanks,
> raoul
>
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


r.bhatia at ipax

Sep 20, 2011, 2:21 AM

Post #7 of 10 (461 views)
Permalink
Re: [Patch 3]Change avoiding the stop error of the mysql resource agent. [In reply to]

hello hideo-san!

On 09/20/2011 02:19 AM, renayama19661014 [at] ybb wrote:
...
>>> - if [ ! -f $OCF_RESKEY_pid ]; then
>>> - ocf_log info "MySQL is not running"
>>> - return $OCF_SUCCESS
>>> + mysql_status info
>>> + rc=$?
>>> + if [ $rc = $OCF_NOT_RUNNING ]; then
>>> + return $OCF_SUCCESS
>>> fi
...

>> i'm sorry but i do not understand the problem you're addressing.
>> can you please describe with different words?
>
> Sorry....
>
> For example, mysql fails in stop processing and causes an error when the next trouble happens.
>
> Step1 ) For example, for switch over, stop handling of Mysql begins.
> Step2 ) However, Mysql fell by process trouble just after that. The pid file is left.
> Step3 ) When pid file is left by the current stop processing, an error happens.
>
> * The stop processing is finished normally by checking pid file and the existence of the process by this patch definitely.
> * And the switch over excess succeeds.

ok, but why do you ommit the check if the pidfile exists and then cat
this very file. if you cat a non existing file, you'll get errors.
basically, the ra does the following:

> kill `cat /tmp/mysql.pid 2>/dev/null` > /dev/null; echo $?
> kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
> 1

so the ra will exit with:
> ocf_log err "MySQL couldn't be stopped"
> return $OCF_ERR_GENERIC

shouldn't the following patch be enough
(just adding the mysql_status check but not removing the pid check?)

> diff --git a/heartbeat/mysql b/heartbeat/mysql
> index e449de4..474f62e 100755
> --- a/heartbeat/mysql
> +++ b/heartbeat/mysql
> @@ -898,6 +898,12 @@ mysql_stop() {
> $CRM_MASTER -D
> fi
>
> + mysql_status info
> + rc=$?
> + if [ $rc = $OCF_NOT_RUNNING ]; then
> + return $OCF_SUCCESS
> + fi
> +
> if [ ! -f $OCF_RESKEY_pid ]; then
> ocf_log info "MySQL is not running"
> return $OCF_SUCCESS

cheers,
raoul
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


renayama19661014 at ybb

Sep 20, 2011, 5:28 PM

Post #8 of 10 (461 views)
Permalink
Re: [Patch 3]Change avoiding the stop error of the mysql resource agent. [In reply to]

Hi Raoul,

Thank you for comment.

> ok, but why do you ommit the check if the pidfile exists and then cat
> this very file. if you cat a non existing file, you'll get errors.
> basically, the ra does the following:
>
> > kill `cat /tmp/mysql.pid 2>/dev/null` > /dev/null; echo $?
> > kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
> > 1
>
> so the ra will exit with:
> > ocf_log err "MySQL couldn't be stopped"
> > return $OCF_ERR_GENERIC

However, it is not necessary for the stop to become the error because mysql falls.
The error of the stop restrains FO in some cases.
* The similar processing to this problem is carried out in pgsql.

> shouldn't the following patch be enough
> (just adding the mysql_status check but not removing the pid check?)
>
> > diff --git a/heartbeat/mysql b/heartbeat/mysql
> > index e449de4..474f62e 100755
> > --- a/heartbeat/mysql
> > +++ b/heartbeat/mysql
> > @@ -898,6 +898,12 @@ mysql_stop() {
> > $CRM_MASTER -D
> > fi
> >
> > + mysql_status info
> > + rc=$?
> > + if [ $rc = $OCF_NOT_RUNNING ]; then
> > + return $OCF_SUCCESS
> > + fi
> > +
> > if [ ! -f $OCF_RESKEY_pid ]; then
> > ocf_log info "MySQL is not running"
> > return $OCF_SUCCESS

No.
Because it repeats with status processing, it should delete it that RA checks pid file.

- if [ ! -f $OCF_RESKEY_pid ]; then
- ocf_log info "MySQL is not running"
- return $OCF_SUCCESS
+ mysql_status info
+ rc=$?
+ if [ $rc = $OCF_NOT_RUNNING ]; then
+ return $OCF_SUCCESS
fi


Sorry...My understanding to your comment may be wrong.


Best Regards,
Hideo Yamauchi.


--- On Tue, 2011/9/20, Raoul Bhatia [IPAX] <r.bhatia [at] ipax> wrote:

> hello hideo-san!
>
> On 09/20/2011 02:19 AM, renayama19661014 [at] ybb wrote:
> ...
> >>> -    if [ ! -f $OCF_RESKEY_pid ]; then
> >>> -    ocf_log info "MySQL is not running"
> >>> -        return $OCF_SUCCESS
> >>> +    mysql_status info
> >>> +    rc=$?
> >>> +    if [ $rc = $OCF_NOT_RUNNING ]; then
> >>> +       return $OCF_SUCCESS
> >>>        fi
> ...
>
> >> i'm sorry but i do not understand the problem you're addressing.
> >> can you please describe with different words?
> >
> > Sorry....
> >
> > For example, mysql fails in stop processing and causes an error when the next trouble happens.
> >
> > Step1 ) For example, for switch over, stop handling of Mysql begins.
> > Step2 ) However, Mysql fell by process trouble just after that. The pid file is left.
> > Step3 ) When pid file is left by the current stop processing, an error happens.
> >
> >   * The stop processing is finished normally by checking pid file and the existence of the process by this patch definitely.
> >   * And the switch over excess succeeds.
>
> ok, but why do you ommit the check if the pidfile exists and then cat
> this very file. if you cat a non existing file, you'll get errors.
> basically, the ra does the following:
>
> > kill `cat /tmp/mysql.pid 2>/dev/null` > /dev/null; echo $?
> > kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
> > 1
>
> so the ra will exit with:
> >         ocf_log err "MySQL couldn't be stopped"
> >         return $OCF_ERR_GENERIC
>
> shouldn't the following patch be enough
> (just adding the mysql_status check but not removing the pid check?)
>
> > diff --git a/heartbeat/mysql b/heartbeat/mysql
> > index e449de4..474f62e 100755
> > --- a/heartbeat/mysql
> > +++ b/heartbeat/mysql
> > @@ -898,6 +898,12 @@ mysql_stop() {
> >         $CRM_MASTER -D
> >      fi
> >
> > +    mysql_status info
> > +    rc=$?
> > +    if [ $rc = $OCF_NOT_RUNNING ]; then
> > +       return $OCF_SUCCESS
> > +    fi
> > +
> >      if [ ! -f $OCF_RESKEY_pid ]; then
> >         ocf_log info "MySQL is not running"
> >          return $OCF_SUCCESS
>
> cheers,
> raoul
>
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


r.bhatia at ipax

Sep 21, 2011, 12:55 AM

Post #9 of 10 (457 views)
Permalink
Re: [Patch 3]Change avoiding the stop error of the mysql resource agent. [In reply to]

hello hideo-san!

On 09/21/2011 02:28 AM, renayama19661014 [at] ybb wrote:
> No.
> Because it repeats with status processing, it should delete it that RA checks pid file.
>
> - if [ ! -f $OCF_RESKEY_pid ]; then
> - ocf_log info "MySQL is not running"
> - return $OCF_SUCCESS
> + mysql_status info
> + rc=$?
> + if [ $rc = $OCF_NOT_RUNNING ]; then
> + return $OCF_SUCCESS
> fi

thanks for clearing this for me!
i've commited your change:

https://github.com/raoulbhatia/resource-agents/commit/d828b7f91abff87e930b11097e6543e2bdc87023

thank you for your contribution!
raoul
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


renayama19661014 at ybb

Sep 21, 2011, 1:38 AM

Post #10 of 10 (456 views)
Permalink
Re: [Patch 3]Change avoiding the stop error of the mysql resource agent. [In reply to]

Hi Raoul,

> thanks for clearing this for me!
> i've commited your change:
>
> https://github.com/raoulbhatia/resource-agents/commit/d828b7f91abff87e930b11097e6543e2bdc87023
>
> thank you for your contribution!

Many thanks!!

Best Regards,
Hideo Yamauchi.



--- On Wed, 2011/9/21, Raoul Bhatia [IPAX] <r.bhatia [at] ipax> wrote:

> hello hideo-san!
>
> On 09/21/2011 02:28 AM, renayama19661014 [at] ybb wrote:
> > No.
> > Because it repeats with status processing, it should delete it that RA checks pid file.
> >
> > -    if [ ! -f $OCF_RESKEY_pid ]; then
> > -    ocf_log info "MySQL is not running"
> > -        return $OCF_SUCCESS
> > +    mysql_status info
> > +    rc=$?
> > +    if [ $rc = $OCF_NOT_RUNNING ]; then
> > +       return $OCF_SUCCESS
> >        fi
>
> thanks for clearing this for me!
> i've commited your change:
>
> https://github.com/raoulbhatia/resource-agents/commit/d828b7f91abff87e930b11097e6543e2bdc87023
>
> thank you for your contribution!
> raoul
>
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.