On 06/14/2011 06:05 PM, Lars Ellenberg wrote:
> On Tue, Jun 14, 2011 at 05:45:21PM +0200, Raoul Bhatia [IPAX] wrote:
>> this caused errors for the initial probe, so i did the following change:
>>
>>> LSB_STATUS_STOPPED=3
>>> if [ $ret -ne $OCF_SUCCESS ] || ocf_is_probe; then
>> (see the new ocf_is_probe?)
>>> case $1 in
>>>     stop) exit $OCF_SUCCESS ;;
>>>     monitor) exit $OCF_NOT_RUNNING;;
>>>     status) exit $LSB_STATUS_STOPPED;;
>>>     *) exit $ret;;
>>>     esac
>>> fi
>>
>> so we always enter this case in the event of a probe. this correctly
>> handles the initial probe and returns OCF_NOT_RUNNING so that pacemaker
>> can continue.
>>
>>
>> *but* the command "crm resource reprobe" is also considered a
>> ocf_is_probe. thus, this block will return a OCF_NOT_RUNNING on *every*
>> node. the standby node *not* running postfix (which is ok) but also
>> on the node which actually *is* running postfix. (and it would also
>> return OCF_NOT_RUNNING if postfix was started at system bootup...)
>>
>> this lets the cluster believe the resource is not running and - because
>> of my configuration - the resource will be (re)started on the last
>> known location/node (which in fact is still running postfix).
>>
>> i hope i managed to explain it properly. :)
> 
> Yep.
> That code is clearly broken.
> 
> A probe (regardless of "initial", "manual" or for whatever reason) has
> to correctly report the current status.  Your probe always returns "not
> running".

of course i know that but i didn't know how to properly fix that ;)
the above code is a result from the initial postfix ra release which i
based on another working ra.

anyways, i think i now found the solution [1] and i also added a ocft
test case for that [2].

so i think this ra is ready for review!

thanks for your help,
raoul

[1]
https://github.com/raoulbhatia/resource-agents/commit/eebb9c07cd2807c7ca67890efc040efcf3206bd1
[2]
https://github.com/raoulbhatia/resource-agents/commit/eb2f1de8341f8a29b7894173f54bd7a540f5568d
-- 
____________________________________________________________________
DI (FH) Raoul Bhatia M.Sc.          email.          [email protected]
Technischer Leiter

IPAX - Aloy Bhatia Hava OG          web.          http://www.ipax.at
Barawitzkagasse 10/2/2/11           email.            [email protected]
1190 Wien                           tel.               +43 1 3670030
FN 277995t HG Wien                  fax.            +43 1 3670030 15
____________________________________________________________________
_______________________________________________________
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