Config sync still works after changing the zone name on the agent

Hello,

I’m not sure if this is intended behavior or a bug - so I’d like to get some advice about it here please! It’s certainly not behaviour I expected at least…

I have a test master-master setup with a couple of agents. I originally set everything up with the zone name icinga2-ha-zone and I am testing what happens when I change this. I have renamed the zone to tier1-zone, and changed references to this on the masters, in the zones.d folder and on one of the agents.

On one of the agents, I left the zones.conf as-is to see what would happen. For some reason, it kept working fine. I then changed the zone name in the zones.conf on this agent to a random string fhfodfbhdjdjk, and it still kept working!

zones.conf on the config master (icinga-test-server1.example.ac.uk):

object Endpoint "icinga-test-server1.example.ac.uk" {
}
object Endpoint "icinga-test-server2.example.ac.uk" {
        host = "icinga-test-server2.example.ac.uk"
        port = "5665"
}
object Zone "tier1-zone" {
        endpoints = [ "icinga-test-server1.example.ac.uk", "icinga-test-server2.example.ac.uk" ]
}
object Zone "global-templates" {
        global = true
}
object Zone "director-global" {
        global = true
}

agents.conf in my zones.d/tier1-zone/ folder (which was named zones.d/icinga2-ha-zone/):

object Endpoint "icinga-test-agent1.example.ac.uk" {
  host = "icinga-test-agent1.example.ac.uk" // The master actively tries to connect to the agent
  log_duration = 0 // Disable the replay log for command endpoint agents
}
object Zone "icinga-test-agent1.example.ac.uk" {
  endpoints = ["icinga-test-agent1.example.ac.uk"]
  parent = "tier1-zone"
}
object Endpoint "icinga-test-agent2.example.ac.uk" {
  host = "icinga-test-agent2.example.ac.uk" // The master actively tries to connect to the agent
  log_duration = 0 // Disable the replay log for command endpoint agents
}
object Zone "icinga-test-agent2.example.ac.uk" {
  endpoints = ["icinga-test-agent2.example.ac.uk"]
  parent = "tier1-zone"
}

and finally the zones.conf on icinga-test-agent2.example.ac.uk:

object Endpoint "icinga-test-server1.example.ac.uk" {
}

object Endpoint "icinga-test-server2.example.ac.uk" {
}

object Zone "fhfodfbhdjdjk" {
        endpoints = [ "icinga-test-server1.example.ac.uk", "icinga-test-server2.example.ac.uk" ]
}
object Endpoint "icinga-test-agent2.example.ac.uk" {
}
object Zone "icinga-test-agent2.example.ac.uk" {
        endpoints = [ "icinga-test-agent2.example.ac.uk" ]
        parent = "fhfodfbhdjdjk"
}
object Zone "global-templates" {
        global = true
}
object Zone "director-global" {
        global = true
}

The logs from icinga-test-agent2.example.ac.uk seem to suggest it’s still working fine - and all checks appear OK in icingaweb2 as well…

[2023-02-09 09:24:12 +0000] information/ApiListener: Sending config updates for endpoint 'icinga-test-server1.example.ac.uk' in zone 'fhfodfbhdjdjk'.
[2023-02-09 09:24:12 +0000] information/ApiListener: Finished sending config file updates for endpoint 'icinga-test-server1.example.ac.uk' in zone 'fhfodfbhdjdjk'.
[2023-02-09 09:24:12 +0000] information/ApiListener: Syncing runtime objects to endpoint 'icinga-test-server1.example.ac.uk'.
[2023-02-09 09:24:12 +0000] information/ApiListener: Applying config update from endpoint 'icinga-test-server1.example.ac.uk' of zone 'fhfodfbhdjdjk'.
[2023-02-09 09:24:12 +0000] information/ApiListener: Finished syncing runtime objects to endpoint 'icinga-test-server1.example.ac.uk'.
[2023-02-09 09:24:12 +0000] information/ApiListener: Finished sending runtime config updates for endpoint 'icinga-test-server1.example.ac.uk' in zone 'fhfodfbhdjdjk'.
[2023-02-09 09:24:12 +0000] information/ApiListener: Sending replay log for endpoint 'icinga-test-server1.example.ac.uk' in zone 'fhfodfbhdjdjk'.
[2023-02-09 09:24:12 +0000] information/ApiListener: Received configuration updates (0) from endpoint 'icinga-test-server1.example.ac.uk' are equal to production, skipping validation and reload.
[2023-02-09 09:24:12 +0000] information/ApiListener: Finished sending replay log for endpoint 'icinga-test-server1.example.ac.uk in zone 'fhfodfbhdjdjk'.
[2023-02-09 09:24:12 +0000] information/ApiListener: Finished syncing endpoint 'icinga-test-server1.example.ac.uk' in zone 'fhfodfbhdjdjk'.

Is this supposed to happen? I was expecting that the agent with the wrong zone name in its zones.conf would stop syncing config and all checks would stop working…

Thanks!