
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/
|