Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 78F051004E for ; Mon, 2 Mar 2015 18:53:59 +0000 (UTC) Received: (qmail 50361 invoked by uid 500); 2 Mar 2015 18:53:59 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 50328 invoked by uid 500); 2 Mar 2015 18:53:59 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 50299 invoked by uid 99); 2 Mar 2015 18:53:59 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Mar 2015 18:53:59 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 5B06A1D37A8; Mon, 2 Mar 2015 18:53:58 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============0140086017675092877==" MIME-Version: 1.0 Subject: Re: Review Request 31457: RU - Bug fixes for Host Version transition and Finalize From: "Alejandro Fernandez" To: "Tom Beerbower" , "Nate Cole" , "Dmitro Lisnichenko" , "Jonathan Hurley" Cc: "Ambari" , "Alejandro Fernandez" Date: Mon, 02 Mar 2015 18:53:58 -0000 Message-ID: <20150302185358.12263.89791@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Alejandro Fernandez" X-ReviewGroup: Ambari X-ReviewRequest-URL: https://reviews.apache.org/r/31457/ X-Sender: "Alejandro Fernandez" References: <20150227235630.1420.81689@reviews.apache.org> In-Reply-To: <20150227235630.1420.81689@reviews.apache.org> Reply-To: "Alejandro Fernandez" X-ReviewRequest-Repository: ambari --===============0140086017675092877== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- 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 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 > > --===============0140086017675092877==--