Skip to content

ApiListener#RelayMessageOne(): log🪵 to which Endpoint messages are relayed#10393

Merged
Al2Klimov merged 1 commit intomasterfrom
zone-endpoint-log
Aug 22, 2025
Merged

ApiListener#RelayMessageOne(): log🪵 to which Endpoint messages are relayed#10393
Al2Klimov merged 1 commit intomasterfrom
zone-endpoint-log

Conversation

@Al2Klimov
Copy link
Copy Markdown
Member

@Al2Klimov Al2Klimov commented Mar 27, 2025

if they're for our parent Zone.

ref/NC/820479

Requested in #10389, but useful independent of it.

Tests

Config

object Endpoint "akzl1" {
  host = "10.27.1.87"
}

object Endpoint "akzl2" {
  host = "10.27.1.90"
}

object Endpoint "akzl3" {
  host = "10.27.3.6"
}

object Endpoint "akzl4" {
  host = "10.27.0.129"
}

object Zone "master" {
  endpoints = [ "akzl1", "akzl2" ]
}

object Zone "sat" {
  parent = "master"
  endpoints = [ "akzl3", "akzl4" ]
}

include <itl>

object CheckerComponent "checker" { }

object ApiListener "api" {
  accept_config = true
  accept_commands = true
}

object ApiUser "root" {
  password = "123456"
  permissions = [ "*" ]
}

object Host "master" {
  check_command = "dummy"
  zone = "master"
}

object Host "sat" {
  check_command = "dummy"
  zone = "sat"
}

for (i in range(1000)) {
  apply Service i {
    check_command = "dummy"
    assign where true
  }
}

Starting point

Bildschirmfoto 2025-03-27 um 12 32 56

sat's member akzl4 relays stuff to its zone-master akzl3 which relays it to the parent akzl1.

Let's break something... 😈

If we stop akzl1...

Bildschirmfoto 2025-03-27 um 12 35 31

... akzl3 switches its parent from akzl1 to akzl2.

Let's break something... 😈 II

If we also stop akzl3...

Bildschirmfoto 2025-03-27 um 12 36 28

... akzl4 switches from zone-master akzl3 to parent akzl2.

OK, the downtime is over... 👿

Likewise, whichever preferred nodes come back online...

Bildschirmfoto 2025-03-27 um 12 37 01

... they're used again! 👍

Bildschirmfoto 2025-03-27 um 12 37 21

@Al2Klimov Al2Klimov added area/distributed Distributed monitoring (master, satellites, clients) area/log Logging related ref/NC labels Mar 27, 2025
@Al2Klimov Al2Klimov requested a review from lippserd March 27, 2025 11:53
@cla-bot cla-bot Bot added the cla/signed label Mar 27, 2025
Comment thread lib/remote/apilistener.cpp
Comment thread lib/remote/apilistener.cpp
Copy link
Copy Markdown
Contributor

@jschmidt-icinga jschmidt-icinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can understand @yhabteab's concern that the log message "Relaying messages for parent Zone 'x' to Endpoint 'y'" could be misunderstood as "Relaying a message to 'y'". Technically, the wording is correct, but maybe it could be improved by changing it to something like "Messages to parent Zone 'x' will (now) be relayed via Endpoint 'y'".

I would prefer it if evaluating this (and all the other routing checks) could be done whenever the routing graph updates, i.e. when nodes go up or down, instead of once per message. However that's past the scope of this PR, and this does the best it can with the infrastructure we have. And the message itself is useful, no doubt.

So, unless @yhabteab is adamant about the message being unclear, I think this should be merged.

@Al2Klimov
Copy link
Copy Markdown
Member Author

Indeed. Those two messages are a bit too similar, given their different meaning..

@Al2Klimov Al2Klimov merged commit 5f2ee6e into master Aug 22, 2025
31 of 32 checks passed
@Al2Klimov Al2Klimov deleted the zone-endpoint-log branch August 22, 2025 08:11
@julianbrost julianbrost added this to the 2.16.0 milestone Oct 28, 2025
@julianbrost julianbrost added the consider backporting Should be considered for inclusion in a bugfix release label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/distributed Distributed monitoring (master, satellites, clients) area/log Logging related cla/signed consider backporting Should be considered for inclusion in a bugfix release ref/NC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants