You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2013/08/23 01:43:52 UTC

[2/2] git commit: AMBARI-2968. Configuration update fails after upgrade.

AMBARI-2968. Configuration update fails after upgrade.


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

Branch: refs/heads/branch-1.4
Commit: b1269557c56e0972333ad7fb90ee5cfa058a3af0
Parents: b3563ae
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Thu Aug 22 16:21:19 2013 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Thu Aug 22 16:43:12 2013 -0700

----------------------------------------------------------------------
 .../upgrade/dml/Ambari-DML-Postgres-UPGRADE_STACK.sql   | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b1269557/ambari-server/src/main/resources/upgrade/dml/Ambari-DML-Postgres-UPGRADE_STACK.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade/dml/Ambari-DML-Postgres-UPGRADE_STACK.sql b/ambari-server/src/main/resources/upgrade/dml/Ambari-DML-Postgres-UPGRADE_STACK.sql
index 88f022b..5e00413 100644
--- a/ambari-server/src/main/resources/upgrade/dml/Ambari-DML-Postgres-UPGRADE_STACK.sql
+++ b/ambari-server/src/main/resources/upgrade/dml/Ambari-DML-Postgres-UPGRADE_STACK.sql
@@ -21,6 +21,10 @@ PREPARE clusters (text, text) AS
   UPDATE ambari.clusters
     SET desired_stack_version = '{"stackName":"' || $1 || '","stackVersion":"' || $2 || '"}';
 
+PREPARE clusterstate (text, text) AS
+  UPDATE ambari.clusterstate
+    SET current_stack_version = '{"stackName":"' || $1 || '","stackVersion":"' || $2 || '"}';
+
 PREPARE hostcomponentdesiredstate (text, text) AS
   UPDATE ambari.hostcomponentdesiredstate
     SET desired_stack_version = '{"stackName":"' || $1 || '","stackVersion":"' || $2 || '"}';
@@ -37,8 +41,14 @@ PREPARE servicedesiredstate (text, text) AS
   UPDATE ambari.servicedesiredstate
     SET desired_stack_version = '{"stackName":"' || $1 || '","stackVersion":"' || $2 || '"}';
 
+PREPARE resetcomponentstate AS
+  UPDATE ambari.hostcomponentstate
+    SET current_state = 'INSTALLED' where current_state = 'UPGRADING';
+
 EXECUTE clusters(:stack_name, :stack_version);
+EXECUTE clusterstate(:stack_name, :stack_version);
 EXECUTE hostcomponentdesiredstate(:stack_name, :stack_version);
 EXECUTE hostcomponentstate(:stack_name, :stack_version);
 EXECUTE servicecomponentdesiredstate(:stack_name, :stack_version);
-EXECUTE servicedesiredstate(:stack_name, :stack_version);
\ No newline at end of file
+EXECUTE servicedesiredstate(:stack_name, :stack_version);
+EXECUTE resetcomponentstate;
\ No newline at end of file