[
https://issues.apache.org/jira/browse/AMBARI-7317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14135582#comment-14135582
]
Hudson commented on AMBARI-7317:
--------------------------------
SUCCESS: Integrated in Ambari-trunk-Commit #257 (See
[https://builds.apache.org/job/Ambari-trunk-Commit/257/])
AMBARI-7317. Add "exclusive" flag to custom command/custom action requests
(dlysnichenko) (dlysnichenko:
http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=645772647867574620d453ca8b8bb7693a1910eb)
*
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestEntity.java
*
ambari-server/src/main/java/org/apache/ambari/server/controller/ExecuteActionRequest.java
* ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
*
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
*
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
*
ambari-server/src/test/java/org/apache/ambari/server/controller/BackgroundCustomCommandExecutionTest.java
* ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
*
ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
*
ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelperTest.java
*
ambari-server/src/main/java/org/apache/ambari/server/controller/MaintenanceStateHelper.java
* ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
*
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Request.java
*
ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
* ambari-server/src/main/resources/properties.json
*
ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java
*
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
* ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
> Add "exclusive" flag to custom command/custom action requests
> -------------------------------------------------------------
>
> Key: AMBARI-7317
> URL: https://issues.apache.org/jira/browse/AMBARI-7317
> Project: Ambari
> Issue Type: Task
> Components: ambari-server
> Affects Versions: 1.7.0
> Reporter: Dmitry Lysnichenko
> Assignee: Dmitry Lysnichenko
> Fix For: 1.7.0
>
>
> The issue is that Update Nagios request may be executed in parallel with
> start/stop requests in some cases. If Nagios host does not belong to a set of
> hosts that are affected by start/stop requests, then API user may be able to
> get a race condition and (sometimes) fake alerts.
> Here is an example scenario:
> request to start some service host component is issued
> request to disable MM for host component is issued
> if host component is not located at the same host with Nagios server,
> both requests are executed in parallel
> there is a good chance that the request to disable MM is executed earlier
> than other request
> there is a small chance that Nagios service check for a host component is
> run before host component is actually started. As a result, administrator
> gets a 'fantom' alert
> It seems that the straightforward solution for both issues is to implement
> some flag (like exclusive=true) that would be available for custom
> actions/custom commands. The flag would forbid running request in parallel
> with other requests. This flag would be used when issuing Update Nagios
> request. As a result, race condition would not be possible.
> Request example:
> {code}
> curl 'http://vm-6.vm:8080/api/v1/clusters/cc/requests' -H 'X-Requested-By:
> X-Requested-By' --data
> '{"RequestInfo":{"command":"RESTART","context":"Restart all components on
> vm-6.vm","exclusive":"true","operation_level":{"level":"HOST","cluster_name":"cc"}},"Requests/resource_filters":[{"service_name":"HDFS","component_name":"DATANODE","hosts":"vm-6.vm"},{"service_name":"GANGLIA","component_name":"GANGLIA_MONITOR","hosts":"vm-6.vm"},{"service_name":"HDFS","component_name":"HDFS_CLIENT","hosts":"vm-6.vm"},{"service_name":"MAPREDUCE2","component_name":"MAPREDUCE2_CLIENT","hosts":"vm-6.vm"},{"service_name":"ZOOKEEPER","component_name":"ZOOKEEPER_CLIENT","hosts":"vm-6.vm"},{"service_name":"ZOOKEEPER","component_name":"ZOOKEEPER_SERVER","hosts":"vm-6.vm"}]}'
> -u admin:admin
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)