> On Aug. 16, 2015, 1:05 a.m., Alejandro Fernandez wrote: > > ambari-server/src/main/resources/custom_actions/scripts/ru_set_all.py, line > > 98 > > <https://reviews.apache.org/r/37499/diff/1/?file=1041017#file1041017line98> > > > > Preferable to use the compare_versions function which is easier to find > > in the future than hardcoding HDP-2.2 > > Jonathan Hurley wrote: > I really don't care about the versions here; I care about the stack. It > was simple to say source = HDP-2.3 and target = HDP 2.2 ... what's the > equivalent code using compare_versions? I'd have to convert the values of > `downgrade_from_version` and `version` into normalized versions first, and > then compare? Can you give an example? > > Alejandro Fernandez wrote: > We have a lot of logic that compares the stack against values like 2.2 or > 2.3, and it was done because it was easier at the time to keep adding that > type of logic. The rest of the scripts use the compare_version function, so I > was suggesting being consistent. I'm ok with the current patch.
I already patched it with your suggestion :) Can you please check my logic for correctness on compare_version - The unit tests passed, but another set of eyes would be good. - Jonathan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/37499/#review95535 ----------------------------------------------------------- On Aug. 16, 2015, 10:52 a.m., Jonathan Hurley wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/37499/ > ----------------------------------------------------------- > > (Updated Aug. 16, 2015, 10:52 a.m.) > > > Review request for Ambari, Alejandro Fernandez and Nate Cole. > > > Bugs: AMBARI-12778 > https://issues.apache.org/jira/browse/AMBARI-12778 > > > Repository: ambari > > > Description > ------- > > When downgrading a rolling upgrade from HDP 2.3 back to HDP 2.2, all > components will fail with a circular symlink reference. > > The problem is that Ambari changes /etc/component/conf from a directory to a > symlink when upgrading to HDP 2.3 from HDP 2.2. During the downgrade, once > the component is put back in HDP 2.2, the following is observed: > ``` > [root@c6401 flume]# ls -l /etc/flume > total 8 > drwxr-xr-x 3 root root 4096 Aug 14 15:44 2.3.2.0-2586 > lrwxrwxrwx 1 root root 34 Aug 14 16:14 conf -> > /usr/hdp/current/flume-server/conf > drwxr-xr-x 2 flume root 4096 Aug 14 15:42 conf.backup > > (/usr/hdp/2.2.7.0-2816/flume/) > [root@c6401 flume]# ls -l /usr/hdp/current/flume-server/conf > total 16 > drwxr-xr-x 2 root root 4096 Aug 14 15:42 bin > lrwxrwxrwx 1 root root 15 Aug 14 15:42 conf -> /etc/flume/conf > drwxr-xr-x 9 root root 4096 Aug 14 15:42 docs > drwxr-xr-x 2 root root 4096 Aug 14 15:42 lib > drwxr-xr-x 2 root root 4096 Aug 14 15:42 tools > ``` > > The solution is to reverse the symlink work done when downgrading from HDP > 2.3 back to 2.2. > > > Diffs > ----- > > > ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py > a676f74 > > ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume_handler.py > a305ce7 > > ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume_upgrade.py > 7743619 > > ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params_linux.py > a7efbf6 > ambari-server/src/main/resources/custom_actions/scripts/ru_set_all.py > f868002 > ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml > f6823c8 > ambari-server/src/test/python/custom_actions/test_ru_set_all.py 211443b > > Diff: https://reviews.apache.org/r/37499/diff/ > > > Testing > ------- > > Verified fix on a cluster where the problem was reproduced. > > mvn clean test > ---------------------------------------------------------------------- > Total run:789 > Total errors:0 > Total failures:0 > OK > > > Thanks, > > Jonathan Hurley > >
