You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Jonathan Hurley <jh...@hortonworks.com> on 2014/09/29 17:07:47 UTC

Review Request 26138: Alerts: Stack Alerts Should Not Be Merged Into the DB

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

Review request for Ambari and Nate Cole.


Bugs: AMBARI-7540
    https://issues.apache.org/jira/browse/AMBARI-7540


Repository: ambari


Description
-------

Initially, it was thought that alerts defined on the stack should be merged into existing alerts in the database on server startup so that changes made to the stack will be updated in the DB.

However, there is a problem with this approach where editing a stack-based alert from the REST endpoints will be overwritten on the next startup. We could track this state change in the database, but this seems like a v2 feature.

For v1, let's change the logic so that stack merging into the DB is only done for new alerts detected in alerts.json.


Diffs
-----

  ambari-agent/src/test/python/ambari_agent/dummy_files/definitions.json 8e018337bde10b3d6955f7b1daef0e6f2c2ab340 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java c15f73b062db9e61a61e5a11fcfb27d9333613e8 
  ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/alerts.json 620c89fc50911e337f4a9a5eb597780f7716e260 
  ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java 4c59a36a0b501c24df6e6d42c8152024d3b1657c 
  ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/alerts.json 0077bad944416b4440906054100e0e236cff05fc 

Diff: https://reviews.apache.org/r/26138/diff/


Testing
-------

mvn clean test


Thanks,

Jonathan Hurley


Re: Review Request 26138: Alerts: Stack Alerts Should Not Be Merged Into the DB

Posted by Jonathan Hurley <jh...@hortonworks.com>.

> On Sept. 29, 2014, 11:14 a.m., Nate Cole wrote:
> > ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/alerts.json, line 38
> > <https://reviews.apache.org/r/26138/diff/1/?file=708203#file708203line38>
> >
> >     Hopefully these all default to true.

AlertDefinition:
  private boolean enabled = true;
  
Also, we have tests that cover the default behavior. Since this is the first version, I like to be explicit about the properties available. However, I notced that I did this for a test file, so I will revert it back.


- Jonathan


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


On Sept. 29, 2014, 11:07 a.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26138/
> -----------------------------------------------------------
> 
> (Updated Sept. 29, 2014, 11:07 a.m.)
> 
> 
> Review request for Ambari and Nate Cole.
> 
> 
> Bugs: AMBARI-7540
>     https://issues.apache.org/jira/browse/AMBARI-7540
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Initially, it was thought that alerts defined on the stack should be merged into existing alerts in the database on server startup so that changes made to the stack will be updated in the DB.
> 
> However, there is a problem with this approach where editing a stack-based alert from the REST endpoints will be overwritten on the next startup. We could track this state change in the database, but this seems like a v2 feature.
> 
> For v1, let's change the logic so that stack merging into the DB is only done for new alerts detected in alerts.json.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/test/python/ambari_agent/dummy_files/definitions.json 8e018337bde10b3d6955f7b1daef0e6f2c2ab340 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java c15f73b062db9e61a61e5a11fcfb27d9333613e8 
>   ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/alerts.json 620c89fc50911e337f4a9a5eb597780f7716e260 
>   ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java 4c59a36a0b501c24df6e6d42c8152024d3b1657c 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/alerts.json 0077bad944416b4440906054100e0e236cff05fc 
> 
> Diff: https://reviews.apache.org/r/26138/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>


Re: Review Request 26138: Alerts: Stack Alerts Should Not Be Merged Into the DB

Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26138/#review54814
-----------------------------------------------------------

Ship it!



ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/alerts.json
<https://reviews.apache.org/r/26138/#comment95088>

    Hopefully these all default to true.


- Nate Cole


On Sept. 29, 2014, 11:07 a.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26138/
> -----------------------------------------------------------
> 
> (Updated Sept. 29, 2014, 11:07 a.m.)
> 
> 
> Review request for Ambari and Nate Cole.
> 
> 
> Bugs: AMBARI-7540
>     https://issues.apache.org/jira/browse/AMBARI-7540
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Initially, it was thought that alerts defined on the stack should be merged into existing alerts in the database on server startup so that changes made to the stack will be updated in the DB.
> 
> However, there is a problem with this approach where editing a stack-based alert from the REST endpoints will be overwritten on the next startup. We could track this state change in the database, but this seems like a v2 feature.
> 
> For v1, let's change the logic so that stack merging into the DB is only done for new alerts detected in alerts.json.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/test/python/ambari_agent/dummy_files/definitions.json 8e018337bde10b3d6955f7b1daef0e6f2c2ab340 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java c15f73b062db9e61a61e5a11fcfb27d9333613e8 
>   ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/alerts.json 620c89fc50911e337f4a9a5eb597780f7716e260 
>   ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java 4c59a36a0b501c24df6e6d42c8152024d3b1657c 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/alerts.json 0077bad944416b4440906054100e0e236cff05fc 
> 
> Diff: https://reviews.apache.org/r/26138/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>