nikolauseppinger opened a new pull request, #13588:
URL: https://github.com/apache/cloudstack/pull/13588
### Description
After the Host HA framework successfully fences a host, `FenceTask` puts it
into maintenance mode, which makes the host ineligible for the HA provider
(`KVMHAProvider.isEligible()` returns false for hosts in maintenance).
The `HAManagerBgPollTask` then attempts an `Ineligible` transition on every
poll round via `validateAndFindHAProvider()`, but the HA state machine
intentionally has no `Fenced -> Ineligible` transition — a fenced host must
remain `Fenced` until a health check passes
(`Fenced -> HealthCheckPassed -> Ineligible`).
The result is an endless stream of warnings, every poll round, for every
fenced host, until the operator resolves the host:
```
WARN [o.a.c.h.HAManagerImpl] (BackgroundTaskPollManager-3:[ctx-...]) Unable
to find
next HA state for current HA state=[Fenced] for event=[Ineligible] for host
Host {"id":10,...} with id 10. com.cloud.utils.fsm.NoTransitionException:
Unable to transition to a new state from Fenced via Ineligible
```
This PR skips the `Ineligible` transition attempt for hosts in `Fenced`
state, since their ineligibility is expected (fencing puts them in
maintenance) and the intended exit from `Fenced` is via a passing health
check. There is no behavioural change otherwise: the host is still skipped
by the poll task while fenced and ineligible.
Deliberately NOT added: an FSM transition `Fenced -> Ineligible` via
`Event.Ineligible`. That would make the `Fenced` state effectively last only
until the next poll round (fencing always puts the host in maintenance →
always ineligible), breaking the sticky-Fenced semantics that
`isVMAliveOnHost()` and `getHostStatusFromHAConfig()` rely on while the
VM HA restart work items for the fenced host are being processed.
Covered by new unit tests (fenced case plus regression cases for the
existing eligibility logic).
Observed on 4.22.1.0 with KVM Host HA + IPMI OOBM; code path unchanged on
main.
### Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
### Bug Severity
- [x] Minor
### How Has This Been Tested?
- New unit tests in `HAManagerImplTest` (4/4 pass)
- `mvn -pl server -am test` builds green including checkstyle
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]