Description of problem: With i.e. 2-leg mirror - fail of 'primary' leg has problem when write to such mirror is not sector aligned. i.e. lvcreate -LX -m1 --type mirror -n mir vg /dev/PV1 /dev/PV2 fail PV1 echo C >/dev/vg/mir gives: raid1: Mirror read failed from 253:5. Trying alternative device raid1: Mirror read failed. Mirror puts primary leg in 'R' state - and such state is not repaired by dmeventd. Next write transition mirror in 'D' states and repair operation is started by dmeventd. Version-Release number of selected component (if applicable): kernel 4.8 How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
(In reply to Zdenek Kabelac from comment #0) > Description of problem: > > With i.e. 2-leg mirror - fail of 'primary' leg has problem when > write to such mirror is not sector aligned. > I think what is meant is not "sector aligned", but "full sector". The real problem here has nothing to do with writes, but rather a read (which a partial write will trigger). Issue a read from a mirror with a failed primary leg, and it will fail - even though the secondary leg should be available for a retry. This error only occurs when it is the primary device that is failed.
closing this issue NOTABUG. See https://bugzilla.redhat.com/show_bug.cgi?id=1436374#c12
Reverting upstream commit 12a7cf5 (rhel7 commit 646f3cc) ASAP as of Jon's conclusion in bz1436374 reintreduces this bug. Simply reverting it aiming to fix bz1436374 isn't correct. An enhanced fix addressing both bugs is necessary!
Created attachment 1288455 [details] lvm2 test suite showing how to hit the issue
Tested ok on kernel 4.17.6-100.fc27.x86_64 and 4.19-rc2 with LVM version: 2.02.175(2) (2017-10-06) Library version: 1.02.147-git (2018-05-24) Driver version: 4.39.0 thus closing upstream. # lvcreate -L128 --ty mirror -nm nvm # lvs -aoname,size,attr,segtype,datastripes,copypercent,devices nvm LV LSize Attr Type #DStr Cpy%Sync Devices m 128.00m mwi-a-m--- mirror 2 100.00 m_mimage_0(0),m_mimage_1(0) [m_mimage_0] 128.00m iwi-aom--- linear 1 /dev/sdab(0) [m_mimage_1] 128.00m iwi-aom--- linear 1 /dev/sdac(0) [m_mlog] 4.00m lwi-aom--- linear 1 /dev/sdaa(0) Reload nvm-m_mimage_0 with first sector error mapped # echo -e "0 1 error\n`dmsetup table nvm-m_mimage_0|sed 's/^0/1/;s/2048 /2047/'`"|dmsetup load nvm-m_mimage_0 # dmsetup resume nvm-m_mimage_0 # echo C > /dev/nvm/m # lvs -aoname,size,attr,segtype,datastripes,copypercent,devices nvm Couldn't find device with uuid IVe2qP-KkqQ-DbkO-5tKn-UdEd-7HXj-KULiFV. LV LSize Attr Type #DStr Cpy%Sync Devices m 128.00m mwi-a-m--- mirror 2 100.00 m_mimage_0(0),m_mimage_1(0) [m_mimage_0] 128.00m iwi-aom--- linear 1 /dev/sdac(0) [m_mimage_1] 128.00m iwi-aom--- linear 1 /dev/sdad(0) [m_mlog] 4.00m lwi-aom--- linear 1 /dev/sdaa(0)