> On Sept. 10, 2015, 7:37 p.m., Jonathan Hurley wrote: > > I'm a little worried about the complexity of this upgrade, especially with > > creating sequences and stuff. I think there is an issue with the sequences > > and the max ID value. Did you try this with creating a 2.1 cluster, > > restarting Ambari, creating some more entities here and there, and then try > > the upgrade?
I did. I inserted my own records into the repo_version, cluster_version, and host_version tables manually, and no sequences existed for the last 2 tables. Just to be safe, I added code to get the number of rows to first insert the sequence if not already present. > On Sept. 10, 2015, 7:37 p.m., Jonathan Hurley wrote: > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java, > > line 368 > > <https://reviews.apache.org/r/38238/diff/2/?file=1067566#file1067566line368> > > > > British? Analyzing Will fix. > On Sept. 10, 2015, 7:37 p.m., Jonathan Hurley wrote: > > ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterVersionDAO.java, > > line 172 > > <https://reviews.apache.org/r/38238/diff/2/?file=1067565#file1067565line172> > > > > Line wrapping? :) Will fix. > On Sept. 10, 2015, 7:37 p.m., Jonathan Hurley wrote: > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java, > > line 370 > > <https://reviews.apache.org/r/38238/diff/2/?file=1067566#file1067566line370> > > > > What about 2.0.x? We do not support this for HDP 2.0 since it does not have any upgrade packs. > On Sept. 10, 2015, 7:37 p.m., Jonathan Hurley wrote: > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java, > > line 412 > > <https://reviews.apache.org/r/38238/diff/2/?file=1067566#file1067566line412> > > > > I don't think we're guaranteed to have the size of the entities also be > > the maximum range of ID values. Especially with ID values skipping up to 50 > > at a time. That's a good point. I can either 1) insert the sequence as 0 if no records are present, which is very likely to be the case. 2) write a named query to get the max(ID) in each one of these tables (more robust, but I don't really expect anyone on HDP 2.1 to have any records in those tables). - Alejandro ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/38238/#review98462 ----------------------------------------------------------- On Sept. 10, 2015, 6:26 p.m., Alejandro Fernandez wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/38238/ > ----------------------------------------------------------- > > (Updated Sept. 10, 2015, 6:26 p.m.) > > > Review request for Ambari, Dmytro Grinenko, Dmitro Lisnichenko, Jonathan > Hurley, Nate Cole, and Sid Wagle. > > > Bugs: AMBARI-13001 > https://issues.apache.org/jira/browse/AMBARI-13001 > > > Repository: ambari > > > Description > ------- > > In Ambari 2.1, if the stack is HDP 2.1, the user does not even see a Stacks > and Versions page. > The Ambari upgrade will have to bootstrap the versions by > * Inserting repo_vesion for HDP 2.1 > * Inserting cluster_vesion as CURRENT > * Inserting host_versions as CURRENT > > This will then allow clicking on the "Perform Upgrade" button to call the > Upgrades endpoint correctly, which needs to know the source version in order > to calculate the upgrade pack and configs to use. > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java > 2c9714e > > ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterVersionDAO.java > d3326b1 > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java > 6919e64 > > ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml > PRE-CREATION > > ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java > 6268f91 > > Diff: https://reviews.apache.org/r/38238/diff/ > > > Testing > ------- > > Installed Ambari 2.1.1 with HDP 2.1.0.0 > Upgraded Ambari to 2.1.2 using my build, which updated the schema, and also > populated the repo_version, cluster_version, and host_version. > In my install, only the repo_version had an id in the ambari_sequences table, > so I also tested that a value was inserted if not already present for all 3 > entities. > > I also added a basic upgrade pack for HDP 2.1 -> 2.3 for basic testing, which > can be started using a curl call. > > > Thanks, > > Alejandro Fernandez > >
