[ 
https://issues.apache.org/jira/browse/AMBARI-20672?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jonathan Hurley updated AMBARI-20672:
-------------------------------------
    Attachment: AMBARI-20672.patch

> Cluster Merge At End Of Upgrade Creation Cascades Unnecessarily
> ---------------------------------------------------------------
>
>                 Key: AMBARI-20672
>                 URL: https://issues.apache.org/jira/browse/AMBARI-20672
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>    Affects Versions: 2.4.2
>            Reporter: Jonathan Hurley
>            Assignee: Jonathan Hurley
>            Priority: Critical
>             Fix For: 2.5.1
>
>         Attachments: AMBARI-20672.patch
>
>
> During the creation of an upgrade, an association is made between the 
> ClusterEntity and the UpgradeEntity so that determining if an upgrade is in 
> progress can be fast. 
> {code}
>     upgradeEntity.setRequestId(request.getId());
>     request.persist();
>     s_upgradeDAO.create(upgradeEntity);
>     cluster.setUpgradeEntity(upgradeEntity);
> {code}
> {code}
>   public void setUpgradeEntity(UpgradeEntity upgradeEntity) throws 
> AmbariException {
>     try {
>       ClusterEntity clusterEntity = getClusterEntity();
>       clusterEntity.setUpgradeEntity(upgradeEntity);
>       clusterDAO.merge(clusterEntity);
> ...
> {code}
> The problem here is that the merge is propagated to the UpgradeEntity via a 
> {{CascadeType.ALL}} and it's not necessary. It seems like the only cascade 
> should be {{CascadeType.REMOVE}}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to