You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2018/08/07 18:20:57 UTC

[ambari] branch branch-2.7 updated: [AMBARI-24413] - Unable to Revert a Patch When There Are Multiple Patches (#1983) (#1984)

This is an automated email from the ASF dual-hosted git repository.

jonathanhurley pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
     new 6a66e03  [AMBARI-24413] - Unable to Revert a Patch When There Are Multiple Patches (#1983) (#1984)
6a66e03 is described below

commit 6a66e039fa8e2ec5d3b4398becd02918a1c572b4
Author: Jonathan Hurley <jo...@apache.org>
AuthorDate: Tue Aug 7 14:20:55 2018 -0400

    [AMBARI-24413] - Unable to Revert a Patch When There Are Multiple Patches (#1983) (#1984)
---
 .../java/org/apache/ambari/server/state/UpgradeContext.java    | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java b/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java
index 0ccc15e..c01c5e4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java
@@ -359,14 +359,11 @@ public class UpgradeContext {
       m_type = calculateUpgradeType(upgradeRequestMap, revertUpgrade);
 
       // !!! build all service-specific reversions
-      Set<RepositoryVersionEntity> priors = new HashSet<>();
       Map<String, Service> clusterServices = cluster.getServices();
       for (UpgradeHistoryEntity history : revertUpgrade.getHistory()) {
         String serviceName = history.getServiceName();
         String componentName = history.getComponentName();
 
-        priors.add(history.getFromReposistoryVersion());
-
         // if the service is no longer installed, do nothing
         if (!clusterServices.containsKey(serviceName)) {
           LOG.warn("{}/{} will not be reverted since it is no longer installed in the cluster",
@@ -380,13 +377,6 @@ public class UpgradeContext {
         m_targetRepositoryMap.put(serviceName, history.getFromReposistoryVersion());
       }
 
-      if (priors.size() != 1) {
-        String message = String.format("Upgrade from %s could not be reverted as there is no single "
-            + " repository across services.", revertUpgrade.getRepositoryVersion().getVersion());
-
-        throw new AmbariException(message);
-      }
-
       // the "associated" repository of the revert is the target of what's being reverted
       m_repositoryVersion = revertUpgrade.getRepositoryVersion();