-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62619/
-----------------------------------------------------------
Review request for Ambari and Nate Cole.
Bugs: AMBARI-22076
https://issues.apache.org/jira/browse/AMBARI-22076
Repository: ambari
Description
-------
Ambari does not write out repositories with a "priority" attribute since this
is a plugin and is not guaranteed to be installed. Also, when installing
packages with versions "in the middle" of two other installed stacks, priority
would be incorrect as the most recent stack-tools should always be used.
The following is seen when trying to distribute a stack for a patch upgrade:
```
2017-09-26 16:28:58,652 - Package Manager failed to install packages. Error:
Execution of '/usr/bin/yum -d 0 -e 0 -y install hive_2_6_3_1_1' returned 1.
Error: Package: hadoop_2_6_3_1_1-2.7.3.2.6.3.1-1.x86_64 (HDP-2.6-repo-2)
Requires: hdp-select >= 2.6.3.1-1
Installed: hdp-select-2.6.3.0-122.noarch (@HDP-2.6.3.0-122)
hdp-select = 2.6.3.0-122
```
The cause of this seems to be that the repository for HDP-2.6-repo-2 does not
take priority over the existing installed repository for {{hdp-select}}. That's
actually good - it shouldn't take priority over it arbitrarily.
However, this means that the {{hdp-select}} which is installed did not get
taken from {{HDP-2.6-repo-2}}. So, when installing {{hdp-select}}, we should
scope the install to the repo we are trying to calculate the version for.
This works because the stack-select tools do not have their package names
versioned ({{hdp-select}} as opposed to {{hdp-select_x_y_z}}.
Diffs
-----
ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
e39a4c3f3b
ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
189043be9f
Diff: https://reviews.apache.org/r/62619/diff/1/
Testing
-------
Installed intermediate veresions - was able to verify the the highest stack
tools remained:
```
# after installing 2.6.0.2
[root@c6401 ~]# yum list installed | more | grep hdp-select
hdp-select.noarch 2.6.0.2-81.el6 @HDP-2.6-repo-2
# after installing 2.6.0.3
[root@c6401 ~]# yum list installed | more | grep hdp-select
hdp-select.noarch 2.6.0.3-8.el6 @HDP-2.6-repo-51
# for a re-install for 2.6.0.2
[root@c6401 ~]# /usr/bin/yum -d 0 -e 0 -y install --disablerepo=*
--enablerepo=HDP-2.6-repo-2,HDP-UTILS-1.1.0.21-repo-2 hdp-select
Package matching hdp-select-2.6.0.2-81.el6.noarch already installed. Checking
for update.
# newer version retained
[root@c6401 ~]# yum list installed | more | grep hdp-select
hdp-select.noarch 2.6.0.3-8.el6 @HDP-2.6-repo-51
```
Thanks,
Jonathan Hurley