[Linux-ha-dev] Re: [Linux-ha-cvs] Linux-HA CVS: lib by sunjd from
Sun Jiang Dong
hasjd at cn.ibm.com
Mon Sep 13 21:20:00 MDT 2004
Alan Robertson wrote:
> Huang Zhen wrote:
>
>> Lars Marowsky-Bree wrote:
>>
>>> On 2004-09-13T10:45:41,
>>> linux-ha-cvs at lists.community.tummy.com said:
>>>
>>>
>>>> linux-ha CVS committal
>>>>
>>>> Author : sunjd
>>>> Host : Project : linux-ha
>>>> Module : lib
>>>>
>>>> Dir : linux-ha/lib/plugins/lrm
>>>>
>>>>
>>>> Modified Files:
>>>> raexecocf.c
>>>>
>>>> Log Message:
>>>> * Export OCF_RESOURCE_INSTANCE before executing an OCF RA * Export
>>>> OCF global environment variables before getting metadata
>>>>
>>>> ===================================================================
>>>> RCS file: /home/cvs/linux-ha/linux-ha/lib/plugins/lrm/raexecocf.c,v
>>>> retrieving revision 1.30
>>>> retrieving revision 1.31
>>>> diff -u -3 -r1.30 -r1.31
>>>> --- raexecocf.c 13 Sep 2004 08:30:51 -0000 1.30
>>>> +++ raexecocf.c 13 Sep 2004 10:45:41 -0000 1.31
>>>> @@ -66,11 +66,13 @@
>>>> #endif
>>>>
>>>> /* The begin of exported function list */
>>>> -static int execra(const char * rsc_type,
>>>> +static int execra(const char * rsc_id,
>>>> + const char * rsc_type,
>>>> const char * provider,
>>>> const char * op_type,
>>>> GHashTable * params);
>>>
>>>
>>>
>>>
>>> Maybe it would be easier by now if we passed in the full lrm_op_t
>>> here...?
>>>
>>> (Just thinking out loud)
>>>
>>>
>>> Sincerely,
>>> Lars Marowsky-Brée <lmb at suse.de>
>>>
>> We want the plugins of RA are independent with LRM. So third party can
>> add other RA class easily.
>
>
> My first reaction to this is that either I disagree or I don't understand.
>
> These plugins are largely for the LRM. By their nature, they're fairly
> specialized for the LRM - aren't aren't likely to be used with some
> other software package besides the LRM.
>
> And, third parties can easily add new RA classes whether the information
> is passed in arguments or the same information is passed in a
> structure. This attribute of the solution is unaffected by this.
>
> Where it does come up to be different is this:
>
> If you have third-parties supplying these resource agents, they are more
> likely to have to be recompiled if the structure changes for reasons
> unrelated to the interface to the plugins. So, the interface between
> the LRM and the RAs will change more often (in effect) if you put the
> whole structure in there. But as the number of elements being passed as
> parameters goes up, the probability of this kind of false interface
> churn goes down, and the balance shifts to the side of preferring to
> pass the whole structure.
>
> On the other hand, it would be a easier to use, including easier to
> initially write 3rd party plugins if the interface had fewer parameters
> to it.
>
> It is rarely an improvement to replace passing a structure with the list
> of variables in that structure passed explicitly.
>
> I suspect that we are unlikely to get many (if any) 3rd party plugins.
> In this case, it's far more likely for us to write them than for someone
> else to do so and package them outside of Linux-HA.
>
It's a good suggestion.
Formerly we just want to make the data structure dependency is single
direction: lrm -> RA plugin, as the single dependency direction on function.
--
BRs,
Sun Jiang Dong
More information about the Linux-HA-Dev
mailing list