You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@ambari.apache.org by Qin Liu <qi...@gmail.com> on 2016/04/01 07:15:19 UTC

Review Request 44982: AMBARI-15430: alert_group table has service info after service has been removed

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

Review request for Ambari, Di Li and Jonathan Hurley.


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


Repository: ambari


Description
-------

If user deletes all the alert definitions for a service then deletes the service, the service info will be left in the alert_group table and user has to remove it later. The ServiceRemovedEvent handling code should perform proper clean_up by considering the case that the alert_definition and alert_group tables may be out of sync.

Steps to reproduce:
1. delete all the alert definitions for a service
2. stop the service
3. delete the service
4. check alert_group table and will see it will still have the service info


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceStateListener.java 496bb6b 
  ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 785f0fb 

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


Testing
-------

Testcases:
1. One test is modified in EventsTest to verify to remove all alert data associated with the removed service in normal case.
2. Two tests are added in EventsTest to verify to remove all alert data associated with the removed service in case alert definitions and the default alert group for a service are out of sync:
- Alert definitions for a service are deleted before the service is deleted
- The default alert group for a service is deleted before the service is deleted

Testing:
1. The result of running modified EventsTest: 
-------------------------------------------------------------------------------
Test set: org.apache.ambari.server.events.EventsTest
-------------------------------------------------------------------------------
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 103.88 sec - in org.apache.ambari.server.events.EventTest

2. The result of running ambari-server tests:
Failed tests: 
  RestMetricsPropertyProviderTest.testRestMetricsPropertyProviderAsAdministrator:154->testPopulateResourcesMany:404 expected:<400> but was:<114>
  RestMetricsPropertyProviderTest.testRestMetricsPropertyProviderAsClusterAdministrator:142->testPopulateResourcesMany:404 expected:<400> but was:<285>
Tests in error: 
  PersistKeyValueImplTest.testMultiThreaded:103 » OutOfMemory unable to create n...
Tests run: 3962, Failures: 2, Errors: 1, Skipped: 33

Need to mention that I got above failure even without my fix. But above testcases passed in Hadoop QA testing.


Thanks,

Qin Liu


Re: Review Request 44982: AMBARI-15430: alert_group table has service info after service has been removed

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

> On April 1, 2016, 4:16 p.m., Jonathan Hurley wrote:
> > Ship It!
> 
> Qin Liu wrote:
>     Jonathan,
>     We got 2 SHIPs. Can we push the fix?

Committed; please close this review.


- Jonathan


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


On April 1, 2016, 1:15 a.m., Qin Liu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44982/
> -----------------------------------------------------------
> 
> (Updated April 1, 2016, 1:15 a.m.)
> 
> 
> Review request for Ambari, Di Li and Jonathan Hurley.
> 
> 
> Bugs: AMBARI-15430
>     https://issues.apache.org/jira/browse/AMBARI-15430
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> If user deletes all the alert definitions for a service then deletes the service, the service info will be left in the alert_group table and user has to remove it later. The ServiceRemovedEvent handling code should perform proper clean_up by considering the case that the alert_definition and alert_group tables may be out of sync.
> 
> Steps to reproduce:
> 1. delete all the alert definitions for a service
> 2. stop the service
> 3. delete the service
> 4. check alert_group table and will see it will still have the service info
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceStateListener.java 496bb6b 
>   ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 785f0fb 
> 
> Diff: https://reviews.apache.org/r/44982/diff/
> 
> 
> Testing
> -------
> 
> Testcases:
> 1. One test is modified in EventsTest to verify to remove all alert data associated with the removed service in normal case.
> 2. Two tests are added in EventsTest to verify to remove all alert data associated with the removed service in case alert definitions and the default alert group for a service are out of sync:
> - Alert definitions for a service are deleted before the service is deleted
> - The default alert group for a service is deleted before the service is deleted
> 
> Testing:
> 1. The result of running modified EventsTest: 
> -------------------------------------------------------------------------------
> Test set: org.apache.ambari.server.events.EventsTest
> -------------------------------------------------------------------------------
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 103.88 sec - in org.apache.ambari.server.events.EventTest
> 
> 2. The result of running ambari-server tests:
> Failed tests: 
>   RestMetricsPropertyProviderTest.testRestMetricsPropertyProviderAsAdministrator:154->testPopulateResourcesMany:404 expected:<400> but was:<114>
>   RestMetricsPropertyProviderTest.testRestMetricsPropertyProviderAsClusterAdministrator:142->testPopulateResourcesMany:404 expected:<400> but was:<285>
> Tests in error: 
>   PersistKeyValueImplTest.testMultiThreaded:103 » OutOfMemory unable to create n...
> Tests run: 3962, Failures: 2, Errors: 1, Skipped: 33
> 
> Need to mention that I got above failure even without my fix. But above testcases passed in Hadoop QA testing.
> 
> 
> Thanks,
> 
> Qin Liu
> 
>


Re: Review Request 44982: AMBARI-15430: alert_group table has service info after service has been removed

Posted by Qin Liu <qi...@gmail.com>.

> On April 1, 2016, 8:16 p.m., Jonathan Hurley wrote:
> > Ship It!

Jonathan,
We got 2 SHIPs. Can we push the fix?


- Qin


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


On April 1, 2016, 5:15 a.m., Qin Liu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44982/
> -----------------------------------------------------------
> 
> (Updated April 1, 2016, 5:15 a.m.)
> 
> 
> Review request for Ambari, Di Li and Jonathan Hurley.
> 
> 
> Bugs: AMBARI-15430
>     https://issues.apache.org/jira/browse/AMBARI-15430
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> If user deletes all the alert definitions for a service then deletes the service, the service info will be left in the alert_group table and user has to remove it later. The ServiceRemovedEvent handling code should perform proper clean_up by considering the case that the alert_definition and alert_group tables may be out of sync.
> 
> Steps to reproduce:
> 1. delete all the alert definitions for a service
> 2. stop the service
> 3. delete the service
> 4. check alert_group table and will see it will still have the service info
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceStateListener.java 496bb6b 
>   ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 785f0fb 
> 
> Diff: https://reviews.apache.org/r/44982/diff/
> 
> 
> Testing
> -------
> 
> Testcases:
> 1. One test is modified in EventsTest to verify to remove all alert data associated with the removed service in normal case.
> 2. Two tests are added in EventsTest to verify to remove all alert data associated with the removed service in case alert definitions and the default alert group for a service are out of sync:
> - Alert definitions for a service are deleted before the service is deleted
> - The default alert group for a service is deleted before the service is deleted
> 
> Testing:
> 1. The result of running modified EventsTest: 
> -------------------------------------------------------------------------------
> Test set: org.apache.ambari.server.events.EventsTest
> -------------------------------------------------------------------------------
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 103.88 sec - in org.apache.ambari.server.events.EventTest
> 
> 2. The result of running ambari-server tests:
> Failed tests: 
>   RestMetricsPropertyProviderTest.testRestMetricsPropertyProviderAsAdministrator:154->testPopulateResourcesMany:404 expected:<400> but was:<114>
>   RestMetricsPropertyProviderTest.testRestMetricsPropertyProviderAsClusterAdministrator:142->testPopulateResourcesMany:404 expected:<400> but was:<285>
> Tests in error: 
>   PersistKeyValueImplTest.testMultiThreaded:103 » OutOfMemory unable to create n...
> Tests run: 3962, Failures: 2, Errors: 1, Skipped: 33
> 
> Need to mention that I got above failure even without my fix. But above testcases passed in Hadoop QA testing.
> 
> 
> Thanks,
> 
> Qin Liu
> 
>


Re: Review Request 44982: AMBARI-15430: alert_group table has service info after service has been removed

Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44982/#review126642
-----------------------------------------------------------


Ship it!




Ship It!

- Jonathan Hurley


On April 1, 2016, 1:15 a.m., Qin Liu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44982/
> -----------------------------------------------------------
> 
> (Updated April 1, 2016, 1:15 a.m.)
> 
> 
> Review request for Ambari, Di Li and Jonathan Hurley.
> 
> 
> Bugs: AMBARI-15430
>     https://issues.apache.org/jira/browse/AMBARI-15430
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> If user deletes all the alert definitions for a service then deletes the service, the service info will be left in the alert_group table and user has to remove it later. The ServiceRemovedEvent handling code should perform proper clean_up by considering the case that the alert_definition and alert_group tables may be out of sync.
> 
> Steps to reproduce:
> 1. delete all the alert definitions for a service
> 2. stop the service
> 3. delete the service
> 4. check alert_group table and will see it will still have the service info
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceStateListener.java 496bb6b 
>   ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 785f0fb 
> 
> Diff: https://reviews.apache.org/r/44982/diff/
> 
> 
> Testing
> -------
> 
> Testcases:
> 1. One test is modified in EventsTest to verify to remove all alert data associated with the removed service in normal case.
> 2. Two tests are added in EventsTest to verify to remove all alert data associated with the removed service in case alert definitions and the default alert group for a service are out of sync:
> - Alert definitions for a service are deleted before the service is deleted
> - The default alert group for a service is deleted before the service is deleted
> 
> Testing:
> 1. The result of running modified EventsTest: 
> -------------------------------------------------------------------------------
> Test set: org.apache.ambari.server.events.EventsTest
> -------------------------------------------------------------------------------
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 103.88 sec - in org.apache.ambari.server.events.EventTest
> 
> 2. The result of running ambari-server tests:
> Failed tests: 
>   RestMetricsPropertyProviderTest.testRestMetricsPropertyProviderAsAdministrator:154->testPopulateResourcesMany:404 expected:<400> but was:<114>
>   RestMetricsPropertyProviderTest.testRestMetricsPropertyProviderAsClusterAdministrator:142->testPopulateResourcesMany:404 expected:<400> but was:<285>
> Tests in error: 
>   PersistKeyValueImplTest.testMultiThreaded:103 » OutOfMemory unable to create n...
> Tests run: 3962, Failures: 2, Errors: 1, Skipped: 33
> 
> Need to mention that I got above failure even without my fix. But above testcases passed in Hadoop QA testing.
> 
> 
> Thanks,
> 
> Qin Liu
> 
>


Re: Review Request 44982: AMBARI-15430: alert_group table has service info after service has been removed

Posted by Qin Liu <qi...@gmail.com>.

> On April 5, 2016, 1:16 a.m., Jayush Luniya wrote:
> > Ship It!

Jayush, Thank you for helping on this!


- Qin


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


On April 1, 2016, 5:15 a.m., Qin Liu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44982/
> -----------------------------------------------------------
> 
> (Updated April 1, 2016, 5:15 a.m.)
> 
> 
> Review request for Ambari, Di Li and Jonathan Hurley.
> 
> 
> Bugs: AMBARI-15430
>     https://issues.apache.org/jira/browse/AMBARI-15430
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> If user deletes all the alert definitions for a service then deletes the service, the service info will be left in the alert_group table and user has to remove it later. The ServiceRemovedEvent handling code should perform proper clean_up by considering the case that the alert_definition and alert_group tables may be out of sync.
> 
> Steps to reproduce:
> 1. delete all the alert definitions for a service
> 2. stop the service
> 3. delete the service
> 4. check alert_group table and will see it will still have the service info
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceStateListener.java 496bb6b 
>   ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 785f0fb 
> 
> Diff: https://reviews.apache.org/r/44982/diff/
> 
> 
> Testing
> -------
> 
> Testcases:
> 1. One test is modified in EventsTest to verify to remove all alert data associated with the removed service in normal case.
> 2. Two tests are added in EventsTest to verify to remove all alert data associated with the removed service in case alert definitions and the default alert group for a service are out of sync:
> - Alert definitions for a service are deleted before the service is deleted
> - The default alert group for a service is deleted before the service is deleted
> 
> Testing:
> 1. The result of running modified EventsTest: 
> -------------------------------------------------------------------------------
> Test set: org.apache.ambari.server.events.EventsTest
> -------------------------------------------------------------------------------
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 103.88 sec - in org.apache.ambari.server.events.EventTest
> 
> 2. The result of running ambari-server tests:
> Failed tests: 
>   RestMetricsPropertyProviderTest.testRestMetricsPropertyProviderAsAdministrator:154->testPopulateResourcesMany:404 expected:<400> but was:<114>
>   RestMetricsPropertyProviderTest.testRestMetricsPropertyProviderAsClusterAdministrator:142->testPopulateResourcesMany:404 expected:<400> but was:<285>
> Tests in error: 
>   PersistKeyValueImplTest.testMultiThreaded:103 » OutOfMemory unable to create n...
> Tests run: 3962, Failures: 2, Errors: 1, Skipped: 33
> 
> Need to mention that I got above failure even without my fix. But above testcases passed in Hadoop QA testing.
> 
> 
> Thanks,
> 
> Qin Liu
> 
>


Re: Review Request 44982: AMBARI-15430: alert_group table has service info after service has been removed

Posted by Jayush Luniya <jl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44982/#review126999
-----------------------------------------------------------


Ship it!




Ship It!

- Jayush Luniya


On April 1, 2016, 5:15 a.m., Qin Liu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44982/
> -----------------------------------------------------------
> 
> (Updated April 1, 2016, 5:15 a.m.)
> 
> 
> Review request for Ambari, Di Li and Jonathan Hurley.
> 
> 
> Bugs: AMBARI-15430
>     https://issues.apache.org/jira/browse/AMBARI-15430
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> If user deletes all the alert definitions for a service then deletes the service, the service info will be left in the alert_group table and user has to remove it later. The ServiceRemovedEvent handling code should perform proper clean_up by considering the case that the alert_definition and alert_group tables may be out of sync.
> 
> Steps to reproduce:
> 1. delete all the alert definitions for a service
> 2. stop the service
> 3. delete the service
> 4. check alert_group table and will see it will still have the service info
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceStateListener.java 496bb6b 
>   ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 785f0fb 
> 
> Diff: https://reviews.apache.org/r/44982/diff/
> 
> 
> Testing
> -------
> 
> Testcases:
> 1. One test is modified in EventsTest to verify to remove all alert data associated with the removed service in normal case.
> 2. Two tests are added in EventsTest to verify to remove all alert data associated with the removed service in case alert definitions and the default alert group for a service are out of sync:
> - Alert definitions for a service are deleted before the service is deleted
> - The default alert group for a service is deleted before the service is deleted
> 
> Testing:
> 1. The result of running modified EventsTest: 
> -------------------------------------------------------------------------------
> Test set: org.apache.ambari.server.events.EventsTest
> -------------------------------------------------------------------------------
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 103.88 sec - in org.apache.ambari.server.events.EventTest
> 
> 2. The result of running ambari-server tests:
> Failed tests: 
>   RestMetricsPropertyProviderTest.testRestMetricsPropertyProviderAsAdministrator:154->testPopulateResourcesMany:404 expected:<400> but was:<114>
>   RestMetricsPropertyProviderTest.testRestMetricsPropertyProviderAsClusterAdministrator:142->testPopulateResourcesMany:404 expected:<400> but was:<285>
> Tests in error: 
>   PersistKeyValueImplTest.testMultiThreaded:103 » OutOfMemory unable to create n...
> Tests run: 3962, Failures: 2, Errors: 1, Skipped: 33
> 
> Need to mention that I got above failure even without my fix. But above testcases passed in Hadoop QA testing.
> 
> 
> Thanks,
> 
> Qin Liu
> 
>