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

Add cluster.SetSugarState #328

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

Conversation

terwey
Copy link
Collaborator

@terwey terwey commented Feb 23, 2021

Switch cluster.SetState to cluster.SetSugarState which reduces code complexity

Note: some States were before marked as WARNING while the Key was set to ERR

@terwey terwey changed the base branch from 2.1 to develop February 23, 2021 09:56
@terwey terwey changed the title [WIP] Add cluster.SetSugarState Add cluster.SetSugarState Feb 23, 2021
@svaroqui
Copy link
Collaborator

svaroqui commented Mar 2, 2021

This is critical to keep the level because of this func
(SM *StateMachine) IsFailable() bool {
SM.Lock()
for _, value := range *SM.OldState {
if value.ErrType == "ERROR" {
SM.Unlock()
return false
}
}
SM.discovered = true
SM.Unlock()
return true
}

The idea behind this is that there are errors for a server that do not really lead to errors at the cluster layer

A server can not be elected as a slave is a warning while it's an error for the server it not an issue for the cluster if an other server can be elected, so any lvlerr cancel the failover or the switchover cluster capability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants