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

Hudson commented on AMBARI-8643:
--------------------------------

SUCCESS: Integrated in Ambari-trunk-Commit #1227 (See 
[https://builds.apache.org/job/Ambari-trunk-Commit/1227/])
AMBARI-8643 - Expose Stage and Upgrade Item update status API. (tbeerbower) 
(tbeerbower: 
http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=6247e8bdeb82074dbeeab0d63a5020cd49f67109)
* 
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
* 
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostRoleCommandEntity.java
* ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java
* 
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeItemResourceProvider.java
* ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
* 
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
* 
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StageResourceProviderTest.java
* 
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StageResourceProvider.java
* 
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/StageStatus.java
* ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
* 
ambari-server/src/test/java/org/apache/ambari/server/actionmanager/HostRoleStatusTest.java
* ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
* 
ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ManualStageAction.java
* 
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
* 
ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java
* 
ambari-server/src/test/java/org/apache/ambari/server/serveraction/ServerActionExecutorTest.java
* 
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/HostRoleStatus.java
* ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
* 
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java
* 
ambari-server/src/test/java/org/apache/ambari/server/actionmanager/StageStatusTest.java
* ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql


> Expose Stage and Upgrade Item update status API.
> ------------------------------------------------
>
>                 Key: AMBARI-8643
>                 URL: https://issues.apache.org/jira/browse/AMBARI-8643
>             Project: Ambari
>          Issue Type: Task
>            Reporter: Tom Beerbower
>            Assignee: Tom Beerbower
>             Fix For: 2.0.0
>
>         Attachments: AMBARI-8643-2.patch, AMBARI-8643.patch
>
>
> Upgrade Item state diagram:
> {code}                         
>     ----------------- HOLDING ------------------------
>     | <manual item>                       (release)  |
>     |                                                |
>     |                                                |
>     |                           ----> *ABORTED       |
>     |                           |                    |
>     |                           |                    v            
> **PENDING ---> QUEUED -----> IN_PROGRESS -------> *COMPLETED 
>        ^                        | |  |  |                              
>        |                        | |  |  
> -------------------------------------------
>        |                        | |  |                   <hold on err: 
> timeout>   |
>        ----------------------   | |  -----------------------------------      
>     |
>                              |  | |           <hold on err: failed>    |      
>     |
>                              |  | v                                    v      
>     |
>                              |  | FAILED* <-------------- HOLDING_FAILED 
> -------  |
>                              |  v               (skip)                        
>  |  |
>                              |  TIMED_OUT* <------------- HOLDING_TIMED_OUT 
> -->|  |
>                              |                                      ^         
>  |  |
>                              |                                      |         
>  |  |
>                              |                                      
> -----------|---
>                              |                  (retry)                       
>  |
>                              
> ---------------------------------------------------
>              
>              ** starting state                   
>              *  terminal states 
> {code}
> Notes:
> * The HOLDING, HOLDING_FAILED, HOLDING_TIMED_OUT states are new.
> * An item in the HOLDING state can be completed by pushing its state to the 
> COMPLETED state through the API (see below).  This will make the next stage 
> become the current stage and advance from the PENDING state.
> * An item in the HOLDING_FAILED state can be skipped by pushing its state to 
> FAILED state through the API.  This will make the next stage become the 
> current stage and advance it from the PENDING state.
> * An item in the HOLDING_FAILED state can be retried by pushing its state to 
> PENDING state through the API.  This will keep the stage as the current stage 
> and retry the associated tasks.
> * An item in the HOLDING_TIMED_OUT state can be skipped by pushing its state 
> to TIMED_OUT state through the API.  This will make the next stage become the 
> current stage and advance it from the PENDING state.
> * An item in the HOLDING_TIMED_OUT can be retried by pushing its state to 
> PENDING state through the API.  This will keep the stage as the current stage 
> and retry the associated tasks.
> Updated Proposed API changes:
> # Determine if an upgrade is holding by checking the upgrade resource's 
> status.
> {code}
> GET api/v1/upgrades/1
> {
>   "href" : "http://c6401.ambari.apache.org:8080/api/v1/upgrades/1";,
>   "Upgrade" : {
>     ...
>     "request_status" : "HOLDING",
>     ...
> }
> {code}
> # To find the upgrade item that is holding for a given upgrade look for the 
> upgrade item that has a status of HOLDING.  Only the current stage should 
> ever be in the HOLDING state.
> {code}
> GET api/v1/upgrades/1?upgrade_items/UpgradeItem/status=HOLDING
> {
>   "href" : 
> "http://c6401.ambari.apache.org:8080/api/v1/upgrades/1?upgrade_items/UpgradeItem/status=HOLDING";,
>   "Requests" : {
>     "id" : 1
>   },
>   "upgrade_items" : [
>     {
>       "href" : 
> "http://c6401.ambari.apache.org:8080/api/v1/upgrades/1/upgrade_items/10";,
>       "UpgradeItem" : {
>         "request_id" : 1,
>         "stage_id" : 10,
>         "status" : "HOLDING"
>       }
>     }
>   ]
> }
> {code}
> # To release the hold on a upgrade, complete the the stage that is holding by 
> setting it's status to COMPLETED.
> {code}
> PUT api/v1/upgrades/1/upgrade_items/10
> {
>   "UpgradeItem" : {
>     "status" : "COMPLETED"
>   }
> }
> {code}
> # A stage may be marked as 'hold on error' which gives the opportunity to 
> skip or retry a failure/timeout.  If an error occurs while executing the taks 
> of a 'hold on error' upgrade item its status will be set to HOLDING_FAILED or 
> HOLDING_TIMED_OUT.  To retry the upgrade item, set its status back to to 
> PENDING.
> {code}
> PUT api/v1/upgrades/1/upgrade_items/10
> {
>   "UpgradeItem" : {
>     "status" : "PENDING"
>   }
> }
> {code}
> # A stage item that is HOLDING_FAILED or HOLDING_TIMED_OUT may be skipped.  
> To skip an item that is in error and holding,  set its status back to to 
> FAILED (for HOLDING_FAILED) or TIMED_OUT (for HOLDING_TIMED_OUT).
> {code}
> PUT api/v1/upgrades/1/upgrade_items/10
> {
>   "UpgradeItem" : {
>     "status" : "FAILED"
>   }
> }
> {code}



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

Reply via email to