-----------------------------------------------------------
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