瀏覽代碼

AMBARI-2159. After upgrading ambari from 1.2.2.5 to 1.2.3.6 the server throws 500 error when starting/stopping any service. part-II. (smohanty)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1487496 13f79535-47bb-0310-9956-ffa450edef68
Sumit Mohanty 12 年之前
父節點
當前提交
3ce3380903
共有 2 個文件被更改,包括 6 次插入7 次删除
  1. 3 0
      CHANGES.txt
  2. 3 7
      ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql

+ 3 - 0
CHANGES.txt

@@ -2170,6 +2170,9 @@ AMBARI-1.2.0 branch:
 
  BUG FIXES
 
+ AMBARI-2159. After upgrading ambari from 1.2.2.5 to 1.2.3.6 the server
+ throws 500 error when starting/stopping any service. part-II (smohanty)
+
  AMBARI-2057. Gmond left in init after install, part-II. (smohanty)
 
  AMBARI-1613.  ConfigurationResourceProvider doesn't properly handle OR

+ 3 - 7
ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql

@@ -29,18 +29,14 @@ ALTER TABLE ambari.clusterstate
 CREATE TABLE ambari.metainfo ("metainfo_key" VARCHAR(255), "metainfo_value" VARCHAR, PRIMARY KEY("metainfo_key"));
 GRANT ALL PRIVILEGES ON TABLE ambari.metainfo TO :username;
 
-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));
+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, user_name VARCHAR(255) NOT NULL DEFAULT '_db', PRIMARY KEY (cluster_id, host_name, type_name, create_timestamp));
 GRANT ALL PRIVILEGES ON TABLE ambari.hostconfigmapping TO :username;
 ALTER TABLE ambari.hostconfigmapping ADD CONSTRAINT FK_hostconfigmapping_cluster_id FOREIGN KEY (cluster_id) REFERENCES ambari.clusters (cluster_id);
 ALTER TABLE ambari.hostconfigmapping ADD CONSTRAINT FK_hostconfigmapping_host_name FOREIGN KEY (host_name) REFERENCES ambari.hosts (host_name);
 
 ALTER ROLE :username SET search_path to 'ambari';
 
-ALTER SEQUENCE ambari.host_role_command_task_id_seq INCREMENT BY 50;
-SELECT nextval('ambari.host_role_command_task_id_seq');
-
-ALTER TABLE ambari.stage ADD COLUMN request_context VARCHAR(255);SELECT nextval('ambari.host_role_command_task_id_seq');
-
+ALTER TABLE ambari.stage ADD COLUMN request_context VARCHAR(255);
 
 -- portability changes for MySQL/Oracle support
 alter table ambari.hostcomponentdesiredconfigmapping rename to hcdesiredconfigmapping;
@@ -55,7 +51,7 @@ insert into ambari.ambari_sequences(sequence_name, "value")
   union all
   select 'user_id_seq', nextval('ambari.users_user_id_seq')
   union all
-  select 'host_role_command_id_seq', nextval('ambari.host_role_command_task_id_seq');
+  select 'host_role_command_id_seq', (select max(task_id) from ambari.host_role_command) + 51;
 
 drop sequence ambari.host_role_command_task_id_seq;
 drop sequence ambari.users_user_id_seq;