----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/47202/#review132569 -----------------------------------------------------------
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java (lines 2214 - 2215) <https://reviews.apache.org/r/47202/#comment196796> RESTART commands worked fine - but a STOP/START had a very, very naughty problem. On a START, we'd send down the "current" cluster repo version ID, which during an upgrade, is wrong. Say you were upgrading from 2.2 to 2.3 and suspended it and tried to start ZK. We'd send down the repo ID for HDP 2.2 so that when ZK started up on 2.3 (and reported 2.3.0.0-1234), we'd update the HDP 2.2 repo version with that version!!! I switched this to use the "effective" version which takes into accounts upgrades and suspended upgrades. ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java (lines 97 - 100) <https://reviews.apache.org/r/47202/#comment196797> Yet another safeguard to the repo version ID update problem - there's absolutely ZERO reason to update it if in an upgrade - it better be correct already. ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java <https://reviews.apache.org/r/47202/#comment196798> I don't know what this was for, but it was wrong. Very wrong. We have JPA to handle this association for us now. ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java (lines 1209 - 1211) <https://reviews.apache.org/r/47202/#comment196799> This is the big change here - in Ambari 2.2.2 we used getUpgradeInProgress which searched the database and actually returned suspended upgrades (yay!) But in 2.4.0, we only looked for the UpgradeEntity which was wrong as it would be null if suspended. - Jonathan Hurley On May 10, 2016, 7:36 p.m., Jonathan Hurley wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/47202/ > ----------------------------------------------------------- > > (Updated May 10, 2016, 7:36 p.m.) > > > Review request for Ambari, Dmitro Lisnichenko and Nate Cole. > > > Bugs: AMBARI-16439 > https://issues.apache.org/jira/browse/AMBARI-16439 > > > Repository: ambari > > > Description > ------- > > There is a regression on the 2.4.0 line when restarting components during a > paused upgrade. > > STR: > - Upgrade from HDP 2.3 to HDP 2.4, but don't finalize > - Suspend the upgrade on the finalization step > - Restart a ZooKeeper Server > > The commands being sent down have 2.3.x instead of 2.4.0: > ``` > "commandParams": { > "service_package_folder": "common-services/ZOOKEEPER/3.4.5/package", > "script": "scripts/zookeeper_server.py", > "hooks_folder": "HDP/2.0.6/hooks", > "version": "2.3.4.0-3485", > "command_timeout": "1200", > "script_type": "PYTHON" > }, > > "hostLevelParams": { > "current_version": "2.3.4.0-3485", > "custom_command": "RESTART", > "stack_version": "2.4", > ``` > > The problem is located in {{ClusterImpl}} in how it calculates the upgrade. > In Ambari 2.2.2, it searched for upgrades, which also returned suspended > upgrades. In 2.4.0, it only looks at a currently running upgrade: > > - 2.4.0 > `UpgradeEntity upgradeInProgress = getUpgradeEntity();` > > > - 2.2.2 > `UpgradeEntity upgradeInProgress = this.getUpgradeInProgress();` > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/agent/ExecutionCommand.java > 34a0918 > > ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java > c587e9f > > ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java > 6dbceba > > ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java > b14e9e5 > ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java > cf2c9aa > > ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java > f38c25a > > Diff: https://reviews.apache.org/r/47202/diff/ > > > Testing > ------- > > Manual upgrade/downgrad/suspend test on a running cluster > > Tests pending ... > > > Thanks, > > Jonathan Hurley > >