* [PATCH mirror 0/13] Add/collapse temporary mirror
@ 2007-11-22 1:45 Jun'ichi Nomura
2007-11-22 2:01 ` Alasdair G Kergon
` (13 more replies)
0 siblings, 14 replies; 15+ messages in thread
From: Jun'ichi Nomura @ 2007-11-22 1:45 UTC (permalink / raw)
To: lvm-devel
This set of patches allows mirror addition to mirrored LV.
[ 1/13] Enable mirror-addition to lvconvert
[ 2/13] Move idiomatic vg write/lv suspend/vg commit/lv resume
to a function
[ 3/13] Move idiomatic add-lv-to-list operation to a function
[ 4/13] Add 'const' for some mirror related functions
[ 5/13] Add collapsing feature of stacked mirror
[ 6/13] Count the correct number of mirror images
[ 7/13] Fix lvconvert to use collapsing and mirror counting
[ 8/13] Allow removal of mirror images from not-collapsed mirror LV
[ 9/13] Add 'lv_mirrors' field to report commands
[10/13] Generalize "mlog" handling of dtree
[11/13] Allow multiple mirror logs in the mirror LV tree
[12/13] Allow renaming of mirrored LV with temporary layer
[13/13] Allow resizing of mirrored LV with temporary layer
Comments are welcome.
Especially, patches 1, 5, 8 and 10 are important and reviews
are appreciated.
Patches 2, 3 and 4 are cosmetic.
Patches 6, 9, 11, 12 and 13 are trivial.
Also, I'm using "lv_mimage_<n>" name for temporary layers
because I vaguely remember that naming suffixes like "_mimage_<n>"
are important for clusters.
I would like to use other names for temporary layer,
for example "lv_mtmp_<n>". Is it ok?
Overview of the patches
--------------------------
Current LVM2 mirror doesn't allow mirror addition to already
mirrored LV.
It's not possible to simply add mirror image to the existing LV
because it will result in full resync even if existing images are
already in sync.
With this patchset, a temporary mirror layer is inserted.
For example, if we have the mirrored LV below:
testvg-lvol0
|-testvg-lvol0_mimage_1
|-testvg-lvol0_mimage_0
`-testvg-lvol0_mlog
'lvconvert -m+1' will result in this:
testvg-lvol0
|-testvg-lvol0_mimage_3
|-testvg-lvol0_mimage_2
| |-testvg-lvol0_mimage_1
| |-testvg-lvol0_mimage_0
| `-testvg-lvol0_mlog
`-testvg-lvol0_mlog_0
"mimage_2" is a temporary layer to resync "mimage_3".
'lvs -o mirrors testvg/lvol0' will show "3" as a number of mirror images.
After the resync completes, 'lvconvert --collapse testvg/lvol0' will
change the LV to this form:
testvg-lvol0
|-testvg-lvol0_mimage_3
|-testvg-lvol0_mimage_1
|-testvg-lvol0_mimage_0
`-testvg-lvol0_mlog
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH mirror 0/13] Add/collapse temporary mirror
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
@ 2007-11-22 2:01 ` Alasdair G Kergon
2007-11-22 2:08 ` [PATCH mirror 1/13] Enable mirror-addition to lvconvert Jun'ichi Nomura
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Alasdair G Kergon @ 2007-11-22 2:01 UTC (permalink / raw)
To: lvm-devel
On Wed, Nov 21, 2007 at 08:45:24PM -0500, Jun'ichi Nomura wrote:
> because I vaguely remember that naming suffixes like "_mimage_<n>"
dm_snprintf(img_name, len, "%s_mimage_%%d", lv->name)
Gah - how did that underscore sneak in front of the name:-(
Oh well, we're stuck with it for now.
Reserved names are controlled by:
apply_lvname_restrictions()
and should be consistent: all 'mimage' LVs should be structured
the same way. If not, it may require a different name.
Alasdair
--
agk at redhat.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH mirror 1/13] Enable mirror-addition to lvconvert
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
2007-11-22 2:01 ` Alasdair G Kergon
@ 2007-11-22 2:08 ` Jun'ichi Nomura
2007-11-22 2:08 ` [PATCH mirror 2/13] Add _apply_lv_change() to lib/metadata/mirror.c Jun'ichi Nomura
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Jun'ichi Nomura @ 2007-11-22 2:08 UTC (permalink / raw)
To: lvm-devel
This patch allows lvconvert to add mirror to mirrored LV.
If mirrors are added to mirrored LV, a temporary layer will
be inserted for resync new mirrors.
The temporary LV is under the same naming rule with mirror images.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-stacked-mirror-add-mirror.patch
Type: text/x-patch
Size: 4023 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071121/4a7f1e47/attachment.bin>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH mirror 2/13] Add _apply_lv_change() to lib/metadata/mirror.c
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
2007-11-22 2:01 ` Alasdair G Kergon
2007-11-22 2:08 ` [PATCH mirror 1/13] Enable mirror-addition to lvconvert Jun'ichi Nomura
@ 2007-11-22 2:08 ` Jun'ichi Nomura
2007-11-22 2:08 ` [PATCH mirror 3/13] Add _lv_add_list() " Jun'ichi Nomura
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Jun'ichi Nomura @ 2007-11-22 2:08 UTC (permalink / raw)
To: lvm-devel
This is a cosmetic change of moving idiomatic operations of
vg write/lv suspend/vg commit/lv resume to a new function.
No functional change.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-mirror-apply_lv_change.patch
Type: text/x-patch
Size: 2429 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071121/0c6c55ad/attachment.bin>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH mirror 3/13] Add _lv_add_list() to lib/metadata/mirror.c
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
` (2 preceding siblings ...)
2007-11-22 2:08 ` [PATCH mirror 2/13] Add _apply_lv_change() to lib/metadata/mirror.c Jun'ichi Nomura
@ 2007-11-22 2:08 ` Jun'ichi Nomura
2007-11-22 2:08 ` [PATCH mirror 4/13] Add 'const' for some mirror related functions Jun'ichi Nomura
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Jun'ichi Nomura @ 2007-11-22 2:08 UTC (permalink / raw)
To: lvm-devel
This is a cosmetic change of adding _lv_add_list()
and removing duplications.
No functional change.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-mirror-lv_add_list.patch
Type: text/x-patch
Size: 1965 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071121/474e85f8/attachment.bin>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH mirror 4/13] Add 'const' for some mirror related functions
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
` (3 preceding siblings ...)
2007-11-22 2:08 ` [PATCH mirror 3/13] Add _lv_add_list() " Jun'ichi Nomura
@ 2007-11-22 2:08 ` Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 5/13] Add collapsing feature of stacked mirror Jun'ichi Nomura
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Jun'ichi Nomura @ 2007-11-22 2:08 UTC (permalink / raw)
To: lvm-devel
This patch adds 'const' to some functions used in mirroring code.
No functional change.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: const-mirror.patch
Type: text/x-patch
Size: 2307 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071121/53c74695/attachment.bin>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH mirror 5/13] Add collapsing feature of stacked mirror
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
` (4 preceding siblings ...)
2007-11-22 2:08 ` [PATCH mirror 4/13] Add 'const' for some mirror related functions Jun'ichi Nomura
@ 2007-11-22 2:09 ` Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 6/13] Count the correct number of mirror images Jun'ichi Nomura
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Jun'ichi Nomura @ 2007-11-22 2:09 UTC (permalink / raw)
To: lvm-devel
This patch adds collapse_mirrored_lv() function.
When the function finds a temporary mirror layer in which the resync
completed, it removes the layer and moves in-sync mirror images to
the original mirror.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-stacked-mirror-collapse-layers.patch
Type: text/x-patch
Size: 5894 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071121/87d4394f/attachment.bin>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH mirror 6/13] Count the correct number of mirror images
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
` (5 preceding siblings ...)
2007-11-22 2:09 ` [PATCH mirror 5/13] Add collapsing feature of stacked mirror Jun'ichi Nomura
@ 2007-11-22 2:09 ` Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 7/13] Fix lvconvert to use collapsing and mirror counting Jun'ichi Nomura
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Jun'ichi Nomura @ 2007-11-22 2:09 UTC (permalink / raw)
To: lvm-devel
If temporary mirror layers are inserted, you can't get
the number of mirror images by seg->area_count.
The patch adds a function to recursively sum up the number
of mirror images.
Used later by lvconvert and reporting functions.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-stacked-mirror-count-legs.patch
Type: text/x-patch
Size: 1561 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071121/539d1cd3/attachment.bin>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH mirror 7/13] Fix lvconvert to use collapsing and mirror counting
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
` (6 preceding siblings ...)
2007-11-22 2:09 ` [PATCH mirror 6/13] Count the correct number of mirror images Jun'ichi Nomura
@ 2007-11-22 2:09 ` Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 8/13] Allow removal of mirror images from not-collapsed mirror LV Jun'ichi Nomura
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Jun'ichi Nomura @ 2007-11-22 2:09 UTC (permalink / raw)
To: lvm-devel
This patch changes 2 things in lvconvert:
1) Add '--collapse' option as an interface for users to
remove unnecessary mirror layer and collapse the stack.
2) Use the new lv_mirror_count() to get correct existing_mirrors .
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-stacked-mirror-lvconvert.patch
Type: text/x-patch
Size: 3384 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071121/913d4b73/attachment.bin>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH mirror 8/13] Allow removal of mirror images from not-collapsed mirror LV
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
` (7 preceding siblings ...)
2007-11-22 2:09 ` [PATCH mirror 7/13] Fix lvconvert to use collapsing and mirror counting Jun'ichi Nomura
@ 2007-11-22 2:09 ` Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 9/13] Add 'lv_mirrors' field to report commands Jun'ichi Nomura
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Jun'ichi Nomura @ 2007-11-22 2:09 UTC (permalink / raw)
To: lvm-devel
remove_mirror_images() is existing function to remove mirror images
from mirrored LV.
This patch changes the function to walk through the mirror layers
to correctly remove mirror images.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-stacked-mirror-remove-legs.patch
Type: text/x-patch
Size: 3730 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071121/b4ee06af/attachment.bin>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH mirror 9/13] Add 'lv_mirrors' field to report commands
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
` (8 preceding siblings ...)
2007-11-22 2:09 ` [PATCH mirror 8/13] Allow removal of mirror images from not-collapsed mirror LV Jun'ichi Nomura
@ 2007-11-22 2:09 ` Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 10/13] Generalize "mlog" handling of dtree Jun'ichi Nomura
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Jun'ichi Nomura @ 2007-11-22 2:09 UTC (permalink / raw)
To: lvm-devel
This patch adds 'lv_mirrors' field to report commands
to get the correct number of mirror images using lv_mirror_count().
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-stacked-mirror-report.patch
Type: text/x-patch
Size: 2769 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071121/0637ac01/attachment.bin>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH mirror 10/13] Generalize "mlog" handling of dtree
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
` (9 preceding siblings ...)
2007-11-22 2:09 ` [PATCH mirror 9/13] Add 'lv_mirrors' field to report commands Jun'ichi Nomura
@ 2007-11-22 2:09 ` Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 11/13] Allow multiple mirror logs in the mirror LV tree Jun'ichi Nomura
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Jun'ichi Nomura @ 2007-11-22 2:09 UTC (permalink / raw)
To: lvm-devel
Currently, "_mlog" is handled specially in dtree.
It puts a restriction to log LV naming and actually,
current code can't allow multiple mirror logs in a LV.
This is a problem if we allow to add temporary mirror logs
for resynching newly added mirrors.
The patch changes the addition of mirror log to dtree:
BEFORE: Adds a device with lv->name + "_mlog"
AFTER: Adds seg->log_lv
If there is a case where log LV is not set in seg->log_lv
but should be treated as a part of dtree, this change breaks the case.
I would like to know if there's such a case.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-deptree-generalize-mlog.patch
Type: text/x-patch
Size: 974 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071121/e961fddc/attachment.bin>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH mirror 11/13] Allow multiple mirror logs in the mirror LV tree
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
` (10 preceding siblings ...)
2007-11-22 2:09 ` [PATCH mirror 10/13] Generalize "mlog" handling of dtree Jun'ichi Nomura
@ 2007-11-22 2:09 ` Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 12/13] Allow renaming of mirrored LV with temporary layer Jun'ichi Nomura
2007-11-22 2:10 ` [PATCH mirror 13/13] Allow resizing " Jun'ichi Nomura
13 siblings, 0 replies; 15+ messages in thread
From: Jun'ichi Nomura @ 2007-11-22 2:09 UTC (permalink / raw)
To: lvm-devel
With the "10/13" patch, mirror LV can have multiple logs in
its layers.
This patch enables the namings of "lv_mlog_<n>" and
removes a code to force corelog from lvconvert.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-stacked-mirror-multi-mlogs.patch
Type: text/x-patch
Size: 1008 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071121/f6e3d066/attachment.bin>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH mirror 12/13] Allow renaming of mirrored LV with temporary layer
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
` (11 preceding siblings ...)
2007-11-22 2:09 ` [PATCH mirror 11/13] Allow multiple mirror logs in the mirror LV tree Jun'ichi Nomura
@ 2007-11-22 2:09 ` Jun'ichi Nomura
2007-11-22 2:10 ` [PATCH mirror 13/13] Allow resizing " Jun'ichi Nomura
13 siblings, 0 replies; 15+ messages in thread
From: Jun'ichi Nomura @ 2007-11-22 2:09 UTC (permalink / raw)
To: lvm-devel
_for_each_sub_lv() is a function used to execute same function
for each LVs used in a given LV's segments.
It's used for lv_rename() to implement mirrored LV renaming.
When we have temporary layers in mirrored LV, mirrored LV is
no longer flat. So _for_each_sub_lv() should work recursively.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-stacked-mirror-rename.patch
Type: text/x-patch
Size: 827 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071121/2ca25828/attachment.bin>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH mirror 13/13] Allow resizing of mirrored LV with temporary layer
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
` (12 preceding siblings ...)
2007-11-22 2:09 ` [PATCH mirror 12/13] Allow renaming of mirrored LV with temporary layer Jun'ichi Nomura
@ 2007-11-22 2:10 ` Jun'ichi Nomura
13 siblings, 0 replies; 15+ messages in thread
From: Jun'ichi Nomura @ 2007-11-22 2:10 UTC (permalink / raw)
To: lvm-devel
This patch changes 2 things related to resizing mirror.
1) Use lv_mirror_count() to calculate the number of existing mirrors
2) lv_extend() will walk down recursively mirrored LV
to add allocated extents for each mirror image.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-stacked-mirror-extend.patch
Type: text/x-patch
Size: 2828 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071121/2f681e1f/attachment.bin>
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2007-11-22 2:10 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-22 1:45 [PATCH mirror 0/13] Add/collapse temporary mirror Jun'ichi Nomura
2007-11-22 2:01 ` Alasdair G Kergon
2007-11-22 2:08 ` [PATCH mirror 1/13] Enable mirror-addition to lvconvert Jun'ichi Nomura
2007-11-22 2:08 ` [PATCH mirror 2/13] Add _apply_lv_change() to lib/metadata/mirror.c Jun'ichi Nomura
2007-11-22 2:08 ` [PATCH mirror 3/13] Add _lv_add_list() " Jun'ichi Nomura
2007-11-22 2:08 ` [PATCH mirror 4/13] Add 'const' for some mirror related functions Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 5/13] Add collapsing feature of stacked mirror Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 6/13] Count the correct number of mirror images Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 7/13] Fix lvconvert to use collapsing and mirror counting Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 8/13] Allow removal of mirror images from not-collapsed mirror LV Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 9/13] Add 'lv_mirrors' field to report commands Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 10/13] Generalize "mlog" handling of dtree Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 11/13] Allow multiple mirror logs in the mirror LV tree Jun'ichi Nomura
2007-11-22 2:09 ` [PATCH mirror 12/13] Allow renaming of mirrored LV with temporary layer Jun'ichi Nomura
2007-11-22 2:10 ` [PATCH mirror 13/13] Allow resizing " Jun'ichi Nomura
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.