Aleksandr Kovalenko created AMBARI-3668:
-------------------------------------------

             Summary: Reassign Master: Parse create component resource and 
delete component resource request response on failure.
                 Key: AMBARI-3668
                 URL: https://issues.apache.org/jira/browse/AMBARI-3668
             Project: Ambari
          Issue Type: Task
          Components: client
    Affects Versions: 1.4.2
            Reporter: Aleksandr Kovalenko
            Assignee: Aleksandr Kovalenko
             Fix For: 1.4.2


h5. Resource create request:
Reassign Master wizard Step-4: Configure Components has a command that creates 
component resource on the target host and it's displayed as Create <component 
name>.
If this API results in failure because the resource already exists, then we 
receive json response:

{
  "status" : 409,
  "message" : 
"org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException: 
Attempted to create a host_component which already exists: \[clusterName=c1, 
hostName=c6402.ambari.apache.org, componentName=ZOOKEEPER_SERVER]"
}

Parse the response on API failure and if it's because of  
org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException then 
*mark the command as successful instead of failed*.

h5. Resource delete request:
We have a delete disabled <component_name> command on either step4 (if there 
are no manual steps) or step6 (if there are manual steps).
If the command fails because the resource is already deleted then the json 
response received is:

{
  "status" : 404,
  "message" : "org.apache.ambari.server.controller.spi.NoSuchResourceException: 
The specified resource doesn't exist: ServiceComponentHost not found, 
clusterName=c1, serviceName=HDFS, serviceComponentName=NAMENODE, 
hostName=c6402.ambari.apache.org"
}


Parse the response on API failure and if it's because of  
org.apache.ambari.server.controller.spi.NoSuchResourceException then *mark the 
command as successful instead of failed*.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to