Bug 1227046

Summary: lvchange fails to activate thin snap when run quickly after creation
Product: Red Hat Enterprise Linux 7 Reporter: Fabian Deutsch <fdeutsch>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Thin Provisioning QA Contact: cluster-qe <cluster-qe>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, bmarzins, bmr, dwysocha, heinzm, jbrassow, jonathan, lvm-team, mcsontos, msnitzer, prajnoha, prockai, thornber, zkabelac
Version: 7.0   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.130-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 12:22:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1189117    
Attachments:
Description Flags
Experimental patch none

Description Fabian Deutsch 2015-06-01 19:38:50 UTC
Description of problem:
Activating thinp snapshots fails.

Version-Release number of selected component (if applicable):
Fedora 22 (all updates)

How reproducible:
always

Steps to Reproduce:
1. Install F22 with thinp layout
1.a reboot
1.b login
2. in the same pool:

lvcreate --thin --virtualsize 2629415424B --name Image-1.0 fedora/pool00

lvchange --activate y fedora/Image-1.0 --ignoreactivationskip
lvchange --activate n fedora/Image-1.0
# ^^ If you skip the two lines above, then the bug is not triggered

lvcreate --snapshot --name fedora/Image-1.1 fedora/Image-1.0
lvchange --activate y fedora/Image-1.1 --ignoreactivationskip
# ^^ Fails

Actual results:
# lvchange --activate y fedora/Image-1.1 --ignoreactivationskip
  device-mapper: reload ioctl on  failed: No data available
#

Expected results:
# lvchange --activate y fedora/Image-1.1 --ignoreactivationskip
#

Additional info:
Workaround is to enable the parent before:
# lvchange --activate y fedora/Image-1.0 --ignoreactivationskip
# lvchange --activate y fedora/Image-1.1 --ignoreactivationskip
# 

-vvvv output:
https://paste.fedoraproject.org/227816/33185971/

Comment 1 Fabian Deutsch 2015-06-02 06:32:05 UTC
This is also reproducible on RHEL 7.

Comment 3 Zdenek Kabelac 2015-06-10 14:31:47 UTC
Created attachment 1037334 [details]
Experimental patch

Adding initial version of patch to fight with ordering of messaging to thin-pool.

It has in fact appeared to be a more complex problem how to deal with error states.

Current proposal moves message sending from 'resume' phase to 'suspend' phase.
Resume always resume thin-pool 'as-is' and only validates transaction_id.

The patch itself does not yet improve of error paths and possible automatic fixing of 'easy-to-fix issues' - will follow later possibly, but with this switched order it will get fairly easier since it will not leave thin-pool suspend when we detect some error in the middle of message creation.

Comment 4 Zdenek Kabelac 2015-07-08 15:12:08 UTC
Updated patch is now upstream  (lvm 2.02.124)

https://www.redhat.com/archives/lvm-devel/2015-July/msg00015.html

But it still left couple issue for resolving.
Complexity with some pool online renaming for external users got a bit more complicated so still some further patches are needed and are under development and testing.

Comment 5 Zdenek Kabelac 2015-12-07 11:51:13 UTC
Fixed upstream for a while.
Surely a member of 2.02.130.