> On Dec. 22, 2014, 10:24 p.m., Tom Beerbower wrote: > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java, > > line 196 > > <https://reviews.apache.org/r/29324/diff/1/?file=798888#file798888line196> > > > > Unless you ask for minimal response, I'm not sure how it is possible to > > query for a host_component without the host name. Do you know what the > > request and predicate look like in this case? > > > > Is the query done with minimal_response=true? > > > > I'm assuming that there is some edge case like that where this makes a > > difference. If that is the case then I'm okay with the change. I think > > that it should be harmless since a host component query would return host > > name in almost every case anyway, I think.
When we do retry during cluster install we have following request: http://c6401.ambari.apache.org:8080/api/v1/clusters/c1/host_components?HostRoles/state=INSTALLED {"RequestInfo":{"context":"Install Components","operation_level":{"level":"CLUSTER","cluster_name":"c1"}},"Body":{"HostRoles":{"state":"INSTALLED"}}} so there is no hostname and this causes errors > On Dec. 22, 2014, 10:24 p.m., Tom Beerbower wrote: > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java, > > line 603 > > <https://reviews.apache.org/r/29324/diff/1/?file=798888#file798888line603> > > > > Any idea why the predicate was being evaluated here? I just wonder if > > it was part of some performance optimization that we may be undoing. I'm > > fine with removing it if you have tested it. Generally it looks ok to test predicate here but in fact we have inconsistency with state/desiredstate when state in predicate means desiredState in queryResource. - Dmitro ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29324/#review65829 ----------------------------------------------------------- On Dec. 22, 2014, 9:17 p.m., Dmitro Lisnichenko wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/29324/ > ----------------------------------------------------------- > > (Updated Dec. 22, 2014, 9:17 p.m.) > > > Review request for Ambari, Dmytro Sen and Nate Cole. > > > Bugs: AMBARI-8868 > https://issues.apache.org/jira/browse/AMBARI-8868 > > > Repository: ambari > > > Description > ------- > > PUT /api/v1/clusters/y1/host_components?HostRoles/state=INSTALLED > Form Data: > {"RequestInfo":{"context":"Install > Components","operation_level":{"level":"CLUSTER","cluster_name":"y1"}},"Body":{"HostRoles": > {"state":"INSTALLED"} > }} > Server response: > { "status" : 400, "message" : "java.lang.IllegalArgumentException: Invalid > arguments, cluster name, component name and host name should be provided" } > I saw another failure pattern where the same call returns 500. > Please try testing this scenario end to end with the UI. > You can just do a single node install and force invoke failure by renaming > /var/lib/ambari-agent dir, for example. > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java > 47d3f70 > > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java > 0ffc6e1 > > Diff: https://reviews.apache.org/r/29324/diff/ > > > Testing > ------- > > in progress > > > Thanks, > > Dmitro Lisnichenko > >
