Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1836627

Summary: Move disk operation release the lock for the disks before the operation ends
Product: [oVirt] ovirt-engine Reporter: Eyal Shenitzky <eshenitz>
Component: BLL.StorageAssignee: Benny Zlotnik <bzlotnik>
Status: CLOSED NOTABUG QA Contact: Avihai <aefrat>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.4.0CC: bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-18 10:41:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1826348    
Attachments:
Description Flags
engine log none

Description Eyal Shenitzky 2020-05-17 13:43:02 UTC
Created attachment 1689372 [details]
engine log

Description of problem:

Live / cold storage migration operation need to lock the disk to prevent from other operation to start when the disk is migrating.

Currently, the lock on the disk is released at the end of the execution phase of MoveDisk command which means that operation on the disk is allowed when the disk is still migrating - 

2020-05-17 16:20:45,604+03 INFO  [org.ovirt.engine.core.bll.storage.disk.MoveDiskCommand] (default task-2) [a5628544-4e83-4936-888e-7d787d72d1db] Lock Acquired to object 'EngineLock:{exclusiveLocks='[9b0ac522-92ce-44bd-bda2-dd8d89058719=DISK]', sharedLocks=''}'


2020-05-17 16:22:39,903+03 INFO  [org.ovirt.engine.core.bll.storage.disk.MoveDiskCommand] (default task-2) [a5628544-4e83-4936-888e-7d787d72d1db] Lock freed to object 'EngineLock:{exclusiveLocks='[9b0ac522-92ce-44bd-bda2-dd8d89058719=DISK]', sharedLocks=''}'
 

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

How reproducible:
100%


Steps to Reproduce:
1. Create a VM with disk
2. Move the disk (when the VM is up or down)


Actual results:
Disk lock released before the operation ends

Expected results:
Disk should be locked until the end of the operation

Additional info:

Comment 1 Benny Zlotnik 2020-05-18 10:41:49 UTC
This is intentional as once the DB lock is taken, we no longer need the memory lock to be held, and since runInternalAction is synchronous the lock will be released only after the child command finished its "executeCommand"