Re: Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-13 Thread Oliver Szabo

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

(Updated May 13, 2016, 3:14 p.m.)


Review request for Ambari, Jonathan Hurley, Laszlo Puskas, Myroslav 
Papirkovskyy, Sumit Mohanty, and Sebastian Toader.


Changes
---

- fix tests and add branch-2.4


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


Repository: ambari


Description
---

2 different type of errors can occur during adding any new service to Ambari:

org.apache.ambari.server.AmbariException: Unable to create a default alert 
group for unknown service  in cluster

org.apache.ambari.server.ServiceNotFoundException: Service not found, 
clusterName=c1, serviceName=

The reason is that: ServiceInstalledEvent can be handled quicker than 
ServiceImpl.persist() can finish


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
 47342f3 
  ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 
303b043 
  ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
487489b 
  
ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
 108732f 
  ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 
a3d05a9 
  ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 
19146fd 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
 d1b27a9 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
 1875ba6 
  
ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
 e7cbd99 

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


Testing
---

Unit Testing is in progress..
FT: deploy cluster, add service, restart ambari with deployed cluster.


Thanks,

Oliver Szabo



Re: Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-12 Thread Jonathan Hurley

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


Ship it!




Ship It!

- Jonathan Hurley


On May 12, 2016, 8:58 a.m., Oliver Szabo wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46944/
> ---
> 
> (Updated May 12, 2016, 8:58 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Laszlo Puskas, Myroslav 
> Papirkovskyy, Sumit Mohanty, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-16230
> https://issues.apache.org/jira/browse/AMBARI-16230
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> 2 different type of errors can occur during adding any new service to Ambari:
> 
> org.apache.ambari.server.AmbariException: Unable to create a default alert 
> group for unknown service  in cluster
> 
> org.apache.ambari.server.ServiceNotFoundException: Service not found, 
> clusterName=c1, serviceName=
> 
> The reason is that: ServiceInstalledEvent can be handled quicker than 
> ServiceImpl.persist() can finish
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
>  47342f3 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 
> 303b043 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
> 487489b 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
>  108732f 
>   ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 
> a3d05a9 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 
> 19146fd 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
>  d1b27a9 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
>  1875ba6 
> 
> Diff: https://reviews.apache.org/r/46944/diff/
> 
> 
> Testing
> ---
> 
> Unit Testing is in progress..
> FT: deploy cluster, add service, restart ambari with deployed cluster.
> 
> 
> Thanks,
> 
> Oliver Szabo
> 
>



Re: Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-12 Thread Sebastian Toader

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


Ship it!




Ship It!

- Sebastian Toader


On May 12, 2016, 2:58 p.m., Oliver Szabo wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46944/
> ---
> 
> (Updated May 12, 2016, 2:58 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Laszlo Puskas, Myroslav 
> Papirkovskyy, Sumit Mohanty, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-16230
> https://issues.apache.org/jira/browse/AMBARI-16230
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> 2 different type of errors can occur during adding any new service to Ambari:
> 
> org.apache.ambari.server.AmbariException: Unable to create a default alert 
> group for unknown service  in cluster
> 
> org.apache.ambari.server.ServiceNotFoundException: Service not found, 
> clusterName=c1, serviceName=
> 
> The reason is that: ServiceInstalledEvent can be handled quicker than 
> ServiceImpl.persist() can finish
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
>  47342f3 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 
> 303b043 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
> 487489b 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
>  108732f 
>   ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 
> a3d05a9 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 
> 19146fd 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
>  d1b27a9 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
>  1875ba6 
> 
> Diff: https://reviews.apache.org/r/46944/diff/
> 
> 
> Testing
> ---
> 
> Unit Testing is in progress..
> FT: deploy cluster, add service, restart ambari with deployed cluster.
> 
> 
> Thanks,
> 
> Oliver Szabo
> 
>



Re: Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-12 Thread Oliver Szabo

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

(Updated May 12, 2016, 12:58 p.m.)


Review request for Ambari, Jonathan Hurley, Laszlo Puskas, Myroslav 
Papirkovskyy, Sumit Mohanty, and Sebastian Toader.


Changes
---

- removed the catch part from ServiceImpl#persist(), if the "Service already 
exists" is not needed, then we cannot get an AmbariException.


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


Repository: ambari


Description
---

2 different type of errors can occur during adding any new service to Ambari:

org.apache.ambari.server.AmbariException: Unable to create a default alert 
group for unknown service  in cluster

org.apache.ambari.server.ServiceNotFoundException: Service not found, 
clusterName=c1, serviceName=

The reason is that: ServiceInstalledEvent can be handled quicker than 
ServiceImpl.persist() can finish


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
 47342f3 
  ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 
303b043 
  ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
487489b 
  
ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
 108732f 
  ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 
a3d05a9 
  ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 
19146fd 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
 d1b27a9 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
 1875ba6 

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


Testing
---

Unit Testing is in progress..
FT: deploy cluster, add service, restart ambari with deployed cluster.


Thanks,

Oliver Szabo



Re: Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-12 Thread Sebastian Toader

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


Fix it, then Ship it!





ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
(line 489)


This error log is missleading if the exception is thrown after 
```cluster.addService```. It might be better to separate out the event 
publishing logic and call it only of the persist succeeded.



ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
 


Why 
```
if (services.containsKey(service.getName())) {
throw new AmbariException("Service already exists" + ", 
clusterName="
+ getClusterName() + ", clusterId=" + getClusterId()
+ ", serviceName=" + service.getName());
  }
```
is not needed any more? Is it a valid use case to re-add a service to an 
existing cluster?


- Sebastian Toader


On May 12, 2016, 12:48 a.m., Oliver Szabo wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46944/
> ---
> 
> (Updated May 12, 2016, 12:48 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Laszlo Puskas, Myroslav 
> Papirkovskyy, Sumit Mohanty, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-16230
> https://issues.apache.org/jira/browse/AMBARI-16230
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> 2 different type of errors can occur during adding any new service to Ambari:
> 
> org.apache.ambari.server.AmbariException: Unable to create a default alert 
> group for unknown service  in cluster
> 
> org.apache.ambari.server.ServiceNotFoundException: Service not found, 
> clusterName=c1, serviceName=
> 
> The reason is that: ServiceInstalledEvent can be handled quicker than 
> ServiceImpl.persist() can finish
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
>  47342f3 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
> 487489b 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
>  108732f 
>   ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 
> a3d05a9 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 
> 19146fd 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
>  d1b27a9 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
>  1875ba6 
> 
> Diff: https://reviews.apache.org/r/46944/diff/
> 
> 
> Testing
> ---
> 
> Unit Testing is in progress..
> FT: deploy cluster, add service, restart ambari with deployed cluster.
> 
> 
> Thanks,
> 
> Oliver Szabo
> 
>



Re: Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-11 Thread Oliver Szabo

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

(Updated May 11, 2016, 10:48 p.m.)


Review request for Ambari, Jonathan Hurley, Laszlo Puskas, Myroslav 
Papirkovskyy, Sumit Mohanty, and Sebastian Toader.


Changes
---

- there was a stackoverflow exception during ambari-server start in that case 
if you have a cluster already, therefore I put back the loadServices for their 
original places.
- I removed an unnecessary check in the ClusterImpl#addService (check service 
already exists). Only ServiceImpl#persist() use addService method and that is 
only called from ServiceResourceProvider. Before adding a service, the provider 
validates that service already exists or not, so that check is not needed at 
all. (other usages are all from tests)


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


Repository: ambari


Description
---

2 different type of errors can occur during adding any new service to Ambari:

org.apache.ambari.server.AmbariException: Unable to create a default alert 
group for unknown service  in cluster

org.apache.ambari.server.ServiceNotFoundException: Service not found, 
clusterName=c1, serviceName=

The reason is that: ServiceInstalledEvent can be handled quicker than 
ServiceImpl.persist() can finish


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
 47342f3 
  ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
487489b 
  
ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
 108732f 
  ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 
a3d05a9 
  ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 
19146fd 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
 d1b27a9 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
 1875ba6 

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


Testing (updated)
---

Unit Testing is in progress..
FT: deploy cluster, add service, restart ambari with deployed cluster.


Thanks,

Oliver Szabo



Re: Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-10 Thread Myroslav Papirkovskyy

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


Ship it!




Ship It!

- Myroslav Papirkovskyy


On Травень 10, 2016, 7:19 після полудня, Oliver Szabo wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46944/
> ---
> 
> (Updated Травень 10, 2016, 7:19 після полудня)
> 
> 
> Review request for Ambari, Jonathan Hurley, Laszlo Puskas, Myroslav 
> Papirkovskyy, Sumit Mohanty, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-16230
> https://issues.apache.org/jira/browse/AMBARI-16230
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> 2 different type of errors can occur during adding any new service to Ambari:
> 
> org.apache.ambari.server.AmbariException: Unable to create a default alert 
> group for unknown service  in cluster
> 
> org.apache.ambari.server.ServiceNotFoundException: Service not found, 
> clusterName=c1, serviceName=
> 
> The reason is that: ServiceInstalledEvent can be handled quicker than 
> ServiceImpl.persist() can finish
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
>  47342f3 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
> 487489b 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
>  f38c25a 
>   ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 
> a3d05a9 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 
> 19146fd 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
>  d1b27a9 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
>  1875ba6 
> 
> Diff: https://reviews.apache.org/r/46944/diff/
> 
> 
> Testing
> ---
> 
> Unit Testing is in progress..
> FT: added new services about 10 times, has no any errors thrown.
> 
> 
> Thanks,
> 
> Oliver Szabo
> 
>



Re: Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-10 Thread Oliver Szabo

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

(Updated May 10, 2016, 4:19 p.m.)


Review request for Ambari, Jonathan Hurley, Laszlo Puskas, Myroslav 
Papirkovskyy, Sumit Mohanty, and Sebastian Toader.


Changes
---

removed volatile keyword


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


Repository: ambari


Description
---

2 different type of errors can occur during adding any new service to Ambari:

org.apache.ambari.server.AmbariException: Unable to create a default alert 
group for unknown service  in cluster

org.apache.ambari.server.ServiceNotFoundException: Service not found, 
clusterName=c1, serviceName=

The reason is that: ServiceInstalledEvent can be handled quicker than 
ServiceImpl.persist() can finish


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
 47342f3 
  ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
487489b 
  
ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
 f38c25a 
  ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 
a3d05a9 
  ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 
19146fd 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
 d1b27a9 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
 1875ba6 

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


Testing
---

Unit Testing is in progress..
FT: added new services about 10 times, has no any errors thrown.


Thanks,

Oliver Szabo



Re: Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-05 Thread Sebastian Toader

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


Ship it!




Ship It!

- Sebastian Toader


On May 5, 2016, 3:26 p.m., Oliver Szabo wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46944/
> ---
> 
> (Updated May 5, 2016, 3:26 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Laszlo Puskas, Myroslav 
> Papirkovskyy, Sumit Mohanty, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-16230
> https://issues.apache.org/jira/browse/AMBARI-16230
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> 2 different type of errors can occur during adding any new service to Ambari:
> 
> org.apache.ambari.server.AmbariException: Unable to create a default alert 
> group for unknown service  in cluster
> 
> org.apache.ambari.server.ServiceNotFoundException: Service not found, 
> clusterName=c1, serviceName=
> 
> The reason is that: ServiceInstalledEvent can be handled quicker than 
> ServiceImpl.persist() can finish
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
>  47342f3 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
> 487489b 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
>  f38c25a 
>   ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 
> a3d05a9 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 
> 19146fd 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
>  d1b27a9 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
>  1875ba6 
> 
> Diff: https://reviews.apache.org/r/46944/diff/
> 
> 
> Testing
> ---
> 
> Unit Testing is in progress..
> FT: added new services about 10 times, has no any errors thrown.
> 
> 
> Thanks,
> 
> Oliver Szabo
> 
>



Re: Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-05 Thread Jonathan Hurley

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


Ship it!





ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
 (line 328)


Since this is now only being done in the constructor, I don't think this 
needs to be volatile anymore:

private volatile Map services = null;


- Jonathan Hurley


On May 5, 2016, 8:47 a.m., Oliver Szabo wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46944/
> ---
> 
> (Updated May 5, 2016, 8:47 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Laszlo Puskas, Myroslav 
> Papirkovskyy, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-16230
> https://issues.apache.org/jira/browse/AMBARI-16230
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> 2 different type of errors can occur during adding any new service to Ambari:
> 
> org.apache.ambari.server.AmbariException: Unable to create a default alert 
> group for unknown service  in cluster
> 
> org.apache.ambari.server.ServiceNotFoundException: Service not found, 
> clusterName=c1, serviceName=
> 
> The reason is that: ServiceInstalledEvent can be handled quicker than 
> ServiceImpl.persist() can finish
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
>  47342f3 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
> 487489b 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
>  f38c25a 
>   ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 
> a3d05a9 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 
> 19146fd 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
>  d1b27a9 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
>  1875ba6 
> 
> Diff: https://reviews.apache.org/r/46944/diff/
> 
> 
> Testing
> ---
> 
> Unit Testing is in progress..
> FT: added new services about 10 times, has no any errors thrown.
> 
> 
> Thanks,
> 
> Oliver Szabo
> 
>



Re: Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-05 Thread Oliver Szabo

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

(Updated May 5, 2016, 12:47 p.m.)


Review request for Ambari, Jonathan Hurley, Laszlo Puskas, Myroslav 
Papirkovskyy, and Sebastian Toader.


Changes
---

- updated unit tests
- when I added the first service, a Service already exits occurred, that was 
because the service has already persited in the database, and 
ClusterImpl#loadServices() method fill the services map with the services 
(based on ClusterServiceEntity). loadServices() only does anything when 
services == null, so I moved loadServices() to the constructor (and removed 
every occurrence of it from other methods), only ClusterImpl#invalidateData() 
set services to null, so I put loadServices() to the end of that method. (it 
should work because every operation read-write locked there)
- another solution here: (instead of removing loadServices() methods) add an 
extra String pameter to loadServices() called e.g. newService, and that service 
would be filtered out when the method adding services to the services map.


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


Repository: ambari


Description
---

2 different type of errors can occur during adding any new service to Ambari:

org.apache.ambari.server.AmbariException: Unable to create a default alert 
group for unknown service  in cluster

org.apache.ambari.server.ServiceNotFoundException: Service not found, 
clusterName=c1, serviceName=

The reason is that: ServiceInstalledEvent can be handled quicker than 
ServiceImpl.persist() can finish


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
 47342f3 
  ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
487489b 
  
ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
 f38c25a 
  ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 
a3d05a9 
  ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 
19146fd 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
 d1b27a9 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
 1875ba6 

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


Testing
---

Unit Testing is in progress..
FT: added new services about 10 times, has no any errors thrown.


Thanks,

Oliver Szabo



Re: Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-04 Thread Jonathan Hurley

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


Ship it!




Ship It!

- Jonathan Hurley


On May 4, 2016, 5:09 p.m., Oliver Szabo wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46944/
> ---
> 
> (Updated May 4, 2016, 5:09 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Laszlo Puskas, and Sebastian 
> Toader.
> 
> 
> Bugs: AMBARI-16230
> https://issues.apache.org/jira/browse/AMBARI-16230
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> 2 different type of errors can occur during adding any new service to Ambari:
> 
> org.apache.ambari.server.AmbariException: Unable to create a default alert 
> group for unknown service  in cluster
> 
> org.apache.ambari.server.ServiceNotFoundException: Service not found, 
> clusterName=c1, serviceName=
> 
> The reason is that: ServiceInstalledEvent can be handled quicker than 
> ServiceImpl.persist() can finish
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
>  47342f3 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
> 487489b 
> 
> Diff: https://reviews.apache.org/r/46944/diff/
> 
> 
> Testing
> ---
> 
> Unit Testing is in progress..
> FT: added new services about 10 times, has no any errors thrown.
> 
> 
> Thanks,
> 
> Oliver Szabo
> 
>



Re: Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-04 Thread Jonathan Hurley


> On May 4, 2016, 10:07 a.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java,
> >  lines 360-361
> > 
> >
> > Might want to try/catch the persist() and reload the cluster service 
> > map in that case. 
> > 
> > Here's a scenario:
> > - You add the service to the cluster
> > - You persist the service which throws an exception
> > - You can't add the service again since the cluster thinks it has it 
> > already
> > 
> > Now this problem actually existed before as well. Just because 
> > persist() was being called before `cluster.addService()` doesn't mean it 
> > happened at that point. EclipseLink was cache the call until it needed to 
> > flush it. So even the code as it existed today was problematic.
> 
> Oliver Szabo wrote:
> what if I add this line to ServiceImpl#persist() method : 
> cluster.addService(this) , just before ServiceInstalledEvent is published? 
> (and remove addService from ServiceResourceProvider)

I like that approach - separates the concerns a bit better since the 
relationship between Cluster and Service shouldn't be up to the 
ResourceProvider.


- Jonathan


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


On May 3, 2016, 3:36 p.m., Oliver Szabo wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46944/
> ---
> 
> (Updated May 3, 2016, 3:36 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Laszlo Puskas, and Sebastian 
> Toader.
> 
> 
> Bugs: AMBARI-16230
> https://issues.apache.org/jira/browse/AMBARI-16230
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> 2 different type of errors can occur during adding any new service to Ambari:
> 
> org.apache.ambari.server.AmbariException: Unable to create a default alert 
> group for unknown service  in cluster
> 
> org.apache.ambari.server.ServiceNotFoundException: Service not found, 
> clusterName=c1, serviceName=
> 
> The reason is that: ServiceInstalledEvent can be handled quicker than 
> ServiceImpl.persist() can finish
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
>  47342f3 
> 
> Diff: https://reviews.apache.org/r/46944/diff/
> 
> 
> Testing
> ---
> 
> Unit Testing is in progress..
> FT: added new services about 10 times, has no any errors thrown.
> 
> 
> Thanks,
> 
> Oliver Szabo
> 
>



Re: Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-03 Thread Ajit Kumar

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


Ship it!




Ship It!

- Ajit Kumar


On May 3, 2016, 7:36 p.m., Oliver Szabo wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46944/
> ---
> 
> (Updated May 3, 2016, 7:36 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Laszlo Puskas, and Sebastian 
> Toader.
> 
> 
> Bugs: AMBARI-16230
> https://issues.apache.org/jira/browse/AMBARI-16230
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> 2 different type of errors can occur during adding any new service to Ambari:
> 
> org.apache.ambari.server.AmbariException: Unable to create a default alert 
> group for unknown service  in cluster
> 
> org.apache.ambari.server.ServiceNotFoundException: Service not found, 
> clusterName=c1, serviceName=
> 
> The reason is that: ServiceInstalledEvent can be handled quicker than 
> ServiceImpl.persist() can finish
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
>  47342f3 
> 
> Diff: https://reviews.apache.org/r/46944/diff/
> 
> 
> Testing
> ---
> 
> Unit Testing is in progress..
> FT: added new services about 10 times, has no any errors thrown.
> 
> 
> Thanks,
> 
> Oliver Szabo
> 
>



Review Request 46944: AMBARI-16230: Sporadic errors when deploying the cluster

2016-05-03 Thread Oliver Szabo

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

Review request for Ambari, Jonathan Hurley, Laszlo Puskas, and Sebastian Toader.


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


Repository: ambari


Description
---

2 different type of errors can occur during adding any new service to Ambari:

org.apache.ambari.server.AmbariException: Unable to create a default alert 
group for unknown service  in cluster

org.apache.ambari.server.ServiceNotFoundException: Service not found, 
clusterName=c1, serviceName=

The reason is that: ServiceInstalledEvent can be handled quicker than 
ServiceImpl.persist() can finish


Diffs
-

  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
 47342f3 

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


Testing
---

Unit Testing is in progress..
FT: added new services about 10 times, has no any errors thrown.


Thanks,

Oliver Szabo