Author: ncole
Date: Thu Apr 11 13:41:34 2013
New Revision: 1466887
URL: http://svn.apache.org/r1466887
Log:
AMBARI-1865. Copy service configs to cluster-level on upgrade
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql
Modified: incubator/ambari/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1466887&r1=1466886&r2=1466887&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Thu Apr 11 13:41:34 2013
@@ -943,6 +943,8 @@ Trunk (unreleased changes):
AMBARI-1657. User directories on HDFS do not get created with custom names
provided from Ambari UI. (swagle)
+ AMBARI-1865. Fix for upgrade script to copy configurations. (ncole)
+
AMBARI-1703. Fix for smoke tests getting configurations. (ncole)
AMBARI-1678. Fix when there are no service overrides. (ncole)
Modified:
incubator/ambari/trunk/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql?rev=1466887&r1=1466886&r2=1466887&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql
(original)
+++
incubator/ambari/trunk/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql
Thu Apr 11 13:41:34 2013
@@ -32,6 +32,11 @@ GRANT ALL PRIVILEGES ON TABLE ambari.met
CREATE TABLE ambari.clusterconfigmapping (cluster_id bigint NOT NULL,
type_name VARCHAR(255) NOT NULL, version_tag VARCHAR(255) NOT NULL,
create_timestamp BIGINT NOT NULL, selected INTEGER NOT NULL DEFAULT 0, PRIMARY
KEY (cluster_id, type_name, create_timestamp));
GRANT ALL PRIVILEGES ON TABLE ambari.clusterconfigmapping TO :username;
ALTER TABLE ambari.clusterconfigmapping ADD CONSTRAINT
FK_clusterconfigmapping_cluster_id FOREIGN KEY (cluster_id) REFERENCES
ambari.clusters (cluster_id);
+INSERT INTO ambari.clusterconfigmapping(cluster_id, type_name, version_tag,
create_timestamp, selected)
+ (SELECT DISTINCT cluster_id, config_type, config_tag,
cast(date_part('epoch', now()) as bigint), 1
+ FROM ambari.serviceconfigmapping scm
+ WHERE timestamp = (SELECT max(timestamp) FROM ambari.serviceconfigmapping
WHERE cluster_id = scm.cluster_id AND config_type = scm.config_type));
+DELETE FROM ambari.serviceconfigmapping;
CREATE TABLE ambari.hostconfigmapping (cluster_id bigint NOT NULL, host_name
VARCHAR(255) NOT NULL, type_name VARCHAR(255) NOT NULL, version_tag
VARCHAR(255) NOT NULL, service_name VARCHAR(255), create_timestamp BIGINT NOT
NULL, selected INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (cluster_id, host_name,
type_name, create_timestamp));
GRANT ALL PRIVILEGES ON TABLE ambari.hostconfigmapping TO :username;