Bug 1046676 - [DWH-SETUP] - upgrade: update ownership is slow and fills the log
Summary: [DWH-SETUP] - upgrade: update ownership is slow and fills the log
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-dwh
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 3.3.0
Assignee: Yedidyah Bar David
QA Contact: Tareq Alayan
URL:
Whiteboard: integration
Depends On:
Blocks: 1043530 1043951 1043957 rhev3.3ga
TreeView+ depends on / blocked
 
Reported: 2013-12-26 14:00 UTC by Yedidyah Bar David
Modified: 2014-03-20 14:18 UTC (History)
9 users (show)

Fixed In Version: IS30 - rhevm-dwh-3.3.0-27.el6ev.src.rpm
Doc Type: Bug Fix
Doc Text:
When upgrading from 3.2 to 3.3 with a local database, ownership of all database objects are changed from 'postgres' to 'engine history'. This is done by running the pg_dump command to search for the postgres owner, which can fill up the disk with logs if the database size is large. Furthermore, the SQL commands for changing the ownership are run individually, which can be slow. Now, pg_dump only retrieves the schema which is sufficient for this purpose, and all SQL commands are run in a single PSQL command.
Clone Of:
: 1047125 (view as bug list)
Environment:
Last Closed: 2014-01-21 15:05:38 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
dwhlog (27.44 KB, application/x-tar)
2014-01-16 15:33 UTC, Tareq Alayan
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0036 0 normal SHIPPED_LIVE rhevm-dwh 3.3 bug fix and enhancement update 2014-01-21 19:53:35 UTC
oVirt gerrit 22797 0 None None None Never
oVirt gerrit 22906 0 None None None Never
oVirt gerrit 23046 0 None None None Never

Description Yedidyah Bar David 2013-12-26 14:00:18 UTC
Description of problem:

On upgrade from 3.2 to 3.3 with a local database, we change the ownership of all db objects from 'postgres' to 'engine_history'. We do this by running 'pg_dump', searching the output for 'Owner postgres', then create a set of sql commands to change the ownership and run them, each in its own psql command. This has two problems:

1. pg_dump's output also goes to the log, and if the database is large (e.g. several GBs), the log might feel up the disk.
2. Running each command in its own psql is slow

Proposed solution:

1. We should add '-s' to pg_dump to dump only the schema, that's enough for that purpose
2. We should run all the SQL commands in a single psql command.

Comment 2 Tareq Alayan 2014-01-16 15:31:26 UTC
verified on rhevm-dwh-3.3.0-28.el6ev.noarch

Ownership changes and all queries done in single command and pg_dump -s used (upgrade log attached)



======
message regarding backup may take time
=====
The upgrade utility can backup the existing database. The time and space required for the database backup depend on its size. The detected DB size is 18 MB. This process takes time, and in some cases (for instance, when the size is few GBs) may take few hours to complete. Would you like to continue and backup the existing database?

===
owner changed
===
ovirt_engine_history | engine_history | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/engine_history
                                                                              : engine_history=CTc/engine_history
                                                                              : readonly=c/engine_history

Comment 3 Tareq Alayan 2014-01-16 15:33:09 UTC
Created attachment 851146 [details]
dwhlog

Comment 5 errata-xmlrpc 2014-01-21 15:05:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0036.html


Note You need to log in before you can comment on or make changes to this bug.