Skip to content

Commit

Permalink
Merge pull request #825 from Icinga/ha-state-both-responsible-reject
Browse files Browse the repository at this point in the history
HA State: ensure not this and another instance can be responsible
  • Loading branch information
lippserd authored Dec 16, 2024
2 parents c8a90f1 + a38491a commit 5454c89
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/icingadb/ha.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,11 @@ func (h *HA) realize(
if takeover != "" {
h.signalTakeover(takeover)
} else if otherResponsible {
if state := h.state.Load(); state.responsible {
h.logger.Error("Other instance is responsible while this node itself is responsible, dropping responsibility")
h.signalHandover("other instance is responsible as well")
// h.signalHandover will update h.state
}
if state := h.state.Load(); !state.otherResponsible {
// Dereference pointer to create a copy of the value it points to.
// Ensures that any modifications do not directly affect the original data unless explicitly stored back.
Expand Down

0 comments on commit 5454c89

Please sign in to comment.