Bug 890995

Summary: engine: unlock_entity.sh is not finding a locked template
Product: Red Hat Enterprise Virtualization Manager Reporter: Dafna Ron <dron>
Component: ovirt-engineAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Stehlik <pstehlik>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.1CC: abaron, dyasny, emesika, iheim, lpeer, pstehlik, Rhev-m-bugs, sgrinber, yeylon, ykaul, yzaslavs
Target Milestone: ---   
Target Release: 3.2.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: infra
Fixed In Version: sf5 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:
Attachments:
Description Flags
dbdump
none
screen shot
none
unlock -l none

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