ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject ambari git commit: AMBARI-22226. RU: Downgrade is failed ZKFC (ncole)
Date Fri, 13 Oct 2017 12:39:57 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 faef3a22e -> de2145908


AMBARI-22226. RU: Downgrade is failed ZKFC (ncole)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/de214590
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/de214590
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/de214590

Branch: refs/heads/branch-2.6
Commit: de2145908647d05f83eb0869f042feb42868b1cd
Parents: faef3a2
Author: Nate Cole <ncole@hortonworks.com>
Authored: Thu Oct 12 16:26:33 2017 -0400
Committer: Nate Cole <ncole@hortonworks.com>
Committed: Fri Oct 13 08:07:35 2017 -0400

----------------------------------------------------------------------
 .../serveraction/ServerActionExecutor.java      |  3 +--
 .../upgrades/FinalizeUpgradeAction.java         | 21 ++++++++++----------
 2 files changed, 11 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/de214590/ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java
index f80d06a..50e3cfe 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java
@@ -18,7 +18,6 @@
 
 package org.apache.ambari.server.serveraction;
 
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -84,7 +83,7 @@ public class ServerActionExecutor {
    * requestSharedDataMap object
    */
   private final Map<Long, ConcurrentMap<String, Object>> requestSharedDataMap
=
-      new HashMap<>();
+      new ConcurrentHashMap<>();
 
   /**
    * Database accessor to query and update the database of action commands.

http://git-wip-us.apache.org/repos/asf/ambari/blob/de214590/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
index 0ce5d30..4d5f3ba 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
@@ -267,7 +267,7 @@ public class FinalizeUpgradeAction extends AbstractUpgradeServerAction
{
             errors.size())).append(System.lineSeparator());
 
         for (InfoTuple error : errors) {
-          messageBuff.append(String.format("%s: $s (current = %s, desired = %s ", error.hostName,
+          messageBuff.append(String.format("%s: %s (current = %s, desired = %s)", error.hostName,
               error.componentName, error.currentVersion, error.targetVersion));
 
           messageBuff.append(System.lineSeparator());
@@ -363,23 +363,22 @@ public class FinalizeUpgradeAction extends AbstractUpgradeServerAction
{
     Set<InfoTuple> errors = new TreeSet<>();
 
     Cluster cluster = upgradeContext.getCluster();
-    RepositoryVersionEntity repositoryVersionEntity = upgradeContext.getRepositoryVersion();
-    StackId targetStackId = repositoryVersionEntity.getStackId();
-
     Set<String> servicesParticipating = upgradeContext.getSupportedServices();
     for (String serviceName : servicesParticipating) {
       Service service = cluster.getService(serviceName);
-      String targetVersion = upgradeContext.getTargetVersion(serviceName);
+      RepositoryVersionEntity repositoryVersionEntity = upgradeContext.getTargetRepositoryVersion(serviceName);
+      StackId targetStackId = repositoryVersionEntity.getStackId();
+      String targetVersion = repositoryVersionEntity.getVersion();
 
       for (ServiceComponent serviceComponent : service.getServiceComponents().values()) {
-        for (ServiceComponentHost serviceComponentHost : serviceComponent.getServiceComponentHosts().values())
{
-          ComponentInfo componentInfo = ambariMetaInfo.getComponent(targetStackId.getStackName(),
-                  targetStackId.getStackVersion(), service.getName(), serviceComponent.getName());
+        ComponentInfo componentInfo = ambariMetaInfo.getComponent(targetStackId.getStackName(),
+            targetStackId.getStackVersion(), service.getName(), serviceComponent.getName());
 
-          if (!componentInfo.isVersionAdvertised()) {
-            continue;
-          }
+        if (!componentInfo.isVersionAdvertised()) {
+          continue;
+        }
 
+        for (ServiceComponentHost serviceComponentHost : serviceComponent.getServiceComponentHosts().values())
{
           if (!StringUtils.equals(targetVersion, serviceComponentHost.getVersion())) {
             errors.add(new InfoTuple(service.getName(), serviceComponent.getName(),
                 serviceComponentHost.getHostName(), serviceComponentHost.getVersion(),


Mime
View raw message