You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Jonathan Hurley (JIRA)" <ji...@apache.org> on 2017/04/04 16:57:42 UTC

[jira] [Created] (AMBARI-20672) Cluster Merge At End Of Upgrade Creation Cascades Unnecessarily

Jonathan Hurley created AMBARI-20672:
----------------------------------------

             Summary: 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


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)