Re: Review Request 48670: Return well formatted error response while deleting host with clients installed.

2016-06-15 Thread Alejandro Fernandez

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


Ship it!




Ship It!

- Alejandro Fernandez


On June 14, 2016, 12:29 a.m., Ajit Kumar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/48670/
> ---
> 
> (Updated June 14, 2016, 12:29 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Jayush Luniya, and Sumit 
> Mohanty.
> 
> 
> Bugs: AMBARI-17210
> https://issues.apache.org/jira/browse/AMBARI-17210
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> Return well formatted error response while deleting host with clients 
> installed.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
>  46fc65295f72bae39c534cd9684f2d76d1e30224 
> 
> Diff: https://reviews.apache.org/r/48670/diff/
> 
> 
> Testing
> ---
> 
> Manual testing
> 
> delete 
> http://c6401.ambari.apache.org:8080/api/v1/clusters/c1/hosts/c6403.ambari.apache.org
> {
>   "status" : 500,
>   "message" : "org.apache.ambari.server.controller.spi.SystemException: An 
> internal system exception occurred: Cannot remove host 
> c6403.ambari.apache.org from c1.  The following roles exist, and these 
> components must be stopped if running, and then deleted: HDFS_CLIENT, 
> MAPREDUCE2_CLIENT, YARN_CLIENT, ZOOKEEPER_CLIENT"
> }
> 
> 
> Thanks,
> 
> Ajit Kumar
> 
>



Re: Review Request 48670: Return well formatted error response while deleting host with clients installed.

2016-06-15 Thread Ajit Kumar


> On June 15, 2016, 9:23 p.m., Alejandro Fernandez wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java,
> >  line 930
> > 
> >
> > I also talked to Sumit, we're not going to distinguish between clients 
> > so any components should cause a failure.

Thanks. As we won't be differentiating b/w client and other components, this 
patch will result in error message for clients as for other components. I'll 
push this patch.


- Ajit


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


On June 14, 2016, 12:29 a.m., Ajit Kumar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/48670/
> ---
> 
> (Updated June 14, 2016, 12:29 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Jayush Luniya, and Sumit 
> Mohanty.
> 
> 
> Bugs: AMBARI-17210
> https://issues.apache.org/jira/browse/AMBARI-17210
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> Return well formatted error response while deleting host with clients 
> installed.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
>  46fc65295f72bae39c534cd9684f2d76d1e30224 
> 
> Diff: https://reviews.apache.org/r/48670/diff/
> 
> 
> Testing
> ---
> 
> Manual testing
> 
> delete 
> http://c6401.ambari.apache.org:8080/api/v1/clusters/c1/hosts/c6403.ambari.apache.org
> {
>   "status" : 500,
>   "message" : "org.apache.ambari.server.controller.spi.SystemException: An 
> internal system exception occurred: Cannot remove host 
> c6403.ambari.apache.org from c1.  The following roles exist, and these 
> components must be stopped if running, and then deleted: HDFS_CLIENT, 
> MAPREDUCE2_CLIENT, YARN_CLIENT, ZOOKEEPER_CLIENT"
> }
> 
> 
> Thanks,
> 
> Ajit Kumar
> 
>



Re: Review Request 48670: Return well formatted error response while deleting host with clients installed.

2016-06-14 Thread Sumit Mohanty

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




ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
 


Basically, the host delete call fails if master and slaves exist (no matter 
whats the state). So it did not make much sense to allow host delete if they 
have just clients. Rather:
- let host delete fail if any host component exist
- allow a bulk delete of host components


- Sumit Mohanty


On June 14, 2016, 12:29 a.m., Ajit Kumar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/48670/
> ---
> 
> (Updated June 14, 2016, 12:29 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Jayush Luniya, and Sumit 
> Mohanty.
> 
> 
> Bugs: AMBARI-17210
> https://issues.apache.org/jira/browse/AMBARI-17210
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> Return well formatted error response while deleting host with clients 
> installed.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
>  46fc65295f72bae39c534cd9684f2d76d1e30224 
> 
> Diff: https://reviews.apache.org/r/48670/diff/
> 
> 
> Testing
> ---
> 
> Manual testing
> 
> delete 
> http://c6401.ambari.apache.org:8080/api/v1/clusters/c1/hosts/c6403.ambari.apache.org
> {
>   "status" : 500,
>   "message" : "org.apache.ambari.server.controller.spi.SystemException: An 
> internal system exception occurred: Cannot remove host 
> c6403.ambari.apache.org from c1.  The following roles exist, and these 
> components must be stopped if running, and then deleted: HDFS_CLIENT, 
> MAPREDUCE2_CLIENT, YARN_CLIENT, ZOOKEEPER_CLIENT"
> }
> 
> 
> Thanks,
> 
> Ajit Kumar
> 
>



Re: Review Request 48670: Return well formatted error response while deleting host with clients installed.

2016-06-14 Thread Ajit Kumar


> On June 14, 2016, 11:54 p.m., Alejandro Fernandez wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java,
> >  line 930
> > 
> >
> > How is this a fix?
> > If a host has any masters, we shouldn't allow deleting it. Slaves must 
> > be stopped. Clients can be in any state.

I had a discussion with Sumit and we aggreed on failing even for clients.


- Ajit


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


On June 14, 2016, 12:29 a.m., Ajit Kumar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/48670/
> ---
> 
> (Updated June 14, 2016, 12:29 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Jayush Luniya, and Sumit 
> Mohanty.
> 
> 
> Bugs: AMBARI-17210
> https://issues.apache.org/jira/browse/AMBARI-17210
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> Return well formatted error response while deleting host with clients 
> installed.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
>  46fc65295f72bae39c534cd9684f2d76d1e30224 
> 
> Diff: https://reviews.apache.org/r/48670/diff/
> 
> 
> Testing
> ---
> 
> Manual testing
> 
> delete 
> http://c6401.ambari.apache.org:8080/api/v1/clusters/c1/hosts/c6403.ambari.apache.org
> {
>   "status" : 500,
>   "message" : "org.apache.ambari.server.controller.spi.SystemException: An 
> internal system exception occurred: Cannot remove host 
> c6403.ambari.apache.org from c1.  The following roles exist, and these 
> components must be stopped if running, and then deleted: HDFS_CLIENT, 
> MAPREDUCE2_CLIENT, YARN_CLIENT, ZOOKEEPER_CLIENT"
> }
> 
> 
> Thanks,
> 
> Ajit Kumar
> 
>



Re: Review Request 48670: Return well formatted error response while deleting host with clients installed.

2016-06-14 Thread Alejandro Fernandez

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




ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
 


How is this a fix?
If a host has any masters, we shouldn't allow deleting it. Slaves must be 
stopped. Clients can be in any state.


- Alejandro Fernandez


On June 14, 2016, 12:29 a.m., Ajit Kumar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/48670/
> ---
> 
> (Updated June 14, 2016, 12:29 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Jayush Luniya, and Sumit 
> Mohanty.
> 
> 
> Bugs: AMBARI-17210
> https://issues.apache.org/jira/browse/AMBARI-17210
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> Return well formatted error response while deleting host with clients 
> installed.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
>  46fc65295f72bae39c534cd9684f2d76d1e30224 
> 
> Diff: https://reviews.apache.org/r/48670/diff/
> 
> 
> Testing
> ---
> 
> Manual testing
> 
> delete 
> http://c6401.ambari.apache.org:8080/api/v1/clusters/c1/hosts/c6403.ambari.apache.org
> {
>   "status" : 500,
>   "message" : "org.apache.ambari.server.controller.spi.SystemException: An 
> internal system exception occurred: Cannot remove host 
> c6403.ambari.apache.org from c1.  The following roles exist, and these 
> components must be stopped if running, and then deleted: HDFS_CLIENT, 
> MAPREDUCE2_CLIENT, YARN_CLIENT, ZOOKEEPER_CLIENT"
> }
> 
> 
> Thanks,
> 
> Ajit Kumar
> 
>



Review Request 48670: Return well formatted error response while deleting host with clients installed.

2016-06-13 Thread Ajit Kumar

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

Review request for Ambari, Alejandro Fernandez, Jayush Luniya, and Sumit 
Mohanty.


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


Repository: ambari


Description
---

Return well formatted error response while deleting host with clients installed.


Diffs
-

  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
 46fc65295f72bae39c534cd9684f2d76d1e30224 

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


Testing
---

Manual testing

delete 
http://c6401.ambari.apache.org:8080/api/v1/clusters/c1/hosts/c6403.ambari.apache.org
{
  "status" : 500,
  "message" : "org.apache.ambari.server.controller.spi.SystemException: An 
internal system exception occurred: Cannot remove host c6403.ambari.apache.org 
from c1.  The following roles exist, and these components must be stopped if 
running, and then deleted: HDFS_CLIENT, MAPREDUCE2_CLIENT, YARN_CLIENT, 
ZOOKEEPER_CLIENT"
}


Thanks,

Ajit Kumar