-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39996/#review106040
-----------------------------------------------------------
@OneToMany(mappedBy = "clusterServiceEntity", cascade = CascadeType.ALL)
private Collection<ServiceComponentDesiredStateEntity>
serviceComponentDesiredStateEntities;
Can we get rid of this cascade also? at least change it from ALL to REMOVE or
{PERSIST, REMOVE}
One more test case to check: remove cluster (via API, this also happens in
install wizard sometimes but not sure about exact case)
- Myroslav Papirkovskyy
On Лис. 11, 2015, 5:11 до полудня, Sid Wagle wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39996/
> -----------------------------------------------------------
>
> (Updated Лис. 11, 2015, 5:11 до полудня)
>
>
> Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, Mahadev
> Konar, Myroslav Papirkovskyy, Sumit Mohanty, and Sebastian Toader.
>
>
> 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 appropriately
> - Remove Cascaded persist for only those relations that could result in
> un-intentional persist of the relationship with downstream objects. eg:
> ServiceComponentHostDesiredStateEntity
>
>
> Diffs
> -----
>
>
> 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. Last re-run remainig.
>
> Manual testing scenarios pass:
> - Cluster deploy
> - Add Service
> - Add host
> - Delete service
> - Delete host
>
>
> Thanks,
>
> Sid Wagle
>
>