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.
DescriptionYedidyah 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.
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
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