Hi Leehui, Bongjae
Bongjae Chang wrote:
> Hi leehui.
>
> /leehui wrote:/
> />One of my question is what sorting algorithm is used?/
>
> Maybe the first member which is based on JXTA's net.jxta.id.ID in
> cluster view will become to be new master when a master is failed.
>
> But net.jxta.id.ID doesn't means Shoal's server token(member's name).
> It is dependent on JXTA. So I think you can't guess what is new master
> in advance without logs.
>
> If a master comes into collision with another master, only one master
> is selected with collision algorithm which is based on JXTA's ID.
>
> And sorting algorithm is maybe java.lang.String's matching because of
> net.jxta.id.ID doesn't implement java.lang.Comparable.
MasterNode employs TreeMap from the JDK which provides natural sorting
order.
But to explain it a bit more, at the initial group formation time, if it
so happens that a member sends out a master node query and does not
receive a response within the query timeout period (I think it defaults
to 5 secs), then this member assumes and announces master node role.
Subsequently, all members joining the group by sending a master node
query would get a master node response from this master. Under these
circumstances, the master node's ID's sort order does not matter even if
subsequent members' id's sort order places them on the top of the tree
map ahead of this master node, as long as all other members receive the
master node response along with the view change.
When a change to master role happens i.e. this original master dies or
shuts down, then the member on top of the tree map's sorted is picked as
the master candidate and appointed as master. There is no direct code
level way to prevent a member from becoming a master. That would be an
RFE where a member could be designated or marked as a member as being
never a candidate for being master. Would be interesting to understand
what use cases would require such a feature.
>
>
> /leehui wrote:/
> />Another question, let's see a case. If node A, B, C jion the same
> group. Because of some network problems, A, B can communicate with
> each other, while >C can' t communicate with A and B. So, A, B will
> select a maste node. Let me assume it is A. And C will select itself
> as a master node. Is that right?/
>
> Right.
>
>
> /leehui wrote:/
> />After some time later, if A,B,C can communicate with each other,
> what is master node? A or C? Can B become a master node?/
>
> I think that this is very complex issue.
>
> When one more masters exist in the group because of network problems
> and members join the group each other again after some time later,
>
> I think that maybe two masters can exist in the same group.
>
> If the group doesn't have a master, it is no problems because master
> collision algorithm works well in order to appoint the master as I said.
>
> But if one more masters already exist, I think that current
> Shoal can't be aware of master's collision(this is my guess).
Master collision is meant to resolve multiple masters. IIRC this
protocol is that each master realizes that there is another master and
sends a collision message. Based on sorting order of the merged views,
the master that ends up at the top becomes the winning master and the
other one resigns.
Hope this is helpful.
Shreedhar
>
>
> I don't know whether my knowledges about the master selection are
> correct or not.
>
> But I hope this information helps you and I also would like to confirm
> this case. :-)
>
> Thanks.
>
> --
> Bongjae Chang
>
>
>
> ----- Original Message -----
> *From:* leehui <mailto:lihui306_at_mails.gucas.ac.cn>
> *To:* users <mailto:users_at_shoal.dev.java.net>
> *Sent:* Friday, March 27, 2009 11:33 AM
> *Subject:* [Shoal-Users] master node election question
>
> Hi,
>
> I have serveral questions about master node election.
>
> From the doc on the shoal web site, I know that the group sorts
> all the members' token, and select the first node as master node.
> If the master node fails, then select the second node in the
> sorted list as the master node. Is that right?
>
> One of my question is what sorting algorithm is used?
>
> When a new member jion the group, how to assure it is not at the
> front of the sorted list?
>
> Another question, let's see a case. If node A, B, C jion the same
> group. Because of some network problems, A, B can communicate with
> each other, while C can' t communicate with A and B. So, A, B will
> select a maste node. Let me assume it is A. And C will select
> itself as a master node. Is that right?
>
> After some time later, if A,B,C can communicate with each other,
> what is master node? A or C? Can B become a master node?
>
>
> Best Regard!
> 2009-03-27
> ------------------------------------------------------------------------
> leehui
>