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




ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertMaintenanceModeListener.java
Lines 97 (patched)
<https://reviews.apache.org/r/58411/#comment245157>

    I don't think you need to pass this in since you can get it off of the 
AlertCurrentEntity and its associations (AlertHistory, AlertDefinition, etc)



ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertMaintenanceModeListener.java
Lines 97 (patched)
<https://reviews.apache.org/r/58411/#comment245158>

    I don't think you need to pass this in since you can get it off of the 
AlertCurrentEntity and its associations (AlertHistory, AlertDefinition, etc)



ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java
Lines 1041-1049 (patched)
<https://reviews.apache.org/r/58411/#comment245159>

    This doesn't need to be @Transactional since the delegated merge() method 
is. The publish() method is asynchronous, so it doesn't help there either.
    
    I also think this is wrong logic. You should not be firing off an 
AggregateRecalculationEvent on every AlertCurrentEntity merge() ... you should 
only do it when the state changes. 
    
    If the problem is that MainteanceMode affects this, then you should listen 
for the MM events and work off of them.


- Jonathan Hurley


On April 14, 2017, 1:43 p.m., Qin Liu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58411/
> -----------------------------------------------------------
> 
> (Updated April 14, 2017, 1:43 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley and Jayush Luniya.
> 
> 
> Bugs: AMBARI-20726
>     https://issues.apache.org/jira/browse/AMBARI-20726
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Aggregate alert does not show status properly at Maintenance Mode change.
> 
> Steps to reproduce:
> Install a cluster that has HBase with one regionserver installed.
> 
> Scenario 1:
> 1. Turn On Maintenance Mode on the RegionServer or on the RegionServer host 
> or on the HBase service.
> 2. Stop the RegionServer after that.
> 3. No red alerts will show as expected.
>    Percent RegionServers Available - OK affected: [0], total: [1]
> 4. Now Turn Off Maintenance Mode, still keep the RegionServer down.
>    But Percent RegionServers Available alert will still show "OK" - "CRIT" is 
> expected.
> 
> Scenario 2:
> 1) Stop the RegionServer - Red alert will show as expected.
>    Percent RegionServers Available - CRIT affected: [1], total: [1]
> 2) Now Turn On Maintenance Mode - For RegionServer status, Red alert will be 
> gone as expected.
>    But Percent RegionServers Available alert will still show "CRIT" - "OK" is 
> expected.
>    
> The fix is to fire an AggregateAlertRecalculateEvent to refresh aggregate 
> alert at Maintenance Mode change time.
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertMaintenanceModeListener.java
>  847a207 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java 
> d3ba2ac 
>   
> ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/AlertMaintenanceModeListenerTest.java
>  bdc662a 
> 
> 
> Diff: https://reviews.apache.org/r/58411/diff/1/
> 
> 
> Testing
> -------
> 
> The fix has been manually tested via HDP UI.
> The unit testcase AlertMaintenanceModeListenerTest.java has been updated to 
> reflect the change.
> 
> testrun_ambari-server Results :
> Tests run: 4977, Failures: 0, Errors: 0, Skipped: 39
> 
> The skipped testcases has nothing to do with the fix.
> 
> 
> Thanks,
> 
> Qin Liu
> 
>

Reply via email to