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




ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
Lines 213 (patched)
<https://reviews.apache.org/r/61503/#comment258397>

    I'm a little worried about this one. I thought the way you'd approach it 
was to make a query to get the ID of the one CURRENT repo and then use that ID 
directly via simple UPDATE/SET commands. 
    
    The problem here seems to be twofold:
    - There's a lot of added complexity per database for this call
    - It doesn't really check to make sure you get the right ID
    
    I'd think it would be simpler to do something like:
    
    - Query for the ID of the repo to use for all set commands. If the CURRENT 
repo can't be found, throw an exception and fail the upgrade
    - One you have the ID, now go and make the DDL structure withou constraints
    - Set the ID on the new structures
    - Add the constraints
    - Drop the old stuff


- Jonathan Hurley


On Aug. 8, 2017, 1:47 p.m., Dmitro Lisnichenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61503/
> -----------------------------------------------------------
> 
> (Updated Aug. 8, 2017, 1:47 p.m.)
> 
> 
> Review request for Ambari, Dmytro Grinenko, Jonathan Hurley, and Nate Cole.
> 
> 
> Bugs: AMBARI-21169
>     https://issues.apache.org/jira/browse/AMBARI-21169
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Implement the following upgrade catalog changes related to service/patch 
> upgrades:
> 
> h5. {{servicecomponentdesiredstate}}
> - Remove:  desired_stack_id BIGINT NOT NULL
> - Remove: desired_version VARCHAR(255) NOT NULL DEFAULT 'UNKNOWN'
> - Remove: FK on desired_stack_id (FK_scds_desired_stack_id)
> - Add: desired_repo_version_id BIGINT NOT NULL
> - Add: FK to repo_version_id (FK_scds_desired_repo_id)
> 
> h5. {{hostcomponentdesiredstate}}
> - Remove: desired_stack_id BIGINT NOT NULL
> - Remove: FK on desired_stack_id (FK_hcds_desired_stack_id)
> 
> h5. {{hostcomponentstate}}
> - Remove: current_stack_id BIGINT NOT NULL
> - Remove: FK on desired_stack_id (FK_hcs_current_stack_id)
> 
> h5. {{servicedesiredstate}}
> - Remove: desired_stack_id BIGINT NOT NULL
> - Add: desired_repo_version_id BIGINT NOT NULL
> - Add: FK  to repo_version_id (FK_repo_version_id)
> 
> h5. {{host_version}}
> - Change the {{UNIQUE}} constraint to allow for multiple {{CURRENT}} 
> repositories per host. Restriction should also include the 
> {{repo_version_id}} for uniqueness now.
> 
> h5. {{cluster_version}}
> - This table was removed.
> 
> h5. {{servicecomponent_version}}
> - Create this table and populate with data
> 
> h5. {{upgrade}}
> - Add orchestration VARCHAR(255) NOT NULL DEFAULT 'STANDARD'
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java 
> 03136984ba 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 
> 38d60e9a4a 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/DbmsHelper.java
>  00b02f1033 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/GenericDbmsHelper.java
>  11cbcf922b 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/H2Helper.java
>  100c8659ef 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/MySqlHelper.java
>  ad26520e4a 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/OracleHelper.java
>  73356d16e3 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/PostgresHelper.java
>  46d7315d91 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
>  35e5b1030f 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
>  PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/61503/diff/1/
> 
> 
> Testing
> -------
> 
> running tests on live cluster
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>

Reply via email to