If a zone managed via the API endpoint package is emptied, it still stays in the synchronized directory on second master
Describe the bug
A customer is reporting this bug and a similar issue was report as https://github.com/Icinga/icingaweb2-module-director/issues/2149, but assumed to be fixed with the latest rework on the zones / cluster sync. So it could be not fixed as I do not the this scenario listed in https://github.com/Icinga/icinga2/issues/6716.
To Reproduce
The goal was to move one last host from a satellite zone to another as the monitoring infrastructure was changed.
- Cluster zone of the host was changed in the Director
- Change was deployed
- Deployment on master one is fine
- Reload after synchronization on master two fails as the host is duplicated in both zones
- Deleting the old zone or the host file from the old zone manually fixed the problem so the reload works
Expected behavior
The described scenario works without a manual intervention.
Your Environment
- Version used (
icinga2 --version): 2.13.1
OK... what's the problem here? That the empty dir is still there? Or that you can't move Objects across zones smoothly?
The problem is:
4. Reload after synchronization on master two fails as the host is duplicated in both zones
.. the reload on master-1 fails as well.
The host including all its associated objects still exists in the old zone / is not removed from that zone. This only happens if the host object is the last remaining object of its parent satellite zone.