ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmitriu...@apache.org
Subject [1/2] ambari git commit: AMBARI-12073. ambari-server upgrade to 2.1 fails when config groups exist (dlysnichenko)
Date Mon, 22 Jun 2015 16:41:46 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 0297b3e3d -> bfda37e22
  refs/heads/trunk 7c42f9353 -> a2d31f524


AMBARI-12073. ambari-server upgrade to 2.1 fails when config groups exist (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: a2d31f52458891832384608faea4cb750be68f43
Parents: 7c42f93
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Mon Jun 22 19:40:24 2015 +0300
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Mon Jun 22 19:40:24 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a2d31f52/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
index ac48d42..36a162f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
@@ -436,7 +436,7 @@ public class UpgradeCatalog210 extends AbstractUpgradeCatalog {
       // The column name is different for one table
       String hostNameColumnName = tableName.equals(SERVICE_CONFIG_HOSTS_TABLE) ? "hostname"
: "host_name";
 
-      if (dbAccessor.tableHasData(tableName) && dbAccessor.tableHasColumn(tableName,HOST_NAME_COL))
{
+      if (dbAccessor.tableHasData(tableName) && dbAccessor.tableHasColumn(tableName,
hostNameColumnName)) {
         dbAccessor.executeQuery("UPDATE " + tableName + " t SET host_id = (SELECT host_id
FROM hosts h WHERE h.host_name = t." + hostNameColumnName + ") WHERE t.host_id IS NULL AND
t." + hostNameColumnName + " IS NOT NULL");
 
         // For legacy reasons, the hostrolecommand table will contain "none" for some records
where the host_name was not important.


Mime
View raw message