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

Bug 1538472

Summary: After cold merge in version earlier than 4.1, cold merge will fail in versions greater or equal 4.1
Product: [oVirt] vdsm Reporter: Ala Hino <ahino>
Component: CoreAssignee: Ala Hino <ahino>
Status: CLOSED UPSTREAM QA Contact: Kevin Alon Goldblatt <kgoldbla>
Severity: high Docs Contact:
Priority: high    
Version: 4.20.0CC: bugs, ebenahar, gveitmic, gwatson, nsoffer, ylavi
Target Milestone: ovirt-4.2.2Keywords: ZStream
Target Release: ---Flags: rule-engine: ovirt-4.2?
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1544553 (view as bug list) Environment:
Last Closed: 2018-03-22 15:50: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:    
Bug Blocks: 1544376, 1544553    

Description Ala Hino 2018-01-25 07:28:25 UTC
Description of problem:
After renaming a volume we must reinitialize the volume lease, since
sanlock does not allow querying or acquiring a lease without the correct
lease name.

Steps to Reproduce:
1. create a 4.0 dc
2. create a vm with a single disk
3. create two snapshots: s1 and s2
4. cold merge s1
5. upgrade the dc to 4.1
6. cold merge s2

Actual results:
Following error is raised and the merge fails:

2018-01-21 15:23:48,241+0200 ERROR (tasks/3) [storage.TaskManager.Task] (Task='d1823d98-2e55-4a70-82f6-26532a76ee57') Unexpected error (task:875)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/storage/task.py", line 882, in _run
    return fn(*args, **kargs)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/task.py", line 336, in run
    return self.cmd(*self.argslist, **self.argsdict)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/securable.py", line 79, in wrapper
    return method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/sp.py", line 1862, in prepareMerge
    merge.prepare(subchainInfo)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/merge.py", line 178, in prepare
    with guarded.context(subchain.locks):
  File "/usr/lib/python2.7/site-packages/vdsm/storage/guarded.py", line 102, in __enter__
    six.reraise(*exc)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/guarded.py", line 93, in __enter__
    lock.acquire()
  File "/usr/lib/python2.7/site-packages/vdsm/storage/volume.py", line 1516, in acquire
    dom.acquireVolumeLease(self._host_id, self._img_id, self._vol_id)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/sd.py", line 475, in acquireVolumeLease
    self._domainLock.acquire(hostId, lease)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/clusterlock.py", line 409, in acquire
    "Cannot acquire %s" % (lease,), str(e))
AcquireLockFailure: Cannot obtain lock: u"id=aafed42c-8cc1-4710-ac79-0e9c55420675, rc=-227, out=Cannot acquire Lease(name='fe81c224-210e-4735-b4b6-ffe890581b01', path=u'/rhev/data-center/mnt/rich-nfs-server2.usersys.redhat.com:_home_storage_sd1/aafed42c-8cc1-4710-ac79-0e9c55420675/images/ae9ed879-ae1b-47e4-bcd1-8551972761c4/fe81c224-210e-4735-b4b6-ffe890581b01.lease', offset=0), err=(-227, 'Sanlock resource not acquired', 'Lease resource name is incorrect')"


Expected results:
Cold merge to pass.

Comment 1 Red Hat Bugzilla Rules Engine 2018-01-25 07:29:08 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 3 Kevin Alon Goldblatt 2018-03-11 11:16:02 UTC
Verified with the following code:
--------------------------------------
ovirt-engine-4.1.10.1-0.1.el7.noarch
vdsm-4.19.48-1.el7ev.x86_64

Verified with the following scenario:
-------------------------------------
Steps to Reproduce:
1. create a 4.0 dc
2. create a vm with a single disk
3. create two snapshots: s1 and s2
4. cold merge s1
5. upgrade the dc to 4.1
6. cold merge s2 - works fine

Moving to VERIFIED!