ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sid Wagle" <swa...@hortonworks.com>
Subject Re: Review Request 39996: Refactor code that caches stale entity references
Date Mon, 16 Nov 2015 22:52:50 GMT

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

(Updated Nov. 16, 2015, 10:52 p.m.)


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


Changes
-------

Found that @Cacheable(false) has a major problem resulting in shared object cache misbehavior,
verified with using different eclipselink versions that this is not a known issue that is
fixed.


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.

Patch details:
- Make sure cached references are refreshed on getter / setter methods
- Remove Cascaded persist for only those relations that could result in un-intentional persist
of the relationship with downstream objects. eg: ServiceComponentHostDesiredStateEntity
- Marked HostRoleCommand and ExecutionCommand as non-Cacheable entites for JPA
- Make sure bi-directional persist is present on non-Cascaded entities
- Removed refresh() calls that were responsible for


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
c74bbbc 
  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/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/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 9d5fa85 
  ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
7b1c6ca 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
194ac7d 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java f6b388f

  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java 52079cf

  ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAOTest.java
95209d4 
  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 
  ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java
482ac38 

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


Testing
-------

Looking to add further Unit tests.

Existing unit test pass. Last re-run remainig.

Manual testing scenarios pass:
- Cluster deploy
- Add Service
- Add host
- Delete service
- Delete host
- Stop All services
- Delete cluster


Thanks,

Sid Wagle


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message