[ 
https://issues.apache.org/jira/browse/AMBARI-7442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14157221#comment-14157221
 ] 

jun aoki commented on AMBARI-7442:
----------------------------------

The patch was made out of git format-patch thus Hadoop QA fails. git diff 
should work.

I have applied the patch and verified it solves this particular issue.

LGTM +1

However, I have a concern at a higher level. 
Since [ActionMetadata is 
singleton|https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/java/org/apache/ambari/server/metadata/ActionMetadata.java],
 serviceActions is used globally and stack command like 
ZOOKEEPER_QUORUM_SERVICE_CHECK is applicable on any combination of 
stack+version.

if I understand right, each stack command should be defined by stack+version 
from this
{code}
jaoki@jaoki-ubuntu:~/coding/ambari/ambari-server/src/main/resources/stacks$ pwd
/home/jaoki/coding/ambari/ambari-server/src/main/resources/stacks
jaoki@jaoki-ubuntu:~/coding/ambari/ambari-server/src/main/resources/stacks$ 
find -type f 2>/dev/null | xargs grep --color ZOOKEEPER_QUORUM_SERVICE_CHECK
./HDP/2.0/role_command_order.json:    
"ZOOKEEPER_QUORUM_SERVICE_CHECK-SERVICE_CHECK": ["ZOOKEEPER_SERVER-START"],
./HDP/2.0.6/role_command_order.json:    
"ZOOKEEPER_QUORUM_SERVICE_CHECK-SERVICE_CHECK": ["ZOOKEEPER_SERVER-START"],
./HDP/1.3.3/role_command_order.json:    
"ZOOKEEPER_QUORUM_SERVICE_CHECK-SERVICE_CHECK": ["ZOOKEEPER_SERVER-START"],
./HDP/2.0.6.GlusterFS/role_command_order.json:    
"ZOOKEEPER_QUORUM_SERVICE_CHECK-SERVICE_CHECK": ["ZOOKEEPER_SERVER-START"],
./HDP/2.1.GlusterFS/role_command_order.json:    
"ZOOKEEPER_QUORUM_SERVICE_CHECK-SERVICE_CHECK": ["ZOOKEEPER_SERVER-START"],
./HDP/1.3/role_command_order.json:    
"ZOOKEEPER_QUORUM_SERVICE_CHECK-SERVICE_CHECK": ["ZOOKEEPER_SERVER-START"],
./HDP/2.1/role_command_order.json:    
"ZOOKEEPER_QUORUM_SERVICE_CHECK-SERVICE_CHECK": ["ZOOKEEPER_SERVER-START"],
./HDP/1.3.2/role_command_order.json:    
"ZOOKEEPER_QUORUM_SERVICE_CHECK-SERVICE_CHECK": ["ZOOKEEPER_SERVER-START"],
j
{code}

Let's say HDP1.x stack might have a check called MY_AWESOME_SERVICE_CHECK but 
the *MY_AWESOME_SERVICE* is discontinued on HDP2.0. 
In this case, MY_AWESOME_SERVICE_CHECK should be only applicable on HDP1.x, but 
not on HDP2.0.
And 
[AmbariCustomCommandExecutionHelper.validateAction()|https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java#L773]
 should validate with a OK and an exception respectively.

Can anybody validate my idea below of handling this ticket ?
1. committing this patch to fix this particular issue
2. and submitting another ticket to make ActionMetadata by stack+version


> ServiceCheck cannot be run if there is only one stack definition
> ----------------------------------------------------------------
>
>                 Key: AMBARI-7442
>                 URL: https://issues.apache.org/jira/browse/AMBARI-7442
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>    Affects Versions: 1.7.0
>            Reporter: Mingjiang Shi
>            Assignee: Alexander Denissov
>             Fix For: 1.7.0
>
>         Attachments: AMBR-7442.patch
>
>
> Reproduce step:
> 1. Remove all the stack definitions in HDP except HDP 2.0.6, and mark 
> HDP2.0.6 as active in the metainfo.xml
> 2. Install a cluster using HDP2.0.6 include the basic service hdfs and 
> zookeeper
> 3. Once installed, in the dashboard, select Zookeeper, and click Run Service 
> Check under Service Actions.
> Nothing will happen in the webui, but in the ambari-server log, the following 
> error is found:
> 02:47:04,586  INFO [qtp697653916-20] AmbariManagementControllerImpl:2984 - 
> Received action execution request, clusterName=hdp, request=isCommand :true, 
> action :null, command :ZOOKEEPER_QUORUM_SERVICE_CHECK, inputs :{}, 
> resourceFilters: [RequestResourceFilter{serviceName='ZOOKEEPER', 
> componentName='null', hostNames=[]}], exclusive: false, clusterName :hdp
> 02:47:04,586 ERROR [qtp697653916-20] AbstractResourceProvider:280 - Caught 
> AmbariException when creating a resource
> org.apache.ambari.server.AmbariException: Unsupported action 
> ZOOKEEPER_QUORUM_SERVICE_CHECK for Service: ZOOKEEPER and Component: null
>         at 
> org.apache.ambari.server.controller.AmbariCustomCommandExecutionHelper.validateAction(AmbariCustomCommandExecutionHelper.java:783)
>         at 
> org.apache.ambari.server.controller.AmbariManagementControllerImpl.createAction(AmbariManagementControllerImpl.java:2991)
>         at 
> org.apache.ambari.server.controller.internal.RequestResourceProvider$1.invoke(RequestResourceProvider.java:121)
>         at 
> org.apache.ambari.server.controller.internal.RequestResourceProvider$1.invoke(RequestResourceProvider.java:118)
>         at 
> org.apache.ambari.server.controller.internal.AbstractResourceProvider.createResources(AbstractResourceProvider.java:273)
>         at 
> org.apache.ambari.server.controller.internal.RequestResourceProvider.createResources(RequestResourceProvider.java:118)
>         at 
> org.apache.ambari.server.controller.internal.ClusterControllerImpl.createResources(ClusterControllerImpl.java:274)
>         at 
> org.apache.ambari.server.api.services.persistence.PersistenceManagerImpl.create(PersistenceManagerImpl.java:75)
>         at 
> org.apache.ambari.server.api.handlers.CreateHandler.persist(CreateHandler.java:36)
>         at 
> org.apache.ambari.server.api.handlers.BaseManagementHandler.handleRequest(BaseManagementHandler.java:72)
>         at 
> org.apache.ambari.server.api.services.BaseRequest.process(BaseRequest.java:135)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to