ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sumit Mohanty" <smoha...@hortonworks.com>
Subject Re: Review Request 36762: ambari-server upgrade from 2.0.1 to 2.1.0 failed in postgres while deleting foreign keys
Date Fri, 24 Jul 2015 02:14:32 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36762/#review92858
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/PostgresHelper.java
(line 64)
<https://reviews.apache.org/r/36762/#comment147112>

    Did the old value result in a bug - it seems like something that would have resulted in
an issue.


- Sumit Mohanty


On July 24, 2015, 1:37 a.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36762/
> -----------------------------------------------------------
> 
> (Updated July 24, 2015, 1:37 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Sid Wagle, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-12520
>     https://issues.apache.org/jira/browse/AMBARI-12520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Ambari upgrade from 2.0.1 to 2.1.0 failed with
> 
> ```
> 23 Jul 2015 11:37:20,869 ERROR [main] DBAccessorImpl:697 – Error executing query: ALTER
TABLE hosts DROP CONSTRAINT hosts_pkey
> org.postgresql.util.PSQLException: ERROR: cannot drop constraint hosts_pkey on table
hosts because other objects depend on it
> Detail: constraint fk_hostconfigmapping_host_name on table hostconfigmapping depends
on index hosts_pkey
> Hint: Use DROP … CASCADE to drop the dependent objects too.
> ```
> 
> This was a postgres database, and it is possible that the name of the FK was different
on that database.
> To make the code more robust, I decided to use a CASCADE DELETE.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java 9104624 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java ef65853

>   ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/DbmsHelper.java
bf3a87f 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/GenericDbmsHelper.java
39926ef 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/PostgresHelper.java
10be314 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
3c274b2 
> 
> Diff: https://reviews.apache.org/r/36762/diff/
> 
> 
> Testing
> -------
> 
> Unit tests in progress.
> 
> I verified that an Ambari upgrade from 2.0.1 to 2.1.0 was successful using Postgres.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message