> On July 13, 2016, 10:33 a.m., Jonathan Hurley wrote:
> > I'm curious if you can make this simply by only using the 
> > `commandParams/version` property when calculating what to do. Here's an 
> > example of the various values during normal commands, upgrades, and 
> > downgrades. `version` seems to always be what you want, no?
> > 
> > ```
> > NORMAL COMMANDS
> >   hostLevelParams
> >     stack_name = HDP
> >     stack_version = 2.3
> >     current_version = 2.3.4.0-1234
> > 
> >   commandParams
> >     version = 2.3.4.0-1234
> > 
> > 
> > UPGRADE
> >   hostLevelParams
> >     stack_name = HDP
> >     stack_version = 2.3
> >     current_version = 2.3.4.0-1234
> > 
> >   commandParams
> >     original_stack = 2.3
> >     target_stack = 2.5  
> >     upgrade_direction = UPGRADE
> >     version = 2.5.0.0-9999
> > 
> > 
> > DOWNGRADE
> >   hostLevelParams
> >     stack_name = HDP
> >     stack_version = 2.5
> >     current_version = 2.3.4.0-1234
> > 
> >   commandParams
> >     original_stack = 2.3
> >     target_stack = 2.5  
> >     upgrade_direction = DOWNGRADE
> >     version = 2.3.4.0-1234
> >     downgrade_from_version = 2.5.0.0-9999
> > ```
> 
> Mugdha Varadkar wrote:
>     Thanks Jonathan Hurley. Actually this was done by taking reference from 
> similar code from 
> Ambari.(https://github.com/apache/ambari/commit/63f8d74f806aa55fcbb4e51b2c84a3fd0146c062#diff-a9a4cbc8111690ebc76b1e83491d2dba)
>     
>     @Jayush Luniya, can we use version in NORMAL COMMANDS/UPGRADE/DOWNGRADE 
> scenarios?

Actually, an even better option is this:

```
# determine which version to use for checking stack features; version is the 
most accurate but
# may not always be available (especially on first install of the cluster)
version_for_stack_feature_checks = version if not None else 
stack_version_unformatted
```

It's possible that on initial install, `version` isn't defined since we haven't 
calculated it yet. So, the above defaults to the stack version in that case. 
Now, version covers all 3 of your scenarios.


- Jonathan


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


On July 13, 2016, 8:25 a.m., Mugdha Varadkar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49987/
> -----------------------------------------------------------
> 
> (Updated July 13, 2016, 8:25 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Gautam Borad, Jonathan 
> Hurley, Jayush Luniya, Srimanth Gunturi, and Velmurugan Periasamy.
> 
> 
> Bugs: AMBARI-17687
>     https://issues.apache.org/jira/browse/AMBARI-17687
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Scenario:
> 1. install ranger with stack 2.4 and ambari-2.4.0
> 2. register the version of stack 2.5
> 3. perform the upgrade
> at the step where it where zookeepers are upgraded , just downgraded.
> 4. downgrade was successful 
> 5. check ranger service status , it was down
> try to restart the ranger but ranger startup is failing
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
>  8445214 
>   
> ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
>  6d304d4 
>   
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py
>  f24bd83 
>   
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
>  571eebd 
>   
> ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
>  f47eee4 
>   
> ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
>  7e0477f 
>   
> ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
>  fad4b9b 
>   
> ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/params.py
>  dfcad32 
>   
> ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/params_linux.py
>  2afb187 
>   
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
>  44a0446 
>   ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml 
> 4c122e9 
>   ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml 
> bbd0fe4 
> 
> Diff: https://reviews.apache.org/r/49987/diff/
> 
> 
> Testing
> -------
> 
> Test Ranger Downgrade from stack 2.5 to 2.4
> 
> 
> Thanks,
> 
> Mugdha Varadkar
> 
>

Reply via email to