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

(Updated June 27, 2017, 3:32 p.m.)


Review request for Ambari, Attila Doroszlai, Alejandro Fernandez, and Sid Wagle.


Changes
-------

Updated with compiled unit test code.


Bugs: AMBARI0-21358
    https://issues.apache.org/jira/browse/AMBARI0-21358


Repository: ambari


Description
-------

When creating an upgrade in Ambari 2.5.x, the request appears as follows:

{code}
POST api/v1/clusters/c1/upgrades
{
  "Upgrade": {
    "repository_version": "2.6.0.0-334",
    "skip_failures": "true",
    "skip_service_check_failures": "true",
    "skip_prerequisite_checks": "true",
    "upgrade_type": "NON_ROLLING",
    "direction": "UPGRADE"
  }
}
{code}

The only identifier for the repository is the repo version. This forces the 
query to assume that the repository has the same name as the repository 
currently installed for the cluster. When going between stack vendors, this is 
incorrect:

STR:
- Install BigInsights 4.2.0 or 4.2.5
- Upgrade to Ambari 2.5.2
- Register HDP 2.6 and try to upgrade

The backend will look for {{BigInsights-2.6.0.0-1234}} instead of 
{{HDP-2.6.0.0-1234}}. A quick workaround is to fallback to a version-only 
search when the repository is not found. 

The fix for this is to allow the web client to pass the stack name in addition 
to the version. A repository ID can also be specified instead of the stack 
name/version.

Additionally, the {{upgrade}} itself must track the to/from repo versions 
instead of strings:
{code}
CREATE TABLE upgrade (
  upgrade_id BIGINT NOT NULL,
  cluster_id BIGINT NOT NULL,
  request_id BIGINT NOT NULL,
  from_repo_version_id BIGINT NOT NULL,
  to_repo_version_id BIGINT NOT NULL,
  ...
{code}


Diffs (updated)
-----

  
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
 26c39fc3a6 
  
ambari-server/src/main/java/org/apache/ambari/server/alerts/ComponentVersionAlertRunnable.java
 7dfbe47c4b 
  
ambari-server/src/main/java/org/apache/ambari/server/checks/PreviousUpgradeCompleted.java
 fe57ae4051 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
 6e75ab6653 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
 71c0b804c1 
  
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java
 152fde1d2a 
  
ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckAction.java
 7705c7d017 
  
ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
 e73651ecf1 
  
ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/UpdateDesiredStackAction.java
 5b592c7cbb 
  ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 
56c2b369b1 
  
ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java 
4042089a53 
  
ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContextFactory.java
 4f15ee2af8 
  ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeHelper.java 
4cdccdd2b0 
  
ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
 a9e33f0016 
  
ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java
 584ce9884f 
  
ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/HostOrderGrouping.java
 97864a67da 
  
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
 d806ddef2f 
  ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql c99326e159 
  ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql be0bdd80ff 
  ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b0f0d9f108 
  ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql c680a66f68 
  ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql c6524b0640 
  ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 64836451cb 
  
ambari-server/src/test/java/org/apache/ambari/server/alerts/ComponentVersionAlertRunnableTest.java
 98f6f44912 
  
ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/UpgradeEventCreatorTest.java
 48225842b5 
  
ambari-server/src/test/java/org/apache/ambari/server/checks/PreviousUpgradeCompletedTest.java
 4bfa8d435c 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackUpgradeConfigurationMergeTest.java
 31c433d783 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
 1e888c10f8 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeSummaryResourceProviderTest.java
 f1416d2075 
  
ambari-server/src/test/java/org/apache/ambari/server/orm/dao/UpgradeDAOTest.java
 78fedfe715 
  
ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
 b95a447cfb 
  
ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java
 135edb6ed7 
  
ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
 0dd7f58700 
  
ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterEffectiveVersionTest.java
 a61b7b1821 
  
ambari-server/src/test/java/org/apache/ambari/server/state/services/RetryUpgradeActionServiceTest.java
 95700547ed 
  
ambari-server/src/test/java/org/apache/ambari/server/state/stack/upgrade/StageWrapperBuilderTest.java
 0eef63862a 


Diff: https://reviews.apache.org/r/60475/diff/2/

Changes: https://reviews.apache.org/r/60475/diff/1-2/


Testing (updated)
-------

Some unit test errors, but all tests compile. Performed various 
upgrades/downgrades. 

Unit tests are PENDING...


Thanks,

Jonathan Hurley

Reply via email to