Alerts "suppress" maintenance mode by indicating a maintenance_state attribute in addition to the actual state which is being reported:
When a host/service/component is placed into MM, the database is updated so that all alert_current rows which are affected have their MM updated as well.
However, this fails under two scenarios:
- The alert hasn't been received yet in a brand new cluster
- The alert definition was disabled, which removed all current alerts. Then, it was re-enabled.
In both cases, when constructing a new AlertCurrentEntity, we need to calculate the correct maintenance state.