-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56627/#review165833
-----------------------------------------------------------
Yes Robert is right, so there's no such validation because in general is not
necessary to have all hosts from all hostgroups. For ex. let's say you have a
'worker' hostgroup which contains only Slave or Client components and you want
to add hosts to this hostgroup later. In this case cluster deployment is
started.
If you check ConfigureClusterTask.getTopologyRequiredHostGroups() basically
those are the hostgroups that are required to start configurations and these
are typically hostgroups containing Master components.
So if want to validate then we should validate these host groups are in
Cluster template. The problem is that you can retrive this from
ClusterConfigurationRequest.getRequiredHostGroups() which is created in
TopologyManager.provisionCluster() (line:304) so at a later point then
validateTopology, when cluster resources are already created. So in order to
retrieve required HostGroups we need to create a lot of things like
Cluster/components in db/memory which we need to revert all in case of throwing
an exception from here TopologyManager.provisionCluster() (line:304).
Another approach would be to check required HostGroups at the end of
TopologyManager.provisionCluster() and in case of missing required hgroups we
can return a message about this problem, which user can correct by sending a
scale request specifying host(s) for missing hgroups.
- Sandor Magyari
On Feb. 15, 2017, 7:30 p.m., Amruta Borkar wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56627/
> -----------------------------------------------------------
>
> (Updated Feb. 15, 2017, 7:30 p.m.)
>
>
> Review request for Ambari, Di Li, Robert Nettleton, and Sandor Magyari.
>
>
> Bugs: AMBARI-19991
> https://issues.apache.org/jira/browse/AMBARI-19991
>
>
> Repository: ambari
>
>
> Description
> -------
>
> Cluster creation REST API request gets accepted when, cluster template does
> not list all the host_groups mentioned in the blueprint. But cluster
> deployment fails showing error message in the logs
> Caused by: java.lang.IllegalArgumentException:
> TopologyManager.ConfigureClusterTask - prerequisites for config request
> processing not yet satisfied
> at
> org.apache.ambari.server.topology.TopologyManager$ConfigureClusterTask.call(TopologyManager.java:908)
> at
> org.apache.ambari.server.topology.TopologyManager$ConfigureClusterTask.call(TopologyManager.java:889)
>
>
> Diffs
> -----
>
>
> ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterTopologyImpl.java
> d0a4df9
>
> ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterTopologyImplTest.java
> 1f31d05
>
> Diff: https://reviews.apache.org/r/56627/diff/
>
>
> Testing
> -------
>
> Tested manually, updated test cases
>
>
> Thanks,
>
> Amruta Borkar
>
>