[ 
https://issues.apache.org/jira/browse/AMBARI-9918?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14347098#comment-14347098
 ] 

Hudson commented on AMBARI-9918:
--------------------------------

SUCCESS: Integrated in Ambari-trunk-Commit #1945 (See 
[https://builds.apache.org/job/Ambari-trunk-Commit/1945/])
AMBARI-9918 - Caching of JPA entities causes SECONDARY_NAMENODE component to be 
re-persisted after NN HA enabling (tbeerbower) (tbeerbower: 
http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=d0406b65e1e6c51aa11bb5f226c1acfec3708fb9)
* ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
* 
ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
* 
ambari-server/src/test/java/org/apache/ambari/server/state/host/HostImplTest.java


> Caching of JPA entities causes SECONDARY_NAMENODE component to be 
> re-persisted after NN HA enabling
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AMBARI-9918
>                 URL: https://issues.apache.org/jira/browse/AMBARI-9918
>             Project: Ambari
>          Issue Type: Bug
>            Reporter: Tom Beerbower
>            Assignee: Tom Beerbower
>             Fix For: 2.0.0
>
>         Attachments: AMBARI-9918.patch
>
>
> There is a problem in that the JPA component state entities are cached as 
> part of the ServiceComponentHostImpl.
> {code}
>   private HostComponentStateEntity stateEntity;
>   private HostComponentDesiredStateEntity desiredStateEntity;
> {code}
> Also in HostImpl ...
> {code}
>   private HostEntity hostEntity;
>   private HostStateEntity hostStateEntity;
> {code}
> The cached entities can be come detached and stale.
> # The JOURNALNODE component is added and a component state entity is created 
> and persisted for it.  Each state entity is associated with a host entity 
> which is associated with all of its components (including SECONDARY_NAMENODE, 
> in this case).  After persisting, the entity becomes detached.
> # The SECONDARY_NAMENODE component is removed.  The component state row is 
> removed from the database via JPA.  The associated host entity is updated to 
> remove the deleted component state entity reference.
> # The JOURNALNODE component state entity refers to a different (detached) 
> host entity instance so it still refers back to the deleted component state 
> entity reference for the SECONDARY_NAMENODE.
> # The heartbeat handler is called which updates the state of the components.  
> When it gets to the JOURNALNODE, the associated stale host entity is 
> persisted along with the now deleted SECONDARY_NAMENODE component state 
> entity.  In other words, the entity manager sees the difference and thinks 
> that the deleted component is being added back.  The row is added back to the 
> database.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to