[ 
https://issues.apache.org/jira/browse/AMBARI-21998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16172094#comment-16172094
 ] 

Hadoop QA commented on AMBARI-21998:
------------------------------------

{color:red}-1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12887923/AMBARI-21998.patch
  against trunk revision .

    {color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

    {color:red}-1 tests included{color}.  The patch doesn't appear to include 
any new or modified tests.
                        Please justify why no new tests are needed for this 
patch.
                        Also please list what manual steps were performed to 
verify this patch.

    {color:green}+1 release audit{color}.  The applied patch does not increase 
the total number of release audit warnings.

    {color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

    {color:red}-1 core tests{color}.  The test build failed in 
[ambari-server|https://builds.apache.org/job/Ambari-trunk-test-patch/12288//artifact/patch-work/testrun_ambari-server.txt]
 

Console output: 
https://builds.apache.org/job/Ambari-trunk-test-patch/12288//console

This message is automatically generated.

> Ambari upgrade don't delete stale constraints
> ---------------------------------------------
>
>                 Key: AMBARI-21998
>                 URL: https://issues.apache.org/jira/browse/AMBARI-21998
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>            Reporter: Dmitry Lysnichenko
>            Assignee: Dmitry Lysnichenko
>            Priority: Critical
>         Attachments: AMBARI-21998.patch
>
>
> During  Ambari upgrade from 2.2.2 to 2.5 I discovered that some UNIQUE 
> constraints are definned without name in older Ambari versions, and then 
> altered by name in UpgadeCatalogs/newer DDLs.
> For example:
> Ambari 2.2.2
> https://github.com/apache/ambari/blob/branch-2.2.2/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
> {code} UNIQUE (ldap_user, user_name));{code}
> Ambari-2.4.0
> https://github.com/apache/ambari/blob/branch-2.4/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql#L288
> {code}  CONSTRAINT UNQ_users_0 UNIQUE (user_name, user_type)){code}
> As a result, during upgrade from Ambari 2.2.2 to Ambari 2.5.0, the stale 
> unique constraint with default name is not deleted.
> That will reproduce on Postgres for any upgrade path that includes these 
> versions.
> {code}ambari=# \d+ users
> Table "ambari.users"
> Column         |            Type             |             Modifiers          
>     | Storage  | Description
> -----------------------+-----------------------------+------------------------------------+----------+-------------
> user_id               | integer                     | not null                
>            | plain    |
> principal_id          | bigint                      | not null                
>            | plain    |
> ldap_user             | integer                     | not null default 0      
>            | plain    |
> user_name             | character varying(255)      | not null                
>            | extended |
> create_time           | timestamp without time zone | default now()           
>            | plain    |
> user_password         | character varying(255)      |                         
>            | extended |
> active                | integer                     | not null default 1      
>            | plain    |
> active_widget_layouts | character varying(1024)     | default NULL::character 
> varying    | extended |
> user_type             | character varying(255)      | default 
> 'LOCAL'::character varying | extended |
> Indexes:
> "users_pkey" PRIMARY KEY, btree (user_id)
> "unq_users_0" UNIQUE, btree (user_name, user_type)
> "users_ldap_user_key" UNIQUE, btree (ldap_user, user_name)
> Foreign-key constraints:
> "fk_users_principal_id" FOREIGN KEY (principal_id) REFERENCES 
> adminprincipal(principal_id)
> Referenced by:
> TABLE "members" CONSTRAINT "fk_members_user_id" FOREIGN KEY (user_id) 
> REFERENCES users(user_id)
> Has OIDs: no
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to