> On April 26, 2017, 5:59 p.m., Alejandro Fernandez wrote: > > ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertMaintenanceModeListener.java > > Lines 170 (patched) > > <https://reviews.apache.org/r/58411/diff/2/?file=1700639#file1700639line170> > > > > Why isn't the OK state part of this? > > > > > > If only these 2 states are valid, let's use a collection of states that > > force a recalculation and put it in AlertState.java > > Qin Liu wrote: > Hi Alejandro, > > The OK state of the alert is not part of this because the state of its > aggregate alert won't be affected by MM state changes, The alert in > CRITICAL/WARNING state will affect its aggregate alert because its state will > be changed from muffed CRITICAL/WARNING state to CRITICAL/WARNING state when > MM is changed from MM on to MM off or CRITICAL/WARNING state to muffed > CRITICAL/WARNING state.when MM is changed from MM off to MM on. > > For your 2nd comment, could you please explain how to use a collection of > states that force a recalculation and put it in AlertState.java? Thank you! > > Alejandro Fernandez wrote: > public static EnumSet<AlertState> RECALCULATE_AGG_STATUS_STATES = > EnumSet.of(CRITIAL, WARNING); > > And just use a .contains()
Fixed. Thanks Akejandro! - Qin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/58411/#review173069 ----------------------------------------------------------- On April 27, 2017, 4 p.m., Qin Liu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/58411/ > ----------------------------------------------------------- > > (Updated April 27, 2017, 4 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/state/AlertState.java > 8e04eb1 > > ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/AlertMaintenanceModeListenerTest.java > bdc662a > > > Diff: https://reviews.apache.org/r/58411/diff/3/ > > > 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. > > > File Attachments > ---------------- > > AMBARI-20726.patch > > https://reviews.apache.org/media/uploaded/files/2017/04/24/011309ea-84c8-470c-b467-bbe2a2372f46__AMBARI-20726.patch > AMBARI-20726_2.patch > > https://reviews.apache.org/media/uploaded/files/2017/04/26/8aa802d1-17a9-4871-8ea1-1449a29506ae__AMBARI-20726_2.patch > > > Thanks, > > Qin Liu > >