2013/3/20 Fabio M. Di Nitto <fdini...@redhat.com>

> On 3/20/2013 5:27 PM, eXeC001er wrote:
>
> >     >
> >     > The first Q:
> >     >
> >     > According to the tests that are part of corosync-sources i think
> >     that i can:
> >     >
> >     > 1. create a daemon that register a QDEVICE and will notify corosync
> >     > about the device (votequorum_qdevice_poll()).
> >     >
> >     > 2. implement a master/slave logic and if the qdevice on a node
> >     wins then
> >     > i call votequorum_qdevice_master_wins() on the node and corosync
> >     notify
> >     > another nodes about this, so i can say that the node is MASTER.
> >
> >     There is no votequorum_qdevice_master_wins() call... where did you
> >     find it?
> >
> >
> > I am researching corosync-2.3.0 sources.
>
> whoops.. i wrote it and forgot about it..... getting old is bad :)
>
> No it´s a bit more complicated than that.
>
> corosync starts and load the config
> later on qdeviced starts and read the config
> qdeviced detects that it has to run in master_wins config:
>  call votequorum_qdevice_master_wins(..., 1);
> that calls set a flags for the node and makes sure that the feature is
> enabled internally.
>

I thought about a different scenario:

master_wins and cast_vote are different flags and they are used in
different cases.

1. uses only "cast_vote" and the flag can be used to decide that on a node
everything fine and the node is a member of cluster (the cluster does not
have master/slave)

for example in a cluster (3 nodes) i have several qdevices on each node:
storage-qdevice and client-network-qdevice

config:
each qdevice has 2 votes
each node has 1 vote
expected votes = 7 votes (1 own vote + 1 vote from anoter node + 2 votes
from each qdevice)

so if one of the qdevices detects some issues it does not cast own votes
and the defect node will be excluded by corosync from cluster because the
node will have < 7 votes.

2. "master_wins" and "cast_vote" are used.

in this case "cast_vote" will work as in case 1 and "master_wins" will
control master/slave


>
> then, you decide who is master (and tell corosync) by casting or not
> casting your vote. master will cast, slaves will not.
>
> As for debugging it is useful as it sets some bits around cmap and it
> makes it easier to detect if nodes have been configured differently.
>
> See commit 2f369e7039bc9054033693c56e93db9f4021a73f
>
> Fabio
> _______________________________________________
> Openais mailing list
> Openais@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/openais
>
_______________________________________________
Openais mailing list
Openais@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/openais

Reply via email to