Bug 910748
Summary: | Database restore script complains about existing entries and fails horribly | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Petr Spacek <pspacek> | ||||||
Component: | ovirt-engine | Assignee: | Eli Mesika <emesika> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Artyom <alukiano> | ||||||
Severity: | unspecified | Docs Contact: | |||||||
Priority: | high | ||||||||
Version: | 3.1.2 | CC: | acathrow, dyasny, iheim, lpeer, pspacek, pstehlik, Rhev-m-bugs, yeylon, ykaul, yzaslavs | ||||||
Target Milestone: | --- | ||||||||
Target Release: | 3.2.0 | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | infra | ||||||||
Fixed In Version: | sf8 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | Type: | Bug | |||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | Infra | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 915537 | ||||||||
Attachments: |
|
Description
Petr Spacek
2013-02-13 13:27:05 UTC
Created attachment 696802 [details]
Console session
After manual dropping the database I noticed one other problem with restore script: The script refused to create C functions with some permission error. I'm not sure if it is result of dropping of the database or what else went wrong, but I had to create all C functions by hand. My first attempt failed: $ psql -U engine engine=> CREATE FUNCTION uuid_generate_v1() RETURNS uuid engine-> LANGUAGE c STRICT engine-> AS '$libdir/uuid-ossp', 'uuid_generate_v1'; ERROR: permission denied for language c I used procedure from: http://stackoverflow.com/questions/7014437/error-permission-denied-for-language-c Then I was able to create all functions after logging as "postgres" user. $ psql -U postgres -d engine <now copy&paste CREATE FUNCTION and ALTER FUNCTION statements from backup.sql file to postgres console> It was my first experience with Postgres, so most probably some more straight-forward way exists. fixed in commit : befc68a Created attachment 741118 [details]
Output of restore.sh script
After reproducing steps below, bug still exist, see attachment. Reproduced on sf13. this commit was merged in sf13.1 , please recheck I not sure that problem in merge, because I received dropdb error: dropdb: database removal failed: ERROR: database "engine" is being accessed by other users DETAIL: There are 1 other session(s) using the database. After killing all postgres files with: for i in 'lsof | grep postgres | awk {'print $2'} | uniq'; do kill -9 $i And start postgres: /etc/init.d/postgresql start restore.sh script work fine Thanks to Haim (In reply to comment #12) > I not sure that problem in merge, because I received dropdb error: > dropdb: database removal failed: ERROR: database "engine" is being accessed > by other users > DETAIL: There are 1 other session(s) using the database. IMHO the script should detect this situation and stop and do not change anything in DB. Also, some helpful error message like 'Stop ovirt-engine before you start with DB restoration.' or something similar would be really useful. 3.2 has been released 3.2 has been released 3.2 has been released 3.2 has been released |