Bug 844341 - [rhevm] - Installer - restore DB fail on upgrade
[rhevm] - Installer - restore DB fail on upgrade
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-setup (Show other bugs)
3.1.0
x86_64 Linux
high Severity high
: ---
: ---
Assigned To: Moran Goldboim
David Botzer
integration
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-30 07:06 EDT by David Botzer
Modified: 2014-01-13 19:03 EST (History)
8 users (show)

See Also:
Fixed In Version: si13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-04 15:00:59 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description David Botzer 2012-07-30 07:06:38 EDT
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 07:47:51 EDT
http://gerrit.ovirt.org/#/c/6759/1
Comment 3 David Botzer 2012-08-05 04:06:33 EDT
Fixed, SI13
Remote DB setup was able to upgrade Engine DB
Fixed, SI13
Comment 4 Ofer Schreiber 2012-08-07 04:01:18 EDT
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 05:16:45 EDT
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.