Bug 844341 - [rhevm] - Installer - restore DB fail on upgrade
Summary: [rhevm] - Installer - restore DB fail on upgrade
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-setup
Version: 3.1.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: ---
Assignee: Moran Goldboim
QA Contact: David Botzer
URL:
Whiteboard: integration
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-30 11:06 UTC by David Botzer
Modified: 2014-01-14 00:03 UTC (History)
8 users (show)

Fixed In Version: si13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-04 20:00:59 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
failedrestore the DB (60.11 KB, application/octet-stream)
2012-07-30 11:06 UTC, David Botzer
no flags Details

Description David Botzer 2012-07-30 11:06:38 UTC
Created attachment 601212 [details]
failedrestore the DB

Description of problem:
Failed to restore engine db during setup, when running engine-setup while engine db already exists

Exception: Failed to rename DB 'engine' to 'engine_2012_07_29_14_30_37'. Check that there are no active connections and try again.

Version-Release number of selected component (if applicable):
3.1/si12

How reproducible:
always

Steps to Reproduce:
1.install rhevm
2.run engine-setup
3.Rerun engine-setup
  
Actual results:
The engine tried to upgrade the DB (and actually, It went fine) 
however, the execution of engine-config afterwards failed, and setup tried to restore the DB.

the DB restore failed since setup didn't dropped the DB before (probably it thinks that the db was renamed). 

Exception: Failed to rename DB 'engine' to 'engine_2012_07_29_14_30_37'. Check that there are no active connections and try again.

Expected results:


Additional info:

Comment 1 Ofer Schreiber 2012-07-30 11:47:51 UTC
http://gerrit.ovirt.org/#/c/6759/1

Comment 3 David Botzer 2012-08-05 08:06:33 UTC
Fixed, SI13
Remote DB setup was able to upgrade Engine DB
Fixed, SI13

Comment 4 Ofer Schreiber 2012-08-07 08:01:18 UTC
David,

The issue (as described in the topic) is not the upgrade of rempote DB.
You should check what happens when the remote DB upgrade fails, and if engine-upgrade is able to restore the old DB.

Comment 5 David Botzer 2012-08-07 09:16:45 UTC
Ok Ofer,
Retested on SI13.1-> Fixed,

On remote Setup I did->
1) I have moved the engine-config from /usr/share/ovirt-engine/engine-config/engine-config to /tmp
2) I have ran rhevm-setup in order for the upgrade engine db to fail 
and to restore the previous engine db successfully.

3) As expected rhevm-setup fails, and engine db is restored and can be accessed via pgadmin
The creation date is as expected ->2 days ago (Seen in dwh_history_timekeeping)
==============================
2012-08-07 11:46:48::DEBUG::common_utils::690::root:: DB Restore completed successfully
2012-08-07 11:46:48::DEBUG::setup_sequences::62::root:: Traceback (most recent call last):
  File "/usr/share/ovirt-engine/scripts/setup_sequences.py", line 60, in run
    function()
  File "/usr/bin/rhevm-setup", line 1060, in _upgradeDB
    raise Exception(output_messages.ERR_DB_UPGRADE_FAILED)
Exception: Database upgrade failed. Previous database has been restored


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