Bug 890995 - engine: unlock_entity.sh is not finding a locked template
Summary: engine: unlock_entity.sh is not finding a locked template
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.1.1
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
: 3.2.0
Assignee: Eli Mesika
QA Contact: Pavel Stehlik
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-31 15:31 UTC by Dafna Ron
Modified: 2016-02-10 19:35 UTC (History)
11 users (show)

Fixed In Version: sf5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
dbdump (12.74 MB, application/octet-stream)
2012-12-31 15:31 UTC, Dafna Ron
no flags Details
screen shot (68.36 KB, image/jpeg)
2012-12-31 15:33 UTC, Dafna Ron
no flags Details
unlock -l (894 bytes, application/octet-stream)
2012-12-31 15:41 UTC, Dafna Ron
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 11251 0 None None None Never

Description Dafna Ron 2012-12-31 15:31:19 UTC
Created attachment 670817 [details]
dbdump

Description of problem:

I am trying to unlock a template which UI is showing as locked (see screen shot). 
running a query using unlock_entity.sh is howing no results: 

[root@rhevm-3 dbscripts]# ./unlock_entity.sh -t template -q -s localhost -p 5432 -d engine -u postgres
 template_name 
---------------
(0 rows)

 template_name | disk_id 
---------------+---------
(0 rows)

[root@rhevm-3 dbscripts]# 


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

si25.2

How reproducible:

100% 

Steps to Reproduce:
1. lock a template
2. /unlock_entity.sh -t template -q -s localhost -p 5432 -d engine -u postgres
3.
  
Actual results:

query is not finding the locked template

Expected results:

we should find the locked template

Additional info: dbdump

Comment 1 Dafna Ron 2012-12-31 15:33:20 UTC
Created attachment 670818 [details]
screen shot

Comment 2 Dafna Ron 2012-12-31 15:41:05 UTC
Created attachment 670833 [details]
unlock -l

Comment 3 Dafna Ron 2012-12-31 15:45:51 UTC
I managed to unlock the template using the template name from UI: 
[root@rhevm-3 dbscripts]# ./unlock_entity.sh -t template -i Clean_RHEL6.3_Openstack -l /tmp/unlock_entity.sh.log  -s localhost -p 5432 -d engine -u postgres
Caution, this operation may lead to data corruption and should be used with care. Please contact support prior to running this command
Are you sure you want to proceed? [y/n]
y
select fn_db_unlock_entity('template', 'Clean_RHEL6.3_Openstack', false);
 

INSERT 566028575 1
unlock template Clean_RHEL6.3_Openstack completed successfully.[root@rhevm-3 dbscripts]#

Comment 4 Dafna Ron 2012-12-31 15:47:09 UTC
here is the output from the log: 

********* QUERY **********
select fn_db_unlock_disk('e2a78678-ef6d-4786-9f12-4d4d09c3c657');
**************************

 

********* QUERY **********
insert into audit_log(log_time,log_type_name,log_type,severity,message)
        values(now(), 'USER_RUN_UNLOCK_ENTITY_SCRIPT', 2024, 10, 'System user root run unlock_entity script on disk e2a78678-ef6d-4786-9f12-4d4d09c3c657 with db user postgres')
**************************

INSERT 546444066 1
********* QUERY **********
select fn_db_unlock_disk('fb07a54b-e53f-4413-9190-ba6787edbd0e');
**************************

 

********* QUERY **********
insert into audit_log(log_time,log_type_name,log_type,severity,message)
        values(now(), 'USER_RUN_UNLOCK_ENTITY_SCRIPT', 2024, 10, 'System user root run unlock_entity script on disk fb07a54b-e53f-4413-9190-ba6787edbd0e with db user postgres')
**************************

INSERT 559345627 1
(END)

Comment 5 Eli Mesika 2013-01-21 11:24:17 UTC
http://gerrit.ovirt.org/#/c/11251/

Comment 8 Eli Mesika 2013-01-24 17:36:57 UTC
fixed in commit: 76dcd32

Comment 11 Itamar Heim 2013-06-11 09:05:03 UTC
3.2 has been released

Comment 12 Itamar Heim 2013-06-11 09:05:03 UTC
3.2 has been released

Comment 13 Itamar Heim 2013-06-11 09:05:14 UTC
3.2 has been released

Comment 14 Itamar Heim 2013-06-11 09:05:17 UTC
3.2 has been released

Comment 15 Itamar Heim 2013-06-11 09:34:12 UTC
3.2 has been released


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