ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Beerbower" <tbeerbo...@hortonworks.com>
Subject Re: Review Request 29082: Expose Stage and Upgrade Item update status API.
Date Tue, 16 Dec 2014 15:09:53 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29082/
-----------------------------------------------------------

(Updated Dec. 16, 2014, 3:09 p.m.)


Review request for Ambari, Alejandro Fernandez and Nate Cole.


Changes
-------

Update patch : minor fix for order dependency in unit test.


Bugs: AMBARI-8643
    https://issues.apache.org/jira/browse/AMBARI-8643


Repository: ambari


Description
-------


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.

    GET api/v1/upgrades/1 
    {
      "href" : "http://c6401.ambari.apache.org:8080/api/v1/upgrades/1",
      "Upgrade" : {
        ...
        "request_status" : "HOLDING",
        ... 
    }

# 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.

    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"
          }
        }
      ]
    }

# To release the hold on a upgrade, complete the the stage that is holding by setting it's
status to COMPLETED.

    PUT api/v1/upgrades/1/upgrade_items/10

    {
      "UpgradeItem" : {
        "status" : "COMPLETED"
      } 
    }

# 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.

    PUT api/v1/upgrades/1/upgrade_items/10

    {
      "UpgradeItem" : {
        "status" : "PENDING"
      }
    }

# 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).

    PUT api/v1/upgrades/1/upgrade_items/10

    {
      "UpgradeItem" : {
        "status" : "FAILED"
      }
    }


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
af224f0 
  ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
17e492c 
  ambari-server/src/main/java/org/apache/ambari/server/actionmanager/HostRoleStatus.java 0d5434c

  ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java 28d9b8d 
  ambari-server/src/main/java/org/apache/ambari/server/actionmanager/StageStatus.java eaeca3e

  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StageResourceProvider.java
3904b4b 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeItemResourceProvider.java
9d542b3 
  ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostRoleCommandEntity.java
599156a 
  ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ManualStageAction.java
4460dbe 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java 487b216

  ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql e09a0c2 
  ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 0b3c831 
  ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 203b5bb 
  ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql e311276 
  ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql c044ff6 
  ambari-server/src/test/java/org/apache/ambari/server/actionmanager/HostRoleStatusTest.java
5e29100 
  ambari-server/src/test/java/org/apache/ambari/server/actionmanager/StageStatusTest.java
4ed4804 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
172e481 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StageResourceProviderTest.java
5471b08 
  ambari-server/src/test/java/org/apache/ambari/server/serveraction/ServerActionExecutorTest.java
db08460 
  ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java
4cf1b40 

Diff: https://reviews.apache.org/r/29082/diff/


Testing
-------

Manual testing.  New unit tests added.

Results :

Tests run: 2427, Failures: 0, Errors: 0, Skipped: 13


[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26:30 min
[INFO] Finished at: 2014-12-15T23:19:17-05:00
[INFO] Final Memory: 34M/451M
[INFO] ------------------------------------------------------------------------


Thanks,

Tom Beerbower


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message