Bug 1382382 - Primary leg failure on mirror target results in read errors
Summary: Primary leg failure on mirror target results in read errors
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: LVM and device-mapper
Classification: Community
Component: device-mapper
Version: 2.02.165
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Heinz Mauelshagen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1382516 1382517 1383444
TreeView+ depends on / blocked
 
Reported: 2016-10-06 14:17 UTC by Zdenek Kabelac
Modified: 2018-09-18 20:06 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1382516 1382517 (view as bug list)
Environment:
Last Closed: 2018-09-18 20:06:35 UTC
Embargoed:
rule-engine: lvm-technical-solution?


Attachments (Terms of Use)
lvm2 test suite showing how to hit the issue (1.07 KB, text/plain)
2017-06-16 19:52 UTC, Zdenek Kabelac
no flags Details

Description Zdenek Kabelac 2016-10-06 14:17:03 UTC
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:

Comment 1 Jonathan Earl Brassow 2016-10-06 20:59:26 UTC
(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.

Comment 2 Jonathan Earl Brassow 2017-06-15 05:18:01 UTC
closing this issue NOTABUG.

See https://bugzilla.redhat.com/show_bug.cgi?id=1436374#c12

Comment 3 Heinz Mauelshagen 2017-06-16 12:48:15 UTC
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!

Comment 4 Zdenek Kabelac 2017-06-16 19:52:00 UTC
Created attachment 1288455 [details]
lvm2 test suite showing how to hit the issue

Comment 6 Heinz Mauelshagen 2018-09-18 20:06:35 UTC
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)


Note You need to log in before you can comment on or make changes to this bug.