[Linux-ha-dev] [PATCH] New heartbeat APIs client_status and cstatus_callback (revised)

Zhu, Yi yi.zhu at intel.com
Tue Mar 9 22:25:54 MST 2004


On Wed, 10 Mar 2004, Alan Robertson wrote:

> I forgot to answer.  Having them coexist is fine.
> 
> However, I don't like mixing the 'current' usage in the
> set_cstatus_callback function.
> 
> Here's why:
> 
> If I were writing code using it, the most probable thing I'd like to ask
> (IMHO) would be to inquire if all of my peer nodes are running my
> service.
> 
> But, with this call you have to time out waiting for a reply, since there
> is no way to tell a given machine which service you're asking about. 
> With
> the "inquire about service x on cluster" call, you would get a message
> from
> from every machine in the cluster - no timeouts required.
> 
> So, I'd rather take the current flag off the call, and add a second call
> to inquire about the status of services - separately.  And that call (or
> calls) can do whatever we decide it should do.
> 
> You could have something like an
>         inquire_client_status(const char * node, const char * service)
> call (choose a good name) which allowed node and/or service to be NULL. 
> If
> you set service to NULL, then you may have to wait for timeouts (like
> your
> current example above).  But if it's not NULL, you will eventually get an
> answer from every node - unless it drops off the network before replying.
> 
> I think your 'current=TRUE' example above can be simulated by calling
> inquire_client_status(NULL,NULL);

Yes. But if we remove the 'current' value in set_cstatus_callback(), we
need to define another set_xxx_callback() function to set user's callback
function for inquire_client_status(NULL,NULL). Since this user's callback
function will be called with the exact same parameters with the client
status changes callback function, I think maybe users can use the same
callback function to handle both events. This is where the 'current' value
comes from. Above information is just in case you didn't notice that. If
you still think it is not clean, I'll modify it according to your opinion.

Thanks,
-yi
> 
> Does this make sense to you?
> 
>         -- Alan Robertson
>            alanr at unix.sh
> 
> 
> 
> --
>      Alan Robertson <alanr at unix.sh>
> 
> "Openness is the foundation and preservative of friendship...  Let me
> claim
> from you at all times your undisguised opinions." - William Wilberforce



More information about the Linux-HA-Dev mailing list