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

(Updated Nov. 10, 2015, 8:22 p.m.)


Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, Mahadev Konar, 
Myroslav Papirkovskyy, Sumit Mohanty, and Sebastian Toader.


Changes
-------

Changes : Get calls will update cached references. Ignore JPA caching for HRC 
and ExecCmd, these objects are explicitly cached by ActionDBAccessorImpl.


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


Repository: ambari


Description
-------

Problems:
- Deleted hostcomponent rows re-appear
- Inconsistencies in hostcomponentstate and hostcomponentdesiredstate tables

Analysis:
- Stale entity references cached that point to dettached entites and may get 
persisted in altogether different transaction
- Cascaded persist annotation mixed with manual bi-directional persist 
operations. The manual persist was done since there are cached references in 
the object hierarchy at different levels. The Casade addition seems to have 
been an after thought added on even though manual bi-directional perist laways 
existed.

Preliminary patch:
- Make sure cached references are refreshed appropriately
- Remove Cascaded persist for only those relations that could result in 
un-intentional persist of the relationship with downstream objects. eg: 
ServiceComponentHostDesiredStateEntity


Diffs (updated)
-----

  
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
 99c327f 
  
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterServiceEntity.java
 eade294 
  
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ExecutionCommandEntity.java
 25d830b 
  
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentDesiredStateEntity.java
 101aea1 
  
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
 ee8e7d6 
  
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostEntity.java
 42f7777 
  
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostRoleCommandEntity.java
 bb8ba19 
  
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceComponentDesiredStateEntity.java
 c39ecc4 
  
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
 6150011 
  ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
bbe2f62 
  
ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
 7b1c6ca 
  
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java
 f6b388f 
  
ambari-server/src/test/java/org/apache/ambari/server/testing/DBInconsistencyTests.java
 PRE-CREATION 
  
ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog150Test.java
 39dd815 

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


Testing
-------

Looking to add further Unit tests.

Existing unit test pass.

Manual testing: Cluster deploy successful. Need to test blueprints.


Thanks,

Sid Wagle

Reply via email to