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 786D61018E for ; Mon, 2 Mar 2015 19:15:00 +0000 (UTC) Received: (qmail 28686 invoked by uid 500); 2 Mar 2015 19:15:00 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 28655 invoked by uid 500); 2 Mar 2015 19:15:00 -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 28638 invoked by uid 99); 2 Mar 2015 19:15:00 -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 19:15:00 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 3ED9A1D3879; Mon, 2 Mar 2015 19:14:59 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============1719592015027463506==" MIME-Version: 1.0 Subject: Re: Review Request 31624: SECONDARY_NAMENODE persist object in memory, causes HostVersion to stay in UPGRADING From: "Jonathan Hurley" To: "Alejandro Fernandez" , "Nate Cole" , "Jonathan Hurley" Cc: "Tom Beerbower" , "Ambari" Date: Mon, 02 Mar 2015 19:14:59 -0000 Message-ID: <20150302191459.12263.10000@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Jonathan Hurley" X-ReviewGroup: Ambari X-ReviewRequest-URL: https://reviews.apache.org/r/31624/ X-Sender: "Jonathan Hurley" References: <20150302190434.12262.22801@reviews.apache.org> In-Reply-To: <20150302190434.12262.22801@reviews.apache.org> Reply-To: "Jonathan Hurley" X-ReviewRequest-Repository: ambari --===============1719592015027463506== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On March 2, 2015, 2:04 p.m., Alejandro Fernandez wrote: > > ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java, line 96 > > > > > > If at some point we fix this JPA bug, is it possible for this call to fail? > > Tom Beerbower wrote: > Thanks for the review. I don't think so. It should have the same semantics as Collection.remove(). If the state entity has already been removed then this should do nothing. No, I don't think so. We're removing by matching on equals() of the hostComponentStateEntity; if EclipseLink already removed it, then this does nothing. If it didn't remove it, then on the merge it will see it's gone anyway and merge properly. - Jonathan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31624/#review74788 ----------------------------------------------------------- On March 2, 2015, 1:31 p.m., Tom Beerbower wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/31624/ > ----------------------------------------------------------- > > (Updated March 2, 2015, 1:31 p.m.) > > > Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, and Nate Cole. > > > Bugs: AMBARI-9869 > https://issues.apache.org/jira/browse/AMBARI-9869 > > > Repository: ambari > > > Description > ------- > > Finalize fails because one of the hosts (always the one that had the secondary namenode before) still has a host_version with a state of UPGRADING and doesn't transition it to UPGRADED. > > When the SECONDARY_NAMENODE is deleted via the Namenode HA wizard, the HostEntity may still retain a reference to it, thereby causing the object to remain in memory. > > For some reason the bi-directional relationships between the host entity and the state entities are not cleaned up on the host side by JPA. > > The patch uses a brute force approach to remove the state entites from the collections held by the host entity. > > > Diffs > ----- > > ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentDesiredStateDAO.java 9635f30 > ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java 66e91d3 > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostEntity.java df22de1 > ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java fe5397b > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java 4ecfe44 > ambari-server/src/test/java/org/apache/ambari/server/orm/dao/HostComponentDesiredStateDAOTest.java PRE-CREATION > ambari-server/src/test/java/org/apache/ambari/server/orm/dao/HostComponentStateDAOTest.java PRE-CREATION > ambari-server/src/test/java/org/apache/ambari/server/orm/entities/HostEntityTest.java PRE-CREATION > ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalogHelper.java 2e59db4 > > Diff: https://reviews.apache.org/r/31624/diff/ > > > Testing > ------- > > Manual testing to verify that the HostEntity references to the state entities are cleaned up. > > All existing tests pass ... > > [INFO] ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] ------------------------------------------------------------------------ > [INFO] Total time: 33:16 min > [INFO] Finished at: 2015-03-02T10:37:09-05:00 > [INFO] Final Memory: 42M/568M > [INFO] ------------------------------------------------------------------------ > > > Thanks, > > Tom Beerbower > > --===============1719592015027463506==--