From: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
To: lvm-devel@redhat.com
Subject: [LVM2 PATCH] (0/5) Fix mirror log allocation
Date: Mon, 08 Jan 2007 12:09:53 -0500 [thread overview]
Message-ID: <45A27AE1.7030508@ce.jp.nec.com> (raw)
Hi Alasdair, Jonathan,
This series of patches fix the following mirror log allocation
problem:
1. lvconvert from linear to mirror can allocate log device
from the same PV as mirror images
2. lvconvert from corelog to disklog can allocate log device
from the same PV as mirror images
3. "--alloc anywhere" doesn't help mirror log allocation
when the number of available PVs are equal to the number of
mirror images, though lvcreate/lvconvert suggest to try it.
Patches are applicable to and tested on LVM2 2.02.17.
Please consider to apply.
The first 2 problems happen because of the wrong application
of parallel area constraint. The constraint should be:
- mirror image should avoid PVs used by the parallel areas of
the matching range of LE
- mirror log should avoid PVs used by the parallel areas of
the whole range of the LV
However, current code applies the first constraint for both
mirror log and mirror images.
So the log allocation avoids only the areas parallel to LE:0:1.
To apply the different constraints effectively, this patch set
makes the allocation done in 2 steps.
1. do log allocation
2. do mirror image allocation
As a result of this, the 3rd problem is fixed as well.
The patches are:
1. Rearrange _alloc_parallel_areas() and moves out log allocation
part as a separate function.
2. Fix handling of log-only allocation failure.
3. Changes _find_parallel_space() to do log allocation first.
4. Removing unnecessary prev_lvseg checks.
5. Removing ix_offset variable.
3 is the core part of this fix.
1 and 2 are preparation for it.
4 and 5 are cleaning up of the related codes.
Reproducible test scripts and corresponding metadatas are attached.
The test scripts automatically set up loop-back device and test
PVs and VG on it. You might want to change vgname defined in
the top of the script.
Then, you can just run it as:
# sh testcase-lvconvert-linear-mirror-multiseg.sh
...
LV Devices SSize
lv0 lv0_mimage_0(0),lv0_mimage_1(0) 196.00M
[lv0_mimage_0] /dev/mapper/d1(24) 100.00M
[lv0_mimage_0] /dev/mapper/d2(24) 96.00M
[lv0_mimage_1] /dev/mapper/d3(0) 100.00M
[lv0_mimage_1] /dev/mapper/d4(0) 96.00M
[lv0_mlog] /dev/mapper/d2(0) 4.00M
...
ERROR: /dev/mapper/d2 is used in both testvg/lv0_mlog and testvg/lv0_mimage_0
ERROR: /dev/mapper/d2 is used in both testvg/lv0_mimage_0 and testvg/lv0_mlog
Number of failures: 2
FAIL
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testcase-lvconvert-addlog-multiseg.sh
Type: application/x-sh
Size: 2746 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20070108/8e2a98e9/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testcase-lvconvert-linear-mirror-multiseg.sh
Type: application/x-sh
Size: 3061 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20070108/8e2a98e9/attachment-0001.sh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: testcase-lvconvert-addlog-multiseg.vg
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20070108/8e2a98e9/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: testcase-lvconvert-linear-mirror-multiseg.vg
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20070108/8e2a98e9/attachment-0001.ksh>
reply other threads:[~2007-01-08 17:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45A27AE1.7030508@ce.jp.nec.com \
--to=j-nomura@ce.jp.nec.com \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.