Skip to content

Enabling new configuration without restarting broker

Florian Moussous requested to merge cache-invalidation into master

Until now, the broker had to be restarted if an engine's configuration changed. Especially, when a host was removed from a hostgroup, the broker module's cache kept the former information that the host was joined to group. To fix this, the whole instance's cache is invalidated when we know that an instance is not running anymore.

  • Added a method to clear an instance's cache (clear_cache)
  • Called this method if the information is received that an instance is not running anymore
  • There were cases where an event of deletion of a hostgroup membership was sent to and processed by the broker, removing objets in instance's cache, thus preventing further host group membership to that group. To prevent such case, the _host_group_names map is now filled on each host group membership event.

Tested on centreon-broker 3.0.16 and centreon engine v1.8.1 :

  • When a host is removed from a hostgroup, restarting poller is now enough
  • If a host or other object is changed to another poller, the two pollers will be restarted so both caches will be flushed

Limitations spotted:

  • If the cbd somehow is restarted, centengines must be restarted after that, otherwise the cache won't be in a consistent state (this must already have been the case before)
Edited by Florian Moussous

Merge request reports

Loading