> On Jan. 17, 2017, 3:07 p.m., Jonathan Hurley wrote: > > ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeHelper.java, > > lines 791-793 > > <https://reviews.apache.org/r/55634/diff/1/?file=1606748#file1606748line791> > > > > OK, this is a really odd question and I'm not going to try to sort it > > out in my head since you just worked in this area and probably have the > > answer: > > > > Let's say 1.0 to 1.1 happens and a new component is added. Then you > > downgrade back to 1.0. Now, the component will still be passed in from the > > invoking method in the collection of target services/components ... but > > AmbariMetaInfo woudn't have any information for it in the "targetStack", > > right? So would this throw a NPE? > > > > If I'm wrong, please drop.
According to today's code, when any of stack, stack version, service or component are null from AmbariMetainfo internals, some form of AmbariException is thrown to the caller. > On Jan. 17, 2017, 3:07 p.m., Jonathan Hurley wrote: > > ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeHelper.java, > > lines 814-817 > > <https://reviews.apache.org/r/55634/diff/1/?file=1606748#file1606748line814> > > > > Do you think it's better to simply do: > > > > ``` > > if (!versionAdvertised){ > > serviceComponentHost.setVersion(StackVersionListener.UNKNOWN_VERSION) > > } > > ``` > > > > To make this read easier? I know that this would result in more work > > for the DB, but it's less confusing semantically. Just a thought is all. I thought of that, but this is working on the HostComponent directly, and ideally this should happen naturally. I was trying to isolate for when the version must be UNKNOWN and couldn't get there on its own. Can relax if you think it's needed. - Nate ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/55634/#review161925 ----------------------------------------------------------- On Jan. 17, 2017, 2:59 p.m., Nate Cole wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/55634/ > ----------------------------------------------------------- > > (Updated Jan. 17, 2017, 2:59 p.m.) > > > Review request for Ambari, Dmitro Lisnichenko and Jonathan Hurley. > > > Bugs: AMBARI-19596 > https://issues.apache.org/jira/browse/AMBARI-19596 > > > Repository: ambari > > > Description > ------- > > Steps: > * Install ZKFC using HDP-2.3. > * Register a version for HDP-2.6 > * Start Upgrade > * At first chance, start Downgrade > > In HDP-2.6, ZKFC is marked as {{versionAdvertised=false}}. In HDP-2.6, > {{versionAdvertised=true}}. On downgrade, that component's desired version > should be marked UNKNOWN with upgrade state of NONE. > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java > 6f8ebb7 > > ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java > f5a5b0c > > ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeHelper.java > 52bf428 > > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java > a702e6f > > ambari-server/src/test/resources/stacks/HDP/2.1.1/services/STORM/metainfo.xml > 79a3130 > > ambari-server/src/test/resources/stacks/HDP/2.2.0/services/STORM/metainfo.xml > PRE-CREATION > > Diff: https://reviews.apache.org/r/55634/diff/ > > > Testing > ------- > > Manual. Automated pending. > > > Thanks, > > Nate Cole > >
