Skip to content

Commit

Permalink
Merge pull request #76 from openshift-cherrypick-robot/cherry-pick-75…
Browse files Browse the repository at this point in the history
…-to-release-0.5

[release-0.5] Fixing wrong scenario of control-plane reboot
  • Loading branch information
openshift-merge-robot authored Dec 25, 2022
2 parents c901f32 + dc8c666 commit 3e60fd9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/apicheck/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (c *ApiConnectivityCheck) getWorkerPeersResponse() peers.Response {
return peers.Response{IsHealthy: false, Reason: peers.UnHealthyBecauseNodeIsIsolated}
} else {
c.config.Log.Info("Ignoring no peers response error, time is below threshold for no peers response", "time without peers response (seconds)", now.Sub(c.timeOfLastPeerResponse).Seconds(), "threshold (seconds)", c.config.MaxTimeForNoPeersResponse.Seconds())
return peers.Response{IsHealthy: true, Reason: peers.HealthyBecauseNoPeersResponseNotReachedMaxAttempts}
return peers.Response{IsHealthy: true, Reason: peers.HealthyBecauseNoPeersResponseNotReachedTimeout}
}

}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controlplane/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (manager *Manager) IsControlPlaneHealthy(workerPeerResponse peers.Response,
case peers.UnHealthyBecauseNodeIsIsolated:
return canOtherControlPlanesBeReached
//reported healthy by worker peers
case peers.HealthyBecauseErrorsThresholdNotReached, peers.HealthyBecauseCRNotFound:
case peers.HealthyBecauseErrorsThresholdNotReached, peers.HealthyBecauseCRNotFound, peers.HealthyBecauseNoPeersResponseNotReachedTimeout:
return true
//controlPlane node has connection to most workers, we assume it's not isolated (or at least that the controlPlane node that does not have worker peers quorum will reboot)
case peers.HealthyBecauseMostPeersCantAccessAPIServer:
Expand Down
10 changes: 5 additions & 5 deletions pkg/peers/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ type Response struct {
type reason string

const (
HealthyBecauseCRNotFound reason = "CR Not found, node is considered healthy"
HealthyBecauseErrorsThresholdNotReached reason = "Errors number hasn't reached threshold not querying peers yet, node is considered healthy"
HealthyBecauseNoPeersResponseNotReachedMaxAttempts reason = "No response from peer hasn't passed the non responsive time threshold so still considered healthy"
HealthyBecauseNoPeersWereFound reason = "No Peers where found, node is considered healthy"
HealthyBecauseMostPeersCantAccessAPIServer reason = "Most peers couldn't access API server, node is considered healthy"
HealthyBecauseCRNotFound reason = "CR Not found, node is considered healthy"
HealthyBecauseErrorsThresholdNotReached reason = "Errors number hasn't reached threshold not querying peers yet, node is considered healthy"
HealthyBecauseNoPeersResponseNotReachedTimeout reason = "No response from peer. The duration of peer not responding hasn't passed the threshold so still considered healthy"
HealthyBecauseNoPeersWereFound reason = "No Peers where found, node is considered healthy"
HealthyBecauseMostPeersCantAccessAPIServer reason = "Most peers couldn't access API server, node is considered healthy"

UnHealthyBecausePeersResponse reason = "Node is reported unhealthy by it's peers"
UnHealthyBecauseNodeIsIsolated reason = "Node is isolated, node is considered unhealthy"
Expand Down

0 comments on commit 3e60fd9

Please sign in to comment.