Bug 1414067

Summary: Pivot is not initiated by vdsm after a successful block commit during live merge
Product: Red Hat Enterprise Virtualization Manager Reporter: nijin ashok <nashok>
Component: vdsmAssignee: Ala Hino <ahino>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Raz Tamir <ratamir>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 3.6.9CC: achareka, ahino, alitke, bazulay, bcholler, danken, gklein, gveitmic, gwatson, lsurette, mkalinin, mtessun, shipatil, srevivo, tnisan, ycui, ykaul, ylavi
Target Milestone: ovirt-3.6.11Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-06 20:51:22 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: 1418280    
Bug Blocks:    

Description nijin ashok 2017-01-17 16:24:39 UTC
Description of problem:

In some  cases, the pivot is not initiated by the vdsm even when the block commit is 100%. 

virsh -r blockjob --info <vm-name> vdc shows  "Active Block Commit: [100 %]" . 

In the  "vdsClient -s 0 getVmStats" , it's showing wrong "cur" value even when the libvirt show block commit as 100%.

vmJobs = {'be3d91ee-a906-4ef3-b5f8-955f5c04dc08': {'end': '143720448', 'cur': '31588352', 'imgUUID': '9c3205b6-13ba-4580-b9ec-8b1a8fa15a67', 'blockJobType': 'commit', 'bandwidth': 0, 'id': 'be3d91ee-a906-4ef3-b5f8-955f5c04dc08', 'jobType': 'block'}

IIUC, vdsm uses blockJobInfo to get the current progress of block commit. 

===
liveInfo = self._dom.blockJobInfo(drive.name, 0)
----                
----
doPivot = self._activeLayerCommitReady(liveInfo)
-----
def _activeLayerCommitReady(self, jobInfo):
-----
  if (jobInfo['cur'] == jobInfo['end'] and jobInfo['type'] == pivot):
    return True
  return False
===

I think somehow the vdsm lose the track of block commit job and is reporting  incorrect values and hence pivot is never initiated.  

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

vdsm-4.17.33-1.el7ev.noarch
rhevm-3.6.9.2-0.1.el6.noarch

How reproducible:

Unknown

Steps to Reproduce:

Issue was observed in customer environment when deleting a snapshot from RHEV-M which contains 4 disks.

Actual results:

Pivot is never initiated by the vdsm even when the block copy is 100%

Expected results:

Deleting snapshot should work

Additional info: