> On June 12, 2016, 7:06 a.m., Jonathan Hurley wrote:
> > ambari-agent/src/main/python/ambari_agent/alerts/base_alert.py, lines 
> > 410-411
> > <https://reviews.apache.org/r/48589/diff/1/?file=1415725#file1415725line410>
> >
> >     This still seems like a warning which we want. It means that there was 
> > a name service defined, but no alias properties. If a name service is 
> > defined, then shouldn't there always be valid aliases?
> 
> Miklos Gergely wrote:
>     The uri block of some alerts contains a high_availability sub block, 
> which may define a nameservice. If HA is not enabled than the defined 
> property is not present. I don't see any logic to tell earlier whether or not 
> HA is enabled, so the fact that the property the HA nameservice references is 
> missing is a good indicator that it's not. If there is anoyther way to decide 
> if HA is enabled let me know about it, that logic could be used at 
> base_alert:342 to decide whether or not to enter into 
> _get_uri_from_ha_structure at all. Currently the logic there is to check if 
> ha_nameservice or ha_alias_key is defined, but the comment above it tells 
> that in this case it should "try" to get these properties, i.e. it is still 
> not sure that they are there. Following this logic their absence is not a 
> cause for warning.

There is really no way to determine if HA is "enabled". That's why we use a 
combinaton of the nameservice and the alias. If the nameservice is present in 
the configs, then I think the aliases should be as well. I think the logic as 
it is today is a little wrong. It should be more like:

```
if ha_nameservice is None:
  return None

if ha_nameservice is not None and ha_alias_key is None:
  return None

ha_alias_key = ha_alias_key.replace(self.HA_NAMESERVICE_PARAM, ha_nameservice)
ha_nameservice_alias = self._get_configuration_value(ha_alias_key)
if ha_nameservice_alias is None:
      logger.warning("[Alert][{0}] HA nameservice value is present but there 
are no aliases for {1}".format(
```


- Jonathan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/48589/#review137164
-----------------------------------------------------------


On June 11, 2016, 6:24 p.m., Miklos Gergely wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/48589/
> -----------------------------------------------------------
> 
> (Updated June 11, 2016, 6:24 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Oliver Szabo, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-17180
>     https://issues.apache.org/jira/browse/AMBARI-17180
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> base_alert.py puts a warning into the log if there are properties referenced 
> in the HA nameservice or the alias which are not present in the 
> configuration. The absence of these properties is an indicator that the HA is 
> not enabled, it is not a cause for warning.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/alerts/base_alert.py 6c8ca5a 
> 
> Diff: https://reviews.apache.org/r/48589/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Miklos Gergely
> 
>

Reply via email to