Bug 843495 - [rhevm-update] Upgrade fails when dwh service is up
Summary: [rhevm-update] Upgrade fails when dwh service is up
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
medium
unspecified
Target Milestone: ---
: ---
Assignee: Kiril Nesenko
QA Contact: David Botzer
URL:
Whiteboard: integration
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-26 13:13 UTC by Kiril Nesenko
Modified: 2015-09-22 13:09 UTC (History)
9 users (show)

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


Attachments (Terms of Use)
logs (6.80 KB, text/x-log)
2012-07-26 13:13 UTC, Kiril Nesenko
no flags Details
si17-si18 (8.30 KB, application/octet-stream)
2012-09-19 05:12 UTC, David Botzer
no flags Details

Description Kiril Nesenko 2012-07-26 13:13:19 UTC
Created attachment 600505 [details]
logs

Description of problem:
Upgrade fails when dwh service is up. There are live connection to the DB.

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

How reproducible:


Steps to Reproduce:
1. Try to run rhevm-update when dwh service is up.
2.
3.
  
Actual results:
update fails due to DB connections

Expected results:


Additional info:

Comment 2 Kiril Nesenko 2012-09-02 19:01:05 UTC
Patch posted for review: http://gerrit.ovirt.org/#/c/7691/

Comment 4 David Botzer 2012-09-19 05:11:42 UTC
Not Fixed, 3.1/si17 --> si18
1. I install si17 clean, with reports+dwh
2. I add in REPO the si18 url
3. I run yum update rhevm-setup & rhevm-upgrade 
Backing Up Database...                                   [ DONE ]
Rename Database...                                       [ ERROR ]
Error: Database rename failed. Check that there are no active connections to the DB and try again.
Error: Upgrade failed.
Not Fixed, 3.1/si17 --> si18

See attached,
------------------------------------------

2012-09-19 08:01:30::ERROR::rhevm-upgrade::930::root:: Traceback (most recent call last):
  File "/usr/bin/rhevm-upgrade", line 923, in <module>
    main(options)
  File "/usr/bin/rhevm-upgrade", line 834, in main
    runFunc([[db.rename, DB_NAME_TEMP]], MSG_INFO_RENAME_DB)
  File "/usr/bin/rhevm-upgrade", line 595, in runFunc
    func[0](*func[1:])
  File "/usr/bin/rhevm-upgrade", line 551, in rename
    utils.execRemoteSqlCommand(SERVER_ADMIN, SERVER_NAME, SERVER_PORT, basedefs.DB_TEMPLATE, query, True, MSG_ERROR_RENAME_DB)
  File "/usr/share/ovirt-engine/scripts/common_utils.py", line 365, in execRemoteSqlCommand
    return execCmd(cmdList=cmd, failOnError=failOnError, msg=errMsg, envDict=env)
  File "/usr/share/ovirt-engine/scripts/common_utils.py", line 339, in execCmd
    raise Exception(msg)
Exception: Error: Database rename failed. Check that there are no active connections to the DB and try again.

Comment 5 David Botzer 2012-09-19 05:12:08 UTC
Created attachment 614200 [details]
si17-si18

Comment 6 Kiril Nesenko 2012-09-22 06:14:30 UTC
Why this bz moved to assigned ? The fix was to print a nice error message:

Error: Database rename failed. Check that there are no active connections to the DB and try again.

That what it does. David take a look on the patch fix.

Comment 7 David Botzer 2012-09-23 06:58:18 UTC
Hi Kiril,

Thanks now I see, what the fix is,

but why doesnt upgrade handles the open connections to the DB,
If a user wants to upgrade, Why should they do it manually ?

Comment 8 David Botzer 2012-09-23 06:59:05 UTC
Waiting for ack on my replay and later on I will move it to verify.

Comment 9 David Botzer 2012-09-23 07:46:40 UTC
Fixed, 3.1/si18
User should stop the DWH manually.
(If not solving the issue - User should restart postgresql service in order to close open connections.)
Fixed, 3.1/si18


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