2013/3/20 Fabio M. Di Nitto <[email protected]>

> On 3/20/2013 4:31 PM, eXeC001er wrote:
> > Hello.
> >
> > The corosync-2.x has qdevice logic, but i have not found any details
> > about using the logic.
>
> that is because the API is not yet supported. The core is done and ready
> to be used but there are no real consumers.
>

understood.


>
> >
> > 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.

test/testvotequorum2.c (
https://github.com/corosync/corosync/blob/needle-2.3/test/testvotequorum2.c#L104
)

...
        if ( (err=votequorum_qdevice_master_wins(handle, "QDEVICE",
master_wins)) != CS_OK) {
            fprintf(stderr, "qdevice_master_wins FAILED: %d\n", err);
            ret = -1;
            goto out;
        }
....

lib/votequorum.c (
https://github.com/corosync/corosync/blob/needle-2.3/lib/votequorum.c#L652)

cs_error_t votequorum_qdevice_master_wins (
    votequorum_handle_t handle,
    const char *name,
    unsigned int allow)
{
...
}


>
> >
> >
> > The second Q:
> >
> > As i understand 'CAST_VOTE=1' flag says to corosync that need to
> > consider the votes of a QDEVICE ?
>
> No, cast_vote is not the number of votes. A qdevice can be registered
> and polling, but it´s not casting a vote.
>

i meant that cast_vote is a flag, and when it is TRUE then
corosync consider the votes of a QDEVICE. so you have confirmend
my assumption.


>
> That exactly to implement master_win solution.
>
> A master is casting a vote, a slave is not casting a vote. Both needs to
> poll via qdevice_poll.


> The old concept that a qdevice needs to know how many votes to cast has
> been removed. votequorum knows internally how many vote a device should
> have.
>
>
>
> _______________________________________________
> Openais mailing list
> [email protected]
> https://lists.linuxfoundation.org/mailman/listinfo/openais
>
_______________________________________________
Openais mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/openais

Reply via email to