You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Alejandro Fernandez <af...@hortonworks.com> on 2015/02/26 03:24:54 UTC

Re: Review Request 31457: [PREVIEW] RU - Bug fixes for Host Version transition and Finalize

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/
-----------------------------------------------------------

(Updated Feb. 26, 2015, 2:24 a.m.)


Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.


Bugs: AMBARI-9805
    https://issues.apache.org/jira/browse/AMBARI-9805


Repository: ambari


Description
-------

1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.

It is of the utmost importance to test these changes in the following scenarios:
Host added during cluster install
Host added after cluster install
Host added after bits are distributed

A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
  ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
  ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b2ba43b 
  ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
  ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 

Diff: https://reviews.apache.org/r/31457/diff/


Testing
-------

Verified on a live cluster.
1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
4. Added new host, c6407 with no services.
Then, added only HDFS client to it.
Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
10. Finalize succeeded


Still need to write unit tests


Thanks,

Alejandro Fernandez


Re: Review Request 31457: [PREVIEW] RU - Bug fixes for Host Version transition and Finalize

Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/#review74272
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
<https://reviews.apache.org/r/31457/#comment120815>

    readWriteLock is way to easy to use accidentally; Please rename this lock to something specific to the use, such as hostTransitionStateLock.
    
    Also, the readLock is never used, so why use a ReadWriteLock? A ReentrantLock is enough here.



ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
<https://reviews.apache.org/r/31457/#comment120816>

    findByCLusterStackVersionAndHost can go outside the lock.


- Jonathan Hurley


On Feb. 25, 2015, 9:24 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31457/
> -----------------------------------------------------------
> 
> (Updated Feb. 25, 2015, 9:24 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-9805
>     https://issues.apache.org/jira/browse/AMBARI-9805
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> 1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
> 2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
> 3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.
> 
> It is of the utmost importance to test these changes in the following scenarios:
> Host added during cluster install
> Host added after cluster install
> Host added after bits are distributed
> 
> A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b2ba43b 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 
> 
> Diff: https://reviews.apache.org/r/31457/diff/
> 
> 
> Testing
> -------
> 
> Verified on a live cluster.
> 1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
> 2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
> 3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
> They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
> 4. Added new host, c6407 with no services.
> Then, added only HDFS client to it.
> Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
> 5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
> 6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
> 7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
> 8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
> 9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
> 10. Finalize succeeded
> 
> 
> Still need to write unit tests
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 31457: [PREVIEW] RU - Bug fixes for Host Version transition and Finalize

Posted by Alejandro Fernandez <af...@hortonworks.com>.

> On Feb. 26, 2015, 3:15 p.m., Tom Beerbower wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java, line 25
> > <https://reviews.apache.org/r/31457/diff/1/?file=877153#file877153line25>
> >
> >     Import not needed.

Fixed.


> On Feb. 26, 2015, 3:15 p.m., Tom Beerbower wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java, lines 43-44
> > <https://reviews.apache.org/r/31457/diff/1/?file=877153#file877153line43>
> >
> >     These get assigned.  Are they ever used?

No. I just removed them.


> On Feb. 26, 2015, 3:15 p.m., Tom Beerbower wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java, lines 97-103
> > <https://reviews.apache.org/r/31457/diff/1/?file=877153#file877153line97>
> >
> >     Are these methods used anywhere?

No. I just removed them.


> On Feb. 26, 2015, 3:15 p.m., Tom Beerbower wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java, lines 105-110
> > <https://reviews.apache.org/r/31457/diff/1/?file=877153#file877153line105>
> >
> >     Could simplify ...
> >     
> >         public boolean isUpgradeFinished() {
> >           return haveAllComponentsFinishedAdvertisingVersion() && haveSameVersion(getHaveAdvertisedVersion());
> >         }

Fixed.


- Alejandro


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/#review74274
-----------------------------------------------------------


On Feb. 27, 2015, 9:51 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31457/
> -----------------------------------------------------------
> 
> (Updated Feb. 27, 2015, 9:51 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-9805
>     https://issues.apache.org/jira/browse/AMBARI-9805
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> 1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
> 2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
> 3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.
> 
> It is of the utmost importance to test these changes in the following scenarios:
> Host added during cluster install
> Host added after cluster install
> Host added after bits are distributed
> 
> A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 13d986d 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 
>   ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java a8b64f8 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/GANGLIA/metainfo.xml fe5f482 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metainfo.xml e0a40b0 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/ZOOKEEPER/metainfo.xml 205b445 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/hdp.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/role_command_order.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/GANGLIA/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/HDFS/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/ZOOKEEPER/metainfo.xml PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/31457/diff/
> 
> 
> Testing
> -------
> 
> Verified on a live cluster.
> 1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
> 2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
> 3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
> They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
> 4. Added new host, c6407 with no services.
> Then, added only HDFS client to it.
> Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
> 5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
> 6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
> 7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
> 8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
> 9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
> 10. Finalize succeeded
> 
> 
> Still need to write unit tests
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 31457: [PREVIEW] RU - Bug fixes for Host Version transition and Finalize

Posted by Tom Beerbower <tb...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/#review74274
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java
<https://reviews.apache.org/r/31457/#comment120818>

    Import not needed.



ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java
<https://reviews.apache.org/r/31457/#comment120820>

    These get assigned.  Are they ever used?



ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java
<https://reviews.apache.org/r/31457/#comment120821>

    Are these methods used anywhere?



ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java
<https://reviews.apache.org/r/31457/#comment120822>

    Could simplify ...
    
        public boolean isUpgradeFinished() {
          return haveAllComponentsFinishedAdvertisingVersion() && haveSameVersion(getHaveAdvertisedVersion());
        }


- Tom Beerbower


On Feb. 26, 2015, 2:24 a.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31457/
> -----------------------------------------------------------
> 
> (Updated Feb. 26, 2015, 2:24 a.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-9805
>     https://issues.apache.org/jira/browse/AMBARI-9805
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> 1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
> 2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
> 3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.
> 
> It is of the utmost importance to test these changes in the following scenarios:
> Host added during cluster install
> Host added after cluster install
> Host added after bits are distributed
> 
> A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b2ba43b 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 
> 
> Diff: https://reviews.apache.org/r/31457/diff/
> 
> 
> Testing
> -------
> 
> Verified on a live cluster.
> 1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
> 2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
> 3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
> They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
> 4. Added new host, c6407 with no services.
> Then, added only HDFS client to it.
> Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
> 5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
> 6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
> 7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
> 8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
> 9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
> 10. Finalize succeeded
> 
> 
> Still need to write unit tests
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 31457: RU - Bug fixes for Host Version transition and Finalize

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/#review74603
-----------------------------------------------------------



ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
<https://reviews.apache.org/r/31457/#comment121227>

    New setup method.



ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
<https://reviews.apache.org/r/31457/#comment121228>

    Helper to simulate the Stack Version Listener.



ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
<https://reviews.apache.org/r/31457/#comment121229>

    This is where the magic happens.


- Alejandro Fernandez


On Feb. 27, 2015, 9:53 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31457/
> -----------------------------------------------------------
> 
> (Updated Feb. 27, 2015, 9:53 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-9805
>     https://issues.apache.org/jira/browse/AMBARI-9805
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> 1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
> 2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
> 3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.
> 
> It is of the utmost importance to test these changes in the following scenarios:
> Host added during cluster install
> Host added after cluster install
> Host added after bits are distributed
> 
> A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 13d986d 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 
>   ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java a8b64f8 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/GANGLIA/metainfo.xml fe5f482 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metainfo.xml e0a40b0 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/ZOOKEEPER/metainfo.xml 205b445 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/hdp.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/role_command_order.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/GANGLIA/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/HDFS/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/ZOOKEEPER/metainfo.xml PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/31457/diff/
> 
> 
> Testing
> -------
> 
> Verified on a live cluster.
> 1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
> 2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
> 3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
> They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
> 4. Added new host, c6407 with no services.
> Then, added only HDFS client to it.
> Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
> 5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
> 6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
> 7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
> 8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
> 9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
> 10. Finalize succeeded
> 
> 
> I added a comprehensive unit test. Waiting for full unit test results.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 31457: RU - Bug fixes for Host Version transition and Finalize

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/#review74702
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java
<https://reviews.apache.org/r/31457/#comment121370>

    What if 1st cluster version is OUT_OF_SYNC and 2nd is current? Looks like this code will assume that upgrade is in progress


- Dmitro Lisnichenko


On Feb. 27, 2015, 11:56 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31457/
> -----------------------------------------------------------
> 
> (Updated Feb. 27, 2015, 11:56 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-9805
>     https://issues.apache.org/jira/browse/AMBARI-9805
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> 1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
> 2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
> 3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.
> 
> It is of the utmost importance to test these changes in the following scenarios:
> Host added during cluster install
> Host added after cluster install
> Host added after bits are distributed
> 
> A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 13d986d 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java 1d13717 
>   ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java c21215a 
>   ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java a8b64f8 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/GANGLIA/metainfo.xml fe5f482 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metainfo.xml e0a40b0 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/ZOOKEEPER/metainfo.xml 205b445 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/hdp.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/role_command_order.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/GANGLIA/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/HDFS/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/ZOOKEEPER/metainfo.xml PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/31457/diff/
> 
> 
> Testing
> -------
> 
> Verified on a live cluster.
> 1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
> 2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
> 3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
> They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
> 4. Added new host, c6407 with no services.
> Then, added only HDFS client to it.
> Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
> 5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
> 6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
> 7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
> 8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
> 9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
> 10. Finalize succeeded
> 
> 
> I added a comprehensive unit test. Waiting for full unit test results.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 31457: RU - Bug fixes for Host Version transition and Finalize

Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/#review74678
-----------------------------------------------------------

Ship it!


Ship It!

- Jonathan Hurley


On Feb. 27, 2015, 6:56 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31457/
> -----------------------------------------------------------
> 
> (Updated Feb. 27, 2015, 6:56 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-9805
>     https://issues.apache.org/jira/browse/AMBARI-9805
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> 1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
> 2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
> 3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.
> 
> It is of the utmost importance to test these changes in the following scenarios:
> Host added during cluster install
> Host added after cluster install
> Host added after bits are distributed
> 
> A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 13d986d 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java 1d13717 
>   ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java c21215a 
>   ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java a8b64f8 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/GANGLIA/metainfo.xml fe5f482 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metainfo.xml e0a40b0 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/ZOOKEEPER/metainfo.xml 205b445 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/hdp.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/role_command_order.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/GANGLIA/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/HDFS/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/ZOOKEEPER/metainfo.xml PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/31457/diff/
> 
> 
> Testing
> -------
> 
> Verified on a live cluster.
> 1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
> 2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
> 3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
> They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
> 4. Added new host, c6407 with no services.
> Then, added only HDFS client to it.
> Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
> 5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
> 6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
> 7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
> 8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
> 9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
> 10. Finalize succeeded
> 
> 
> I added a comprehensive unit test. Waiting for full unit test results.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 31457: RU - Bug fixes for Host Version transition and Finalize

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/#review74954
-----------------------------------------------------------

Ship it!


Ship It!

- Dmitro Lisnichenko


On Feb. 27, 2015, 11:56 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31457/
> -----------------------------------------------------------
> 
> (Updated Feb. 27, 2015, 11:56 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-9805
>     https://issues.apache.org/jira/browse/AMBARI-9805
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> 1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
> 2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
> 3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.
> 
> It is of the utmost importance to test these changes in the following scenarios:
> Host added during cluster install
> Host added after cluster install
> Host added after bits are distributed
> 
> A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 13d986d 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java 1d13717 
>   ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java c21215a 
>   ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java a8b64f8 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/GANGLIA/metainfo.xml fe5f482 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metainfo.xml e0a40b0 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/ZOOKEEPER/metainfo.xml 205b445 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/hdp.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/role_command_order.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/GANGLIA/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/HDFS/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/ZOOKEEPER/metainfo.xml PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/31457/diff/
> 
> 
> Testing
> -------
> 
> Verified on a live cluster.
> 1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
> 2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
> 3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
> They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
> 4. Added new host, c6407 with no services.
> Then, added only HDFS client to it.
> Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
> 5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
> 6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
> 7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
> 8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
> 9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
> 10. Finalize succeeded
> 
> 
> I added a comprehensive unit test. Waiting for full unit test results.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 31457: RU - Bug fixes for Host Version transition and Finalize

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/#review74784
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java
<https://reviews.apache.org/r/31457/#comment121538>

    This function is used in the calculation of when to transition from INSTALLED -> UPGRADING.
    And requires either.
    1. Host has a HostVersion with state CURRENT for version x, and the Host has exactly 1 HostComponentState, whose version is y, meaning an upgrade is in progress (or just finished).
    2. Host's HostComponentState records are advertising two different versions, x and y.
    
    If a Host has one host version in CURRENT, and another in OUT_OF_SYNC, no changes to hdp-select have been called.


- Alejandro Fernandez


On Feb. 27, 2015, 11:56 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31457/
> -----------------------------------------------------------
> 
> (Updated Feb. 27, 2015, 11:56 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-9805
>     https://issues.apache.org/jira/browse/AMBARI-9805
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> 1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
> 2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
> 3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.
> 
> It is of the utmost importance to test these changes in the following scenarios:
> Host added during cluster install
> Host added after cluster install
> Host added after bits are distributed
> 
> A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 13d986d 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java 1d13717 
>   ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java c21215a 
>   ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java a8b64f8 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/GANGLIA/metainfo.xml fe5f482 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metainfo.xml e0a40b0 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/ZOOKEEPER/metainfo.xml 205b445 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/hdp.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/role_command_order.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/GANGLIA/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/HDFS/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/ZOOKEEPER/metainfo.xml PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/31457/diff/
> 
> 
> Testing
> -------
> 
> Verified on a live cluster.
> 1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
> 2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
> 3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
> They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
> 4. Added new host, c6407 with no services.
> Then, added only HDFS client to it.
> Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
> 5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
> 6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
> 7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
> 8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
> 9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
> 10. Finalize succeeded
> 
> 
> I added a comprehensive unit test. Waiting for full unit test results.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 31457: RU - Bug fixes for Host Version transition and Finalize

Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/#review74670
-----------------------------------------------------------

Ship it!


Ship It!

- Nate Cole


On Feb. 27, 2015, 6:56 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31457/
> -----------------------------------------------------------
> 
> (Updated Feb. 27, 2015, 6:56 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-9805
>     https://issues.apache.org/jira/browse/AMBARI-9805
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> 1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
> 2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
> 3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.
> 
> It is of the utmost importance to test these changes in the following scenarios:
> Host added during cluster install
> Host added after cluster install
> Host added after bits are distributed
> 
> A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 13d986d 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java 1d13717 
>   ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java c21215a 
>   ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java a8b64f8 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/GANGLIA/metainfo.xml fe5f482 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metainfo.xml e0a40b0 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/ZOOKEEPER/metainfo.xml 205b445 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/hdp.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/role_command_order.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/GANGLIA/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/HDFS/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/ZOOKEEPER/metainfo.xml PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/31457/diff/
> 
> 
> Testing
> -------
> 
> Verified on a live cluster.
> 1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
> 2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
> 3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
> They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
> 4. Added new host, c6407 with no services.
> Then, added only HDFS client to it.
> Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
> 5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
> 6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
> 7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
> 8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
> 9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
> 10. Finalize succeeded
> 
> 
> I added a comprehensive unit test. Waiting for full unit test results.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 31457: RU - Bug fixes for Host Version transition and Finalize

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/
-----------------------------------------------------------

(Updated Feb. 27, 2015, 11:56 p.m.)


Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.


Bugs: AMBARI-9805
    https://issues.apache.org/jira/browse/AMBARI-9805


Repository: ambari


Description
-------

1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.

It is of the utmost importance to test these changes in the following scenarios:
Host added during cluster install
Host added after cluster install
Host added after bits are distributed

A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
  ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
  ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 13d986d 
  ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
  ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 
  ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java 1d13717 
  ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java c21215a 
  ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java a8b64f8 
  ambari-server/src/test/resources/stacks/HDP/2.0.5/services/GANGLIA/metainfo.xml fe5f482 
  ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metainfo.xml e0a40b0 
  ambari-server/src/test/resources/stacks/HDP/2.0.5/services/ZOOKEEPER/metainfo.xml 205b445 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/metainfo.xml PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/hdp.json PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/role_command_order.json PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/services/GANGLIA/metainfo.xml PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/services/HDFS/metainfo.xml PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/services/ZOOKEEPER/metainfo.xml PRE-CREATION 

Diff: https://reviews.apache.org/r/31457/diff/


Testing
-------

Verified on a live cluster.
1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
4. Added new host, c6407 with no services.
Then, added only HDFS client to it.
Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
10. Finalize succeeded


I added a comprehensive unit test. Waiting for full unit test results.


Thanks,

Alejandro Fernandez


Re: Review Request 31457: RU - Bug fixes for Host Version transition and Finalize

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/
-----------------------------------------------------------

(Updated Feb. 27, 2015, 9:53 p.m.)


Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.


Summary (updated)
-----------------

RU - Bug fixes for Host Version transition and Finalize


Bugs: AMBARI-9805
    https://issues.apache.org/jira/browse/AMBARI-9805


Repository: ambari


Description
-------

1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.

It is of the utmost importance to test these changes in the following scenarios:
Host added during cluster install
Host added after cluster install
Host added after bits are distributed

A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
  ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
  ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 13d986d 
  ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
  ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 
  ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java a8b64f8 
  ambari-server/src/test/resources/stacks/HDP/2.0.5/services/GANGLIA/metainfo.xml fe5f482 
  ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metainfo.xml e0a40b0 
  ambari-server/src/test/resources/stacks/HDP/2.0.5/services/ZOOKEEPER/metainfo.xml 205b445 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/metainfo.xml PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/hdp.json PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/role_command_order.json PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/services/GANGLIA/metainfo.xml PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/services/HDFS/metainfo.xml PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/services/ZOOKEEPER/metainfo.xml PRE-CREATION 

Diff: https://reviews.apache.org/r/31457/diff/


Testing (updated)
-------

Verified on a live cluster.
1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
4. Added new host, c6407 with no services.
Then, added only HDFS client to it.
Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
10. Finalize succeeded


I added a comprehensive unit test. Waiting for full unit test results.


Thanks,

Alejandro Fernandez


Re: Review Request 31457: [PREVIEW] RU - Bug fixes for Host Version transition and Finalize

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/
-----------------------------------------------------------

(Updated Feb. 27, 2015, 9:51 p.m.)


Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.


Changes
-------

Addressed all of the comments and added a comprehensive unit test.


Bugs: AMBARI-9805
    https://issues.apache.org/jira/browse/AMBARI-9805


Repository: ambari


Description
-------

1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.

It is of the utmost importance to test these changes in the following scenarios:
Host added during cluster install
Host added after cluster install
Host added after bits are distributed

A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
  ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
  ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 13d986d 
  ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
  ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 
  ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java a8b64f8 
  ambari-server/src/test/resources/stacks/HDP/2.0.5/services/GANGLIA/metainfo.xml fe5f482 
  ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metainfo.xml e0a40b0 
  ambari-server/src/test/resources/stacks/HDP/2.0.5/services/ZOOKEEPER/metainfo.xml 205b445 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/metainfo.xml PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/hdp.json PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/role_command_order.json PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/services/GANGLIA/metainfo.xml PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/services/HDFS/metainfo.xml PRE-CREATION 
  ambari-server/src/test/resources/stacks/HDP/2.2.0/services/ZOOKEEPER/metainfo.xml PRE-CREATION 

Diff: https://reviews.apache.org/r/31457/diff/


Testing
-------

Verified on a live cluster.
1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
4. Added new host, c6407 with no services.
Then, added only HDFS client to it.
Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
10. Finalize succeeded


Still need to write unit tests


Thanks,

Alejandro Fernandez


Re: Review Request 31457: [PREVIEW] RU - Bug fixes for Host Version transition and Finalize

Posted by Alejandro Fernandez <af...@hortonworks.com>.

> On Feb. 26, 2015, 1:29 p.m., Nate Cole wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java, line 1552
> > <https://reviews.apache.org/r/31457/diff/1/?file=877151#file877151line1552>
> >
> >     Original code had this as setState(state) because it's already decided it's CURRENT.  If we find other conditions where this condition should execute we can just change that "if" instead of 3 of them.

Fixed.


> On Feb. 26, 2015, 1:29 p.m., Nate Cole wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java, line 1566
> > <https://reviews.apache.org/r/31457/diff/1/?file=877151#file877151line1566>
> >
> >     See "state" comment.

Fixed.


- Alejandro


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/#review74266
-----------------------------------------------------------


On Feb. 27, 2015, 9:51 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31457/
> -----------------------------------------------------------
> 
> (Updated Feb. 27, 2015, 9:51 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-9805
>     https://issues.apache.org/jira/browse/AMBARI-9805
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> 1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
> 2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
> 3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.
> 
> It is of the utmost importance to test these changes in the following scenarios:
> Host added during cluster install
> Host added after cluster install
> Host added after bits are distributed
> 
> A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 13d986d 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 
>   ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java a8b64f8 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/GANGLIA/metainfo.xml fe5f482 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metainfo.xml e0a40b0 
>   ambari-server/src/test/resources/stacks/HDP/2.0.5/services/ZOOKEEPER/metainfo.xml 205b445 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/hdp.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/role_command_order.json PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/GANGLIA/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/HDFS/metainfo.xml PRE-CREATION 
>   ambari-server/src/test/resources/stacks/HDP/2.2.0/services/ZOOKEEPER/metainfo.xml PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/31457/diff/
> 
> 
> Testing
> -------
> 
> Verified on a live cluster.
> 1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
> 2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
> 3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
> They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
> 4. Added new host, c6407 with no services.
> Then, added only HDFS client to it.
> Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
> 5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
> 6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
> 7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
> 8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
> 9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
> 10. Finalize succeeded
> 
> 
> Still need to write unit tests
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 31457: [PREVIEW] RU - Bug fixes for Host Version transition and Finalize

Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31457/#review74266
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
<https://reviews.apache.org/r/31457/#comment120810>

    Original code had this as setState(state) because it's already decided it's CURRENT.  If we find other conditions where this condition should execute we can just change that "if" instead of 3 of them.



ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
<https://reviews.apache.org/r/31457/#comment120811>

    See "state" comment.


- Nate Cole


On Feb. 25, 2015, 9:24 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31457/
> -----------------------------------------------------------
> 
> (Updated Feb. 25, 2015, 9:24 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-9805
>     https://issues.apache.org/jira/browse/AMBARI-9805
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> 1. There is a bug in ServiceComponentHostSummary.java since its constructor should not be comparing against the string UKNOWN, but rather rely on ComponentInfo to determine which components need to advertise a version. Also, the function haveAllComponentsFinishedAdvertisingVersion should instead compare the size of all components that can advertise a version, and the subset of those that have done so already.
> 2. ClusterImpl.java has a bug in transitionHostVersionState() when setting the state to UPGRADING if the Host has exactly one Component with a version.
> 3. FinalizeUpgradeAction.java has redundant code now that AMBARI-9755 is in because the call to transitionClusterVersion() will also take care of transitioning HostVersions from INSTALLED->CURRENT for hosts that only have components that do not advertise a version.
> 
> It is of the utmost importance to test these changes in the following scenarios:
> Host added during cluster install
> Host added after cluster install
> Host added after bits are distributed
> 
> A Host may be added with either 0 services, only services that do not advertise a version, or at least one service that advertises a version.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 4dcdc94 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 6b8a917 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b2ba43b 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 6d7455e 
>   ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java ef14f0b 
> 
> Diff: https://reviews.apache.org/r/31457/diff/
> 
> 
> Testing
> -------
> 
> Verified on a live cluster.
> 1. Installed HDP 2.2.2.0 version 2450 with HDFS and ZK on 3 hosts (c6404, c6405, c6406)
> 2. All three hosts transitioned the HostVersion from UPGRADING->CURRENT, and the ClusterVersion was CURRENT
> 3. Added a service (MR + YARN), and Host Component States got added with version of UNKNOWN
> They all finally reported a version, but no changes needed in HostVersions or ClusterVersion
> 4. Added new host, c6407 with no services.
> Then, added only HDFS client to it.
> Which picked up HostVersion in CURRENT and the HostComponentState had a valid version (2.2.2.0-2450)
> 5. Added another host (c6408) with no components. Add Ganglia service, which does not advertise a version. This host did not yet have a HostVersion
> 6. Registered a Repo and distributed bits for 2.2.2.0-2485. All Hosts then had HostVersion for the new repo with a state of INSTALLED
> 7. Added yet one more host that will only have Ganglia Monitor (c6409). It then had a HostVersion in OUT_OF_SYNC, and the ClusterVersion was also OUT_OF_SYNC
> 8. Redistributed bits, all hosts then had INSTALLED for the new version, but only 4/6 hosts have a HostVersion for 2.2.2.0-2450.
> 9. Performed an RU. Before Finalize, all but the last 2 hosts were in UPGRADED, but the last 2 hosts still had a HostVersion in INSTALLED.
> 10. Finalize succeeded
> 
> 
> Still need to write unit tests
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>