Bug 1047125 - [reports] upgrade: update ownership is slow and fills the log
Summary: [reports] 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-reports
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 3.3.0
Assignee: Yedidyah Bar David
QA Contact: Tareq Alayan
URL:
Whiteboard: integration
Depends On:
Blocks: rhev3.3ga
TreeView+ depends on / blocked
 
Reported: 2013-12-29 09:48 UTC by Yedidyah Bar David
Modified: 2015-09-22 13:10 UTC (History)
11 users (show)

Fixed In Version: IS31 - rhevm-reports-3.3.0-28.el6ev.noarch.rpm
Doc Type: Bug Fix
Doc Text:
When upgrading from 3.2 to 3.3 with a local database, ownership of all database objects is changed from 'postgres' to 'engine_reports'. 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 only the schema, which is sufficient for this purpose, and all SQL commands are run in a single PSQL command.
Clone Of: 1046676
Environment:
Last Closed: 2014-01-21 14:57:21 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
logs (62.35 KB, application/x-tar-gz)
2014-01-17 09:55 UTC, Tareq Alayan
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0035 0 normal SHIPPED_LIVE rhevm-reports 3.3 bug fix and enhancement update 2014-01-21 19:53:30 UTC
oVirt gerrit 22708 0 None None None Never
oVirt gerrit 23047 0 None None None Never

Description Yedidyah Bar David 2013-12-29 09:48:58 UTC
+++ This bug was initially created as a clone of Bug #1046676 +++

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_reports'. 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, 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.

This is less severe than bz #1046676 because the database in reports is not expected to be large.

Comment 1 Yaniv Lavi 2013-12-29 16:11:13 UTC
So the log will list the table content?
This is a blocker, since passwords will also appear.


Yaniv

Comment 2 Yedidyah Bar David 2013-12-31 10:21:51 UTC
Yes, they appear obfuscated, but I agree it's a blocker.

Comment 4 Tareq Alayan 2014-01-17 09:54:22 UTC
verified on rhevm-reports-3.3.0-28.el6ev.noarch rhevm-dwh-3.3.0-28.el6ev.noarch
see logs attached.
/usr/bin/pg_dump -s rhevmreports

Comment 5 Tareq Alayan 2014-01-17 09:55:39 UTC
Created attachment 851496 [details]
logs

Comment 7 errata-xmlrpc 2014-01-21 14:57:21 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-0035.html


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