ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alejandro Fernandez" <afernan...@hortonworks.com>
Subject Re: Review Request 37984: Stop-and-Start Upgrade: DB Schema Changes
Date Tue, 01 Sep 2015 01:48:05 GMT

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



ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java (line
1192)
<https://reviews.apache.org/r/37984/#comment153023>

    review seems fairly large.
    
    I changed all functions that expected Map<String, UpgradePack> to instead use Collection<UpgradePack>
since the upgrade pack now stores its own name.



ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
(line 75)
<https://reviews.apache.org/r/37984/#comment153024>

    I'll address the prechecks in a seperate checkin, but the upgrade pack needs to contain
a list of what to check.



ambari-server/src/main/java/org/apache/ambari/server/controller/PrereqCheckRequest.java (line
54)
<https://reviews.apache.org/r/37984/#comment153025>

    To make the unit tests pass with minimal changes, the default value here is ROLLING.



ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
(line 70)
<https://reviews.apache.org/r/37984/#comment153026>

    The prechecks endpoint must also pass in the upgrade_type, such as ROLLING or NONROLLING.



ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
(line 130)
<https://reviews.apache.org/r/37984/#comment153027>

    UI is not ready yet, so I hardcoded this for now.



ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java

<https://reviews.apache.org/r/37984/#comment153028>

    The upgrade_pack field is no longer associated with the RepoVersion object.



ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
(line 458)
<https://reviews.apache.org/r/37984/#comment153029>

    Typically, there will only be one upgrade pack with a given source, target, and upgrade
type.
    However, the unit tests need multiple variations, so I needed to insert a preferred upgrade
pack name to use.



ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java (line 417)
<https://reviews.apache.org/r/37984/#comment153030>

    Store the name in the UpgradePack object.



ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java
(line 172)
<https://reviews.apache.org/r/37984/#comment153031>

    When filtering upgrade packs, if the upgradeType is requested, ensure that the values
match.



ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java

<https://reviews.apache.org/r/37984/#comment153032>

    This function is not called any longer.



ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/UpgradeType.java
(line 29)
<https://reviews.apache.org/r/37984/#comment153033>

    I switched these to upper case since the DB and UI use this convention.



ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java (line
146)
<https://reviews.apache.org/r/37984/#comment153034>

    I need to test this still.
    If a customer is already on Ambari 2.1, will this upgrade catalog still run???
    
    If not, we can still call it from the upgrade catalog for Ambari 2.2, and this function
should be idempotent.



ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
(line 193)
<https://reviews.apache.org/r/37984/#comment153035>

    This moved up top.



ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
(line 769)
<https://reviews.apache.org/r/37984/#comment153036>

    This is how we set the upgrade pack to use for the unit tests.



ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java (line
184)
<https://reviews.apache.org/r/37984/#comment153037>

    Check that the 2 columns were added.


- Alejandro Fernandez


On Sept. 1, 2015, 1:36 a.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37984/
> -----------------------------------------------------------
> 
> (Updated Sept. 1, 2015, 1:36 a.m.)
> 
> 
> Review request for Ambari, Dmytro Grinenko, Dmitro Lisnichenko, Jonathan Hurley, and
Nate Cole.
> 
> 
> Bugs: AMBARI-12699
>     https://issues.apache.org/jira/browse/AMBARI-12699
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Make required database schema changes such as moving the upgrade_pack column from the
repo_version to the upgrade table.
> Also, added upgrade_type column to the upgrade_table.
> 
> In the process, I changed the UpgradePack class so that it contains a name, and changed
several methods that expected Map<String, UpgradePack> to Collection<UpgradePack>
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
4afa9b0 
>   ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
ef93337 
>   ambari-server/src/main/java/org/apache/ambari/server/checks/SecondaryNamenodeDeletedCheck.java
493042f 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/PrereqCheckRequest.java
f8c5316 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java
6344aa2 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
c394498 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
f1fa3bf 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
fa743be 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java 1b208fb

>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/RepositoryVersionDAO.java
4ac1314 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UpgradeDAO.java bc0652c

>   ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java
0fb2f10 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java
802ea03 
>   ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java 89c10c6

>   ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java 2aa89cc 
>   ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeHelper.java 3e25d01

>   ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java 79b8eb5

>   ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java
2e17cf4 
>   ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/UpgradeType.java
17ee22c 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
63f015b 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
77e2e93 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java
PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java
4eb7a80 
>   ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 265e42e 
>   ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 0053837 
>   ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 30b669d 
>   ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql 4f7569c 
>   ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 81d0e6f 
>   ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.2.xml
bf237c6 
>   ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.2.xml 9b7848f 
>   ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml 25df73a 
>   ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml e9671e3 
>   ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java
fc0f9bc 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProviderTest.java
ea6e56e 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
442bcb2 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderHDP22Test.java
166b665 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
7d2c117 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 53f7432

>   ambari-server/src/test/java/org/apache/ambari/server/orm/dao/CrudDAOTest.java 8777d33

>   ambari-server/src/test/java/org/apache/ambari/server/orm/dao/RepositoryVersionDAOTest.java
adda018 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/dao/UpgradeDAOTest.java 0b12e97

>   ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ConfigureActionTest.java
93e29b5 
>   ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
91a2788 
>   ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java f7898ee

>   ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
a73775f 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java
PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_bucket_test.xml
8c2c205 
>   ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_direction.xml 693c5ec

>   ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test.xml e1dde1b

>   ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test_checks.xml
84d7a5a 
>   ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test_nonrolling.xml
a22e68b 
>   ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_to_new_stack.xml
fa2a00e 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test.xml 96dd8f7

>   ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
099bbd7 
> 
> Diff: https://reviews.apache.org/r/37984/diff/
> 
> 
> Testing
> -------
> 
> ** This is not a fully functional change yet. The UI has to change in order to pass the
upgrade_type (ROLLING|NONROLLING) to upgrades endpoint.
> I still need to test UpgradeCatalog212, and check what happens when a customer upgraded
to Ambari 2.1, and needs to absorb the 2.1.2 schema changes.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


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