Bug 1034201

Summary: Issues during database cleanup after upgrade
Product: Red Hat Enterprise Virtualization Manager Reporter: Alon Bar-Lev <alonbl>
Component: ovirt-engine-setupAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact: sefi litmanovich <slitmano>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: acathrow, bazulay, didi, eedri, emesika, iheim, knesenko, pstehlik, Rhev-m-bugs, sbonazzo, yeylon
Target Milestone: ---Keywords: AutomationBlocker, Regression, Triaged
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: is27 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1049022    
Attachments:
Description Flags
sql_file none

Description Alon Bar-Lev 2013-11-25 12:20:38 UTC
2013-11-25 09:03:12 DEBUG otopi.plugins.ovirt_engine_setup.db.schema plugin.execute:446 execute-output: ('/bin/psql', '-w', '-h', 'localhost', '-p', '5432', '-U', 'engine', '-d', 'engine', '-f', '/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql') stderr:

Kiril, please attach this file sql file.

psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:22: ERROR:  must be owner of extension plpgsql

^^^^^^^^^^^^^ Eli, maybe we should disable extensions on legacy upgrade.

psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:38: ERROR:  type "all_storage_usage_rs" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:56: ERROR:  type "all_vds_group_usage_rs" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:71: ERROR:  type "async_tasks_info_rs" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:82: ERROR:  type "booleanresulttype" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:95: ERROR:  type "disks_basic_rs" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:111: ERROR:  type "fk_info_rs" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:123: ERROR:  type "get_all_commands_rs" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:143: ERROR:  type "getallfromsnapshotsbyvmid_rs" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:165: ERROR:  type "getallfromvm_pools_rs" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:176: ERROR:  type "getnamesofvmstaticdedicatedtovds_rs" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:187: ERROR:  type "getorderedvmguidsforrunmultipleactions_rs" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:200: ERROR:  type "getrepo_files_in_all_storage_pools_rs" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:211: ERROR:  type "getstoragedomainidsbystoragepoolidandstatus_rs" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:222: ERROR:  type "getsystem_statistics_rs" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:233: ERROR:  type "idtexttype" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:244: ERROR:  type "iduuidtype" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:275: ERROR:  type "networkviewclustertype" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:288: ERROR:  type "user_permissions" already exists
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:300: ERROR:  type "vds_group_usage_rs" already exists

^^^^^^^^^^^^^ Eli please provide sql to drop types, per[1]

I think it is time you take ownership on the database modules within the packaging.

We are one step farther of killing the entire dbscript... so better you involve now in maintaining the database modules.

[1] http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=blob;f=packaging/setup/ovirt_engine_setup/database.py;hb=HEAD#l335

psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:17748: ERROR:  function "uuid_generate_v1" already exists with same argument types

^^^^^^^^^^^^^^ Eli please interpret and investigate why this was not dropped.

psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:18140: WARNING:  column "storage_pool_id" has type "unknown"
DETAIL:  Proceeding with relation creation anyway.
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:18140: WARNING:  column "storage_pool_name" has type "unknown"
DETAIL:  Proceeding with relation creation anyway.

^^^^^^^^^^^^^^^^ ?

psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:22417: WARNING:  no privileges could be revoked for "public"
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:22418: WARNING:  no privileges could be revoked for "public"
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:22419: WARNING:  no privileges were granted for "public"
psql:/var/lib/ovirt-engine/backups/engine-20131125090300.fcn1PI.sql:22420: WARNING:  no privileges were granted for "public"

^^^^^^^^^^^^^^^^ ?

Comment 1 Kiril Nesenko 2013-11-25 12:28:16 UTC
Created attachment 828625 [details]
sql_file

Comment 4 Yedidyah Bar David 2013-12-09 13:55:02 UTC
Eli, now got in cleanup after setup:

[ ERROR ] Failed to execute stage 'Misc configuration': relation "information_schema.user_defined_types" does not exist LINE 1: ... user_defined_type_name || ' ' || 'cascade;' from informatio...                                                              ^ QUERY:   select 'drop function if exists ' || ns.nspname || '.' || proname || '(' || oidvectortypes(proargtypes) || ') cascade;' from pg_proc inner join pg_namespace ns on ( pg_proc.pronamespace=ns.oid ) where ns.nspname = 'public' union select 'drop type if exists ' || user_defined_type_name || ' ' || 'cascade;' from information_schema.user_defined_types where user_defined_type_schema = 'public' CONTEXT:  PL/pgSQL function "oesetup_generate_drop_all_syntax" line 2 at RETURN QUERY

please check. Thanks.

Comment 5 Eli Mesika 2013-12-09 14:08:26 UTC
Please check again after the following are merged :

http://gerrit.ovirt.org/#/c/22170/
http://gerrit.ovirt.org/#/c/22188/

Comment 6 Yedidyah Bar David 2013-12-09 14:30:14 UTC
Eli - they are merged to master. Can you push to 3.3? I tried to, but had conflicts - perhaps because earlier changes are also not pushed for 3.3, not sure which.

Comment 7 Eli Mesika 2013-12-09 14:53:53 UTC
(In reply to Yedidyah Bar David from comment #6)
> Eli - they are merged to master. Can you push to 3.3? I tried to, but had
> conflicts - perhaps because earlier changes are also not pushed for 3.3, not
> sure which.

This was already pushed to 3.3 in http://gerrit.ovirt.org/#/c/22022/

Comment 8 sefi litmanovich 2013-12-16 15:16:42 UTC
Verified on RHEVM 3.3 IS27

Comment 9 Itamar Heim 2014-01-21 22:26:15 UTC
Closing - RHEV 3.3 Released

Comment 10 Itamar Heim 2014-01-21 22:29:42 UTC
Closing - RHEV 3.3 Released