Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C5495190B2 for ; Fri, 4 Mar 2016 18:09:17 +0000 (UTC) Received: (qmail 55265 invoked by uid 500); 4 Mar 2016 18:09:17 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 55235 invoked by uid 500); 4 Mar 2016 18:09:17 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 55218 invoked by uid 99); 4 Mar 2016 18:09:17 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2016 18:09:17 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id CCE812E82A8; Fri, 4 Mar 2016 18:09:16 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============4618167621958231046==" MIME-Version: 1.0 Subject: Re: Review Request 44397: New Alerts Do Not Honor Existing Maintenance Mode Setting From: Jonathan Hurley To: Jayush Luniya , Alejandro Fernandez , Sumit Mohanty , Dmitro Lisnichenko Cc: Jonathan Hurley , Ambari Date: Fri, 04 Mar 2016 18:09:16 -0000 Message-ID: <20160304180916.1648.30623@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Jonathan Hurley X-ReviewGroup: Ambari X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/44397/ X-Sender: Jonathan Hurley References: <20160304175113.1648.15275@reviews.apache.org> In-Reply-To: <20160304175113.1648.15275@reviews.apache.org> Reply-To: Jonathan Hurley X-ReviewRequest-Repository: ambari --===============4618167621958231046== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On March 4, 2016, 12:51 p.m., Sumit Mohanty wrote: > > ambari-server/src/main/java/org/apache/ambari/server/controller/MaintenanceStateHelper.java, line 248 > > > > > > We did not have a helper method yet for this? This is useful - I will let Nahappan know. I think he needed something like this for something he is working on. We did not; never needed it before now since it was all handled in the AlertMaintenanceModeListener which didn't need to calculate the state since it already had it from the fired event. - Jonathan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/44397/#review122112 ----------------------------------------------------------- On March 4, 2016, 12:46 p.m., Jonathan Hurley wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/44397/ > ----------------------------------------------------------- > > (Updated March 4, 2016, 12:46 p.m.) > > > Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, Jayush Luniya, and Sumit Mohanty. > > > Bugs: AMBARI-15303 > https://issues.apache.org/jira/browse/AMBARI-15303 > > > Repository: ambari > > > Description > ------- > > Alerts "suppress" maintenance mode by indicating a {{maintenance_state}} attribute in addition to the actual state which is being reported: > > {code} > "Alert": { > "cluster_name": "c1", > "component_name": "METRICS_COLLECTOR", > "definition_id": 43, > "definition_name": "ams_metrics_collector_process", > "host_name": "c6401.ambari.apache.org", > "id": 28, > "instance": null, > "label": "Metrics Collector Process", > "latest_timestamp": 1457108946118, > "maintenance_state": "ON", > "original_timestamp": 1457108646099, > "scope": "ANY", > "service_name": "AMBARI_METRICS", > "state": "CRITICAL", > "text": "Connection failed: [Errno 111] Connection refused to c6401.ambari.apache.org" > } > {code} > > 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. > > > Diffs > ----- > > ambari-server/src/main/java/org/apache/ambari/server/controller/MaintenanceStateHelper.java cd49e76 > ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java 9bbfe37 > > Diff: https://reviews.apache.org/r/44397/diff/ > > > Testing > ------- > > PENDING: Writing UTs and running tests now... > > Verified fix in an existing cluster by disabling alerts, then re-enabling them on a MM component with an active alert. > > > Thanks, > > Jonathan Hurley > > --===============4618167621958231046==--