Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster-servant: only report online if quorate or never had quorum #27

Closed
wants to merge 1 commit into from

Conversation

jjd27
Copy link

@jjd27 jjd27 commented Sep 28, 2017

Currently, the sbd-cluster servant does nothing for a corosync/cman cluster each
time notify_timer_cb fires. So this servant can never cause fencing after
connecting.

Instead, query the QUORUM service and only report 'online' status when quorate
or when quorum has never been attained.

This allows sbd to be used for fencing upon loss of quorum when pacemaker is not
running.

Currently, the sbd-cluster servant does nothing for a corosync/cman cluster each
time notify_timer_cb fires.  So this servant can never cause fencing after
connecting.

Instead, query the QUORUM service and only report 'online' status when quorate
or when quorum has never been attained.

This allows sbd to be used for fencing upon loss of quorum when pacemaker is not
running.
@wenningerk
Copy link

Guess we could set the quorum-state via the callback as well.
On the other hand polling for the quorum-state kind of replaces the cpg-polling suggested in the comment you removed.
But maybe it shouldn't be done that frequently. Could send out the cpg-message everytime and receive it asynchronously.
What we have to take into account in any case I guess is kind of a semantically-merge with PR#23.
Anyway in case of 2-node-clusters getting quorum like this would always succeed once the nodes have seen each other.

@jjd27
Copy link
Author

jjd27 commented Oct 19, 2017

Okay. I originally thought checking quorum state would replace the need to do cpg polling. But I think you are suggesting that cpg polling is worthwhile in addition. Would it be best for that to belong in a separate servant? Perhaps it could send out cpg messages and check that it is receiving messages from at least one node that is not itself (except in a 2-node cluster)?

@wenningerk
Copy link

Think opening up an additional servant is just too much hassle and has impact on how to configure the whole thing. Should be possible to handle that all in the cluster-servant.
I would just asynchronously send out a cpg-message (maybe every second) and set a flag if the message to the node itself is received asynchronously (distributed to all nodes then). And we just send the alive if that flag is set and reset it afterwards. That would just check the liveness of the IPC with corosync. On top we can asynchronously receive the quorum-state in clusters that are not 2-node and do the node-counting via registered peers in the cpg-protocol in the 2-node-case (as quorum-info isn't that useful there).
Like that we wouldn't have any synchronous messaging in the timer.

@wenningerk
Copy link

wenningerk commented Oct 20, 2017

Sorry for that ;-)
I've merged the 2-node-stuff because I think it is easier to add your PR on top.
At the moment it is a little bit tough for me but I'll try to have a look on the weekend ...

@Splarv
Copy link

Splarv commented Apr 16, 2019

I checked this PR taken from the author repository
https://github.com/jjd27/sbd/tree/cluster-quorum
When I freeze corosyn in one node by kill -s STOP, both node are rebooted. Two node setup with a quorum device on third.

@wenningerk
Copy link

@Splarv: As already stated above I think we wouldn't like this synchronous implementation.

And thinking over it again I'm not sure if suicide in case of quorum-loss without pacemaker running would make sense. Contrary it would rather be undesired behavior in cluster-shutdown e.g.
And actually I don't see a reason why I would like to have it - unless a scenario I didn't think of proves me wrong.
Although I do see reason for the cpg-message check as to be sure that corosync-messaging is working and we can assume that it is working for pacemaker as well so that what we get from there really either reflects the state of the partial cluster or we don't get anything and thus will suicide. And there is no need for different handling of two-node-clusters or anything.

@Splarv
Copy link

Splarv commented Apr 17, 2019 via email

@wenningerk
Copy link

Well cpg sends you back your own message once it is distributed over the cluster.
Just checking if there is something existent in pacemaker already we can use directly ... or at least
the cpg-protocol that pacemaker uses - less new code and better check if it is the one pacemaker uses.

@wenningerk
Copy link

For checking liveness of the corosync-daemon we don't necessarily have to send messages over the network. Using something simple like cpg_local_get already sufficiently verifies the daemon connection.
#76

@Splarv
Copy link

Splarv commented Apr 18, 2019 via email

@wenningerk
Copy link

check out my PR via the link above - should have all the conditionals
I guess you have other issues with corosync that should be observed separately.
If you have that much of a lag you will see membership-drops and loss of quorum as well that will lead to self-fencing subsequently during operation.
I don't see these issues in my setup.

@Splarv
Copy link

Splarv commented Apr 18, 2019 via email

@wenningerk
Copy link

We just want to check the connection so extra checks of what is returned as nodeid are not necessary.
I've simplified my patch a bit as anyway 0 isn't guaranteed as non-valid cpg_handle either.
I'm using pacemaker 2.0.1 and corosync 2.99.3 but honestly the behavior you are describing shouldn't be there before either.

@Splarv
Copy link

Splarv commented Apr 18, 2019 via email

@wenningerk
Copy link

@jjd25:
Have you had a look at
#83 Fix: sbd-cluster: periodically check corosync-daemon liveness
Guess behavior to self-fence if lost quorum while pacemaker isn't running
anyway is not really desirable envisioning the scenario of stopping
pacemaker one-by-one (as e.g. pcs is doing).
But it is definitely desirable to check if the quorum-state we're getting
via pacemaker would be reliable.
The issues with using cpg-heartbeat-messages are discussed in
#76 Fix: sbd-cluster: periodically check connection to corosync-daemon
I would leave #76 open for now as a reminder that delayed quorum-info
due to longer stalls might be an issue.
So I'd like to close this one.

@knet-ci-bot
Copy link

Can one of the admins verify this patch?

@wenningerk wenningerk closed this Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants