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

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


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

commit 7a45a541b96177a0b4f037520bcd40016a9c54fe
Author: Jonathan Hurley <[email protected]>
AuthorDate: Tue Aug 7 12:31:42 2018 -0400

    [AMBARI-24413] - Unable to Revert a Patch When There Are Multiple Patches 
(#1983)
---
 .../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();
 

Reply via email to