ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject ambari git commit: AMBARI-12696 Server error was present when would have tried to add host (after upgrade secured cluster from 2.0.0 /1.7.0 to 2.1.1) (dsen)
Date Tue, 11 Aug 2015 07:37:24 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1.1 8b33015bc -> 8b7b076c9


AMBARI-12696 Server error was present when would have tried to add host (after upgrade secured
cluster from 2.0.0 /1.7.0 to 2.1.1) (dsen)


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

Branch: refs/heads/branch-2.1.1
Commit: 8b7b076c93802df91f66928666da4974caca01e6
Parents: 8b33015
Author: Dmytro Sen <dsen@apache.org>
Authored: Tue Aug 11 10:37:15 2015 +0300
Committer: Dmytro Sen <dsen@apache.org>
Committed: Tue Aug 11 10:37:15 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java | 3 +++
 .../org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java  | 4 ++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8b7b076c/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
index af2c349..595078f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
@@ -230,6 +230,9 @@ public class UpgradeCatalog211 extends AbstractUpgradeCatalog {
     dbAccessor.alterColumn(HOST_COMPONENT_STATE_TABLE,
         new DBColumnInfo(HOST_COMPONENT_STATE_ID_COLUMN, Long.class, null, null, false));
 
+    // Add sequence for hostcomponentstate id
+    addSequence("hostcomponentstate_id_seq", id.get(), false);
+
     // drop the current PK
     String primaryKeyConstraintName = null;
     Configuration.DatabaseType databaseType = configuration.getDatabaseType();

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b7b076c/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java
index ac5d602..b41b105 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java
@@ -18,6 +18,8 @@
 
 package org.apache.ambari.server.upgrade;
 
+import static org.easymock.EasyMock.anyBoolean;
+import static org.easymock.EasyMock.anyLong;
 import static org.easymock.EasyMock.anyObject;
 import static org.easymock.EasyMock.capture;
 import static org.easymock.EasyMock.expect;
@@ -86,6 +88,8 @@ public class UpgradeCatalog211Test extends EasyMockSupport {
       expectLastCall().andReturn(connection).anyTimes();
       connection.createStatement();
       expectLastCall().andReturn(statement).anyTimes();
+      statement.executeQuery("SELECT COUNT(*) from ambari_sequences where sequence_name='hostcomponentstate_id_seq'");
+      expectLastCall().andReturn(resultSet).atLeastOnce();
       statement.executeQuery(anyObject(String.class));
       expectLastCall().andReturn(resultSet).anyTimes();
 


Mime
View raw message