Hi,

On Fri, Dec 10, 2010 at 12:33:55PM +0100, Andrew Beekhof wrote:
> On Fri, Dec 10, 2010 at 12:31 PM,  <[email protected]> wrote:
> >> >
> >> >> No Section:
> >> >> Is there a reason, why the environment variable
> >> >> 'OCF_RESKEY_CRM_meta_role', which is set in the monitor action,
> >> >> isn't mentioned anywhere ?
> >> >
> >> > Make a good case for it to be explained, and convince me that it won't
> >> > just serve to confuse everybody, and I'll include it. My best guess,
> >> > however, is that once I do include it, we'll see a lot of
> >> >
> >> > monitor() {
> >> >  if [ "$OCF_RESKEY_CRM_meta_role" = "Master" ]; then
> >> >    return $OCF_RUNNING_MASTER
> >> >  fi
> >> >  ...
> >> > }
> >> >
> >> > ... and that's clearly nonsense.
> >>
> >> And a good way to ensure i strip it from the environment :-)
> >
> > OK, I'll try to convince you :
> >
> > Having the variable in the environment and not naming it's meanings
> > in the guide, will lead exactly to what you can read above. I think
> > others could came to the same conclusions.
> >
> > Second my example, why it might be usefull:
> >
> > monitor() |
> >   if [ "$OCF_RESKEY_CRM_meta_role" = "Master" ]; then
> >     monitor_master()
> >     [ $? -eq $OCF_SUCCESS ] && return $OCF_RUNNING_MASTER
> >     monitor_slave()
> >     return $?
> >   else
> >     monitor_slave()
> >     [ $? -eq $OCF_SUCCESS ] && return $OCF_SUCCESS
> >     monitor_master()
> >     [ $? -eq $OCF_SUCCESS ] && return $OCF_RUNNING_MASTER
> >     return $?
> >   fi
> > }
> >
> > (Yes, you might write this even shorter, but it might be more
> >  understandable what I mean this way.)
> >
> > The point is: If monitoring is quite expensive, in some resource
> > agents it might make sense to try the expected status first.
> 
> Thats what OCF_CHECK_LEVEL is for.

The depth (OCF_CHECK_LEVEL) should refer not to different roles,
but various monitor depths for whatever role the resource
instance currently run.

> The above would be frowned upon.

Agreed. The RA should be able to tell.

Thanks,

Dejan

> >
> > Cheers,
> > Alex
> >
> > _______________________________________________________
> > Linux-HA-Dev: [email protected]
> > http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> > Home Page: http://linux-ha.org/
> >
> >
> _______________________________________________________
> Linux-HA-Dev: [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
_______________________________________________________
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