[jboss-dev-forums] [Design of Clustering on JBoss (Clusters/JBoss)] - JBAS-4919 - ha singletons in heterogenous topologies

galder.zamarreno@jboss.com do-not-reply at jboss.com
Tue Jan 15 08:21:52 EST 2008


Re: http://jira.jboss.com/jira/browse/JBAS-4919 and 
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=127194

For the moment, I'd like to focus the discussion of this JIRA in the context of JBoss 5, where we can still change the API for HASingletonElectionPolicy. As far as ha singleton election is concerned, as Brian suggested,
boolean isElectedMaster(HAPartition partition); 
should change to 
boolean isElectedMaster(List<ClusterNode> newReplicants);

This is the method that HASingletonSupport.partitionTopologyChanged(List newReplicants, int newViewID) calls to decide the elected master.

I'm a bit concerned however about the suitability of other internal singleton selection related methods in HASingletonElectionPolicy's public API:

ClusterNode pickSingleton();
  | ClusterNode pickSingleton(HAPartition partition);
  | boolean isElectedMaster();

As far as I can see from the code, these are only used by the convenience HASingletonElectionPolicyBase class which I assume was created to make the life easier to people wanting to provide their own election policies. Users could choose not to go down this route and implement directly HASingletonElectionPolicy, which is why I don't think we should force them to implement these 3 methods as they will never be called. IMO, they should belong to HASingletonElectionPolicyBase rather than HASingletonElectionPolicy. The only relevant method users should implement is 
boolean isElectedMaster(List<ClusterNode> newReplicants);

Regardless of the whether these 3 methods live in HASingletonElectionPolicy or HASingletonElectionPolicyBase, 

pickSingleton(HAPartition partition); 

needs changing in the same way that isElectedMaster(HAPartition partition); did to

pickSingleton(List<ClusterNode> newReplicants); 

Thoughts?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120066#4120066

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120066



More information about the jboss-dev-forums mailing list