ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [03/50] ambari git commit: AMBARI-14771. Cannot do RU or EU due to exception on server-side. (aonishuk)
Date Tue, 26 Jan 2016 21:45:06 GMT
AMBARI-14771. Cannot do RU or EU due to exception on server-side. (aonishuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 8bf8539565f69a19637f0b8283c851c14b2a0f92
Parents: 662da80
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Fri Jan 22 14:13:03 2016 +0200
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Fri Jan 22 14:13:03 2016 +0200

----------------------------------------------------------------------
 .../server/checks/PreviousUpgradeCompleted.java | 38 ++++++++++----------
 1 file changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8bf85395/ambari-server/src/main/java/org/apache/ambari/server/checks/PreviousUpgradeCompleted.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/PreviousUpgradeCompleted.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/PreviousUpgradeCompleted.java
index dfe17e6..4af0896 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/PreviousUpgradeCompleted.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/PreviousUpgradeCompleted.java
@@ -107,26 +107,26 @@ public class PreviousUpgradeCompleted extends AbstractCheckDescriptor
{
             break;
           }
         }
-      }
-
-      // If it has no downgrade, then the "Save Cluster State" step should have COMPLETED.
-      if (correspondingDowngrade == null) {
-        // Should have only 1 element.
-        List<HostRoleCommandEntity> finalizeCommandList = hostRoleCommandDaoProvider.get().
-            findSortedCommandsByRequestIdAndCustomCommandName(mostRecentUpgrade.getRequestId(),
FINALIZE_ACTION_CLASS_NAME);
 
-        // If the action is not COMPLETED, then something went wrong.
-        if (finalizeCommandList != null) {
-          for (HostRoleCommandEntity command : finalizeCommandList) {
-            if (command.getStatus() != HostRoleStatus.COMPLETED) {
-              errorMessage = MessageFormat.format("Upgrade attempt (id: {0}, request id:
{1}, from version: {2}, " +
-                  "to version: {3}) did not complete task with id {4} since its state is
{5} instead of COMPLETED.",
-                  mostRecentUpgrade.getId(), mostRecentUpgrade.getRequestId(), mostRecentUpgrade.getFromVersion(),
-                  mostRecentUpgrade.getToVersion(), command.getTaskId(), command.getStatus());
-              errorMessage += " Please ensure that you called:\n" + SET_CURRENT_COMMAND;
-              errorMessage += MessageFormat.format("\nFurther, change the status of host_role_command
with " +
-                  "id {0} to COMPLETED", mostRecentUpgrade.getId());
-              break;
+        // If it has no downgrade, then the "Save Cluster State" step should have COMPLETED.
+        if (correspondingDowngrade == null) {
+          // Should have only 1 element.
+          List<HostRoleCommandEntity> finalizeCommandList = hostRoleCommandDaoProvider.get().
+              findSortedCommandsByRequestIdAndCustomCommandName(mostRecentUpgrade.getRequestId(),
FINALIZE_ACTION_CLASS_NAME);
+  
+          // If the action is not COMPLETED, then something went wrong.
+          if (finalizeCommandList != null) {
+            for (HostRoleCommandEntity command : finalizeCommandList) {
+              if (command.getStatus() != HostRoleStatus.COMPLETED) {
+                errorMessage = MessageFormat.format("Upgrade attempt (id: {0}, request id:
{1}, from version: {2}, " +
+                    "to version: {3}) did not complete task with id {4} since its state is
{5} instead of COMPLETED.",
+                    mostRecentUpgrade.getId(), mostRecentUpgrade.getRequestId(), mostRecentUpgrade.getFromVersion(),
+                    mostRecentUpgrade.getToVersion(), command.getTaskId(), command.getStatus());
+                errorMessage += " Please ensure that you called:\n" + SET_CURRENT_COMMAND;
+                errorMessage += MessageFormat.format("\nFurther, change the status of host_role_command
with " +
+                    "id {0} to COMPLETED", mostRecentUpgrade.getId());
+                break;
+              }
             }
           }
         }


Mime
View raw message