Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-20672

Cluster Merge At End Of Upgrade Creation Cascades Unnecessarily

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.4.2
    • 2.5.1
    • ambari-server
    • None

    Description

      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.

          upgradeEntity.setRequestId(request.getId());
      
          request.persist();
      
          s_upgradeDAO.create(upgradeEntity);
          cluster.setUpgradeEntity(upgradeEntity);
      
        public void setUpgradeEntity(UpgradeEntity upgradeEntity) throws AmbariException {
          try {
            ClusterEntity clusterEntity = getClusterEntity();
            clusterEntity.setUpgradeEntity(upgradeEntity);
            clusterDAO.merge(clusterEntity);
      ...
      

      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

      Attachments

        1. AMBARI-20672.patch
          34 kB
          Jonathan Hurley

        Issue Links

          Activity

            People

              jonathanhurley Jonathan Hurley
              jonathanhurley Jonathan Hurley
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: