Skip to contentSkip to conversation

mirror legs in the same PV with --alloc anywhere

BUG-REPORT Takahiro Yasui 5 participants 18 messages Apr 15, 2010 – May 6, 2010

lore
Share & tools
lore
#0 lore raw

Alasdair,

I tested the latest lvm2 and found that mirror legs were allocated in the same PV when "--alloc anywhere" was specified. This happens for mirrored log as well.

# /sbin/lvm.static version
  LVM version:     2.02.64(1)-cvs (2010-04-14)
  Library version: 1.02.47-cvs (2010-04-14)
  Driver version:  4.11.5
# pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/sdc   vg00 lvm2 a-   16.00G 16.00G
  /dev/sdd   vg00 lvm2 a-   16.00G 16.00G
# lvcreate -m1 -L12m -nlv00 --mirrorlog disk --alloc anywhere vg00
  Logical volume "lv00" created
# dmsetup ls --tree
vg00-lv00 (253:3)
 |-vg00-lv00_mimage_1 (253:2)
 |  `- (8:32)
 |-vg00-lv00_mimage_0 (253:1)
 |  `- (8:32)
 `-vg00-lv00_mlog (253:0)
    `- (8:48)

The workaround in this case is to create a mirror device with a core log, and then to convert it to a mirror with a disk log.

Is "--alloc anywhere" feature still under development? Or is this a new behavior?

Thanks,
Taka

#1 lore raw
Quoted 2 lines · Takahiro Yasui

I tested the latest lvm2 and found that mirror legs were allocated in the same PV when "--alloc anywhere" was specified.

That is correct - it is what 'anywhere' means - it is OK for the tools to take the space from 'anywhere'.
(We still have some problems because the code gets the space in two allocation requests instead of getting it all in one go, so the first of those requests has incomplete information.)

Are there any likely situations where a non-optimal layout is selected with --alloc normal? If so, can we identify them and find some strategy to handle it e.g. do we need to add another allocation policy to allow logs on the same PVs as mimages?

Alasdair

#2 lore raw
Quoted 6 lines · Alasdair G Kergon
Quoted 2 lines · Takahiro Yasui

I tested the latest lvm2 and found that mirror legs were allocated in the same PV when "--alloc anywhere" was specified.

That is correct - it is what 'anywhere' means - it is OK for the tools to take the space from 'anywhere'.

Understand. (I was a bit confused because the behavior of 'anywhere' got changed.)

As for a mirror volume with 'mirrored' log, it is simpler to prepare two physical disks and create a mirror volume with 'mirrored log' in two disks. In this case, I expect that each disk has one of mirror legs one of mirror logs. I was thinking that '--alloc anywhere' was used to build this kind of mirror volumes.

This is an example case.

# pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/sdc   vg00 lvm2 a-   16.00G 16.00G
  /dev/sdd   vg00 lvm2 a-   16.00G 16.00G
# lvcreate -m1 -L1g -nlv00 --mirrorlog mirrored --alloc anywhere vg00
  Logical volume "lv00" created
# dmsetup ls --tree
vg00-lv00 (253:5)
 |-vg00-lv00_mimage_1 (253:4)
 |  `- (8:32)
 |-vg00-lv00_mimage_0 (253:3)
 |  `- (8:32)
 `-vg00-lv00_mlog (253:2)
    |-vg00-lv00_mlog_mimage_1 (253:1)
    |  `- (8:32)
    `-vg00-lv00_mlog_mimage_0 (253:0)
       `- (8:48)

Now I undestand that '--alloc anywhere' is not designed for this purpose and we need to use the workaround I described in the previous mail as below.

Quoted 8 lines

The workaround in this case is to create a mirror device with a core log, and then to convert it to a mirror with a disk log.

Are there any likely situations where a non-optimal layout is selected with --alloc normal? If so, can we identify them and find some strategy to handle it e.g. do we need to add another allocation policy to allow logs on the same PVs as mimages?

I don't have an issue of '--alloc normal' so far.

Thanks,
Taka

#3 lore raw

Well current policies for -m1 with mirrored log:
4 areas required M1 & M2 (data); L1 & L2 (log)

contiguous - 4 PVs required
cling - same
normal - same
anywhere - no restriction - 1 PV may be enough.

Suggestion is another policy with requirements:

  1.  L* may share PVs with M*,
  2.  M1 and M2 not on same PV as each other,
  3.  L1 and L2 not on same PV as each other.

And to insert that policy between 'normal' and 'anywhere' in the sequence.

There is a stronger form of 1:
1s. L* must share PVs with M*
but I think we can manage without that for now because people can obtain the same result with this policy by listing only the PVs concerned on the command line. Or would it be better to implement 1s+2+3 as the first new policy?

Alasdair

#4 lore raw
Quoted 13 lines · Alasdair G Kergon

Well current policies for -m1 with mirrored log:
4 areas required M1 & M2 (data); L1 & L2 (log)

contiguous - 4 PVs required
cling - same
normal - same
anywhere - no restriction - 1 PV may be enough.

Suggestion is another policy with requirements:

  1.  L* may share PVs with M*,
  2.  M1 and M2 not on same PV as each other,
  3.  L1 and L2 not on same PV as each other.
Quoted 7 lines

And to insert that policy between 'normal' and 'anywhere' in the sequence.

There is a stronger form of 1:
1s. L* must share PVs with M*
but I think we can manage without that for now because people can obtain the same result with this policy by listing only the PVs concerned on the command line. Or would it be better to implement 1s+2+3 as the first new policy?

I don't think the requirement '1s' is necessary, but But I rather think that the policy 'normal' supports the following condition.

1. The number of PVs must be more than the number of mirror legs,
2. M1 and M2 not on same PV as each other,
3. L1 and L2 not on same PV as each other,
4. L* may share PVs with M* if the number of PVs are less than the total number of L* and M*.

I think that some users expect that the number of mirror legs are devices users should take care of but 'mirror log' is a logical device LVM2 take care of.

Thanks,
Taka

#5 lore raw
Quoted 8 lines · Takahiro Yasui

I don't think the requirement '1s' is necessary, but But I rather think that the policy 'normal' supports the following condition.

1. The number of PVs must be more than the number of mirror legs,
2. M1 and M2 not on same PV as each other,
3. L1 and L2 not on same PV as each other,
4. L* may share PVs with M* if the number of PVs are less than the total number of L* and M*.

I was thinking of changing it to default to the new policy, and renaming that to 'normal'. (So the old normal is the one that gets a new name.)

I'm not sure that it would be easy to implement 4 within the existing normal policy. In general, it's hard for a single policy to work towards (and choose between) conflicting goals. And 'number of PVs' is not easily defined. (We're covering cases like -m+3 as well, plus restrictions from available PVs supplied on the command line, plus restrictions from which PVs are already in use at different parts of the existing mirror legs.)

Alasdair

#6 lore raw
In reply to Takahiro Yasui
Quoted 11 lines · Takahiro Yasui [tyasui at redhat.com]
Quoted 1 line

Or would it be better to implement 1s+2+3 as the first new policy?

I don't think the requirement '1s' is necessary, but But I rather think that the policy 'normal' supports the following condition.

1. The number of PVs must be more than the number of mirror legs,
2. M1 and M2 not on same PV as each other,
3. L1 and L2 not on same PV as each other,
4. L* may share PVs with M* if the number of PVs are less than the total number of L* and M*.

Quoted 3 lines

I think that some users expect that the number of mirror legs are devices users should take care of but 'mirror log' is a logical device LVM2 take care of.

I am with Taka here. The normal policy should be the default and it should do the following for the mirroredlog without introducing a new policy.

Requirement: Number of allocatable PV's should be at least the number of
mirror legs
Allocation: Allocate images on different PVs. Allocate logs on remaining
PVs in a round robin fashion. If there are more PV's, we will not have to share L* and M* at all.

It would be different for disklog though:
Requirement: Number of allocatable PV's should be at least one more than
the number of mirror legs.
Allocation: Just use round-robin sequence

Thanks, Malahal.

#7 lore raw
Quoted 5 lines · malahal at us.ibm.com

Requirement: Number of allocatable PV's should be at least the number of
mirror legs
Allocation: Allocate images on different PVs. Allocate logs on remaining
PVs in a round robin fashion. If there are more PV's, we will not have to share L* and M* at all.

Actually the current code allocates the logs during the first pass, not the last, (otherwise it risks missing a 'maximal spread' layout). Only later might it discover there isn't enough space to complete the allocation under the current constraints. Then it needs to abandon the attempt, and try again with the next, less-strict policy that allows sharing of Logs and Mimages.

Anyway, these are implementation details. I think we agree on the goals.

Alasdair

#8 lore raw
In reply to Takahiro Yasui

I think things are not clear about this one, and everyone is confused.

Malahal (from IBM) and you have posted a few weeks ago design proposals and patches to add mirrored log capabilities and also the fact that it could be located on the mirror legs (pv in our cases) by using alloc_anywhere.

alloc_anywhere, as described in the man page is to let LVM put the data logical extents where ever it wants (not strict allocation policy) which is, in case a mirror is expected completely a nonsense.

You may, (this is a suggestion), when lvcreating a mirror with mirrored-log
- force strict allocation for the LE's (otherwise it' nonsense)
- put the mirrored log leg on each PV
- And may be disable alloc anywhare when creating mirrors ?

I may miss some cases (more that 2 data devices for RAID 1....)

Regards

Quoted 59 lines · Takahiro Yasui
Quoted 6 lines · Alasdair G Kergon
Quoted 2 lines · Takahiro Yasui

I tested the latest lvm2 and found that mirror legs were allocated in the same PV when "--alloc anywhere" was specified.

That is correct - it is what 'anywhere' means - it is OK for the tools to take the space from 'anywhere'.

Understand. (I was a bit confused because the behavior of 'anywhere' got changed.)

As for a mirror volume with 'mirrored' log, it is simpler to prepare two physical disks and create a mirror volume with 'mirrored log' in two disks. In this case, I expect that each disk has one of mirror legs one of mirror logs. I was thinking that '--alloc anywhere' was used to build this kind of mirror volumes.

This is an example case.

# pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/sdc   vg00 lvm2 a-   16.00G 16.00G
  /dev/sdd   vg00 lvm2 a-   16.00G 16.00G
# lvcreate -m1 -L1g -nlv00 --mirrorlog mirrored --alloc anywhere vg00
  Logical volume "lv00" created
# dmsetup ls --tree
vg00-lv00 (253:5)
 |-vg00-lv00_mimage_1 (253:4)
 |  `- (8:32)
 |-vg00-lv00_mimage_0 (253:3)
 |  `- (8:32)
 `-vg00-lv00_mlog (253:2)
    |-vg00-lv00_mlog_mimage_1 (253:1)
    |  `- (8:32)
    `-vg00-lv00_mlog_mimage_0 (253:0)
       `- (8:48)

Now I undestand that '--alloc anywhere' is not designed for this purpose and we need to use the workaround I described in the previous mail as below.

Quoted 8 lines

The workaround in this case is to create a mirror device with a core log, and then to convert it to a mirror with a disk log.

Are there any likely situations where a non-optimal layout is selected with --alloc normal? If so, can we identify them and find some strategy to handle it e.g. do we need to add another allocation policy to allow logs on the same PVs as mimages?

I don't have an issue of '--alloc normal' so far.

Thanks,
Taka

--
lvm-devel mailing list
lvm-devel at redhat.com
https://www.redhat.com/mailman/listinfo/lvm-devel

#9 lore raw
Quoted 1 line · brem belguebli

I think things are not clear about this one, and everyone is confused.

I believe that we agreed on what was our goal through this thread.

Quoted 8 lines

Malahal (from IBM) and you have posted a few weeks ago design proposals and patches to add mirrored log capabilities and also the fact that it could be located on the mirror legs (pv in our cases) by using alloc_anywhere.

alloc_anywhere, as described in the man page is to let LVM put the data logical extents where ever it wants (not strict allocation policy) which is, in case a mirror is expected completely a nonsense.

Yes, you are right. We can't expect where logical extents are allocated for '--alloc anywhere'

Quoted 5 lines

You may, (this is a suggestion), when lvcreating a mirror with mirrored-log
- force strict allocation for the LE's (otherwise it' nonsense)
- put the mirrored log leg on each PV
- And may be disable alloc anywhare when creating mirrors ?

I think that 'mirrored log' capability is very useful and enhancing availability is our next step. It is helpful if users can directly build a mirror volume, which has a mirrored log and is built on two physical devices and also each physical device contains a mirror leg and a mirror log, by a simple command line.

I hope this explanation would be helpful.

Thanks,
Taka

#10 lore raw

Yes, Thanks.

Mirrored-log allocated right on the 2 (or more) PV legs is something we've been expecting for long now, and I'm sure I'm not the only one in this case.

We had to hack-build our mirrored disks by layering MD over LVM, which is not that friendly in terms of integration, MD not being device-mapper friendly (it may have changed now) and in terms of debugging it's not always easy.

Hope you'll get it right, that'll make a lot of people life easier.

Brem

2010/4/21 Takahiro Yasui <[email protected]>:

Quoted 39 lines · brem belguebli
Quoted 1 line

I think things are not clear about this one, and everyone is confused.

I believe that we agreed on what was our goal through this thread.

Quoted 8 lines

Malahal (from IBM) and you have posted a few weeks ago design proposals and patches to add mirrored log capabilities and also the fact that it could be located on the mirror legs (pv in our cases) by using alloc_anywhere.

alloc_anywhere, as described in the man page is to let LVM put the data logical extents where ever it wants (not strict allocation policy) which is, in case a mirror is expected completely a nonsense.

Yes, you are right. We can't expect where logical extents are allocated for '--alloc anywhere'

Quoted 5 lines

You may, (this is a suggestion), when lvcreating a mirror with mirrored-log
- force strict allocation for the LE's (otherwise it' nonsense)
- put the mirrored log leg on each PV
- And may be disable alloc anywhare when creating mirrors ?

I think that 'mirrored log' capability is very useful and enhancing availability is our next step. It is helpful if users can directly build a mirror volume, which has a mirrored log and is built on two physical devices and also each physical device contains a mirror leg and a mirror log, by a simple command line.

I hope this explanation would be helpful.

Thanks,
Taka

--
lvm-devel mailing list
lvm-devel at redhat.com
https://www.redhat.com/mailman/listinfo/lvm-devel

#11 lore raw

Hi,

I've read in the RHEL 5.5 technical datasheet that the shipped LVM version 2.02.56 was alraedy capable of mirrored log.

Do you confirm that , as both the man pages (lvcreate, etc...) and the lvcreate -h do not show the option to do so.

Regards

Brem

2010/4/21 brem belguebli <[email protected]>:

Quoted 56 lines

Yes, Thanks.

Mirrored-log allocated right on the 2 (or more) PV legs is something we've been expecting for long now, and I'm sure I'm not the only one in this case.

We had to hack-build our mirrored disks by layering MD over LVM, which is not that friendly in terms of integration, MD not being device-mapper friendly (it may have changed now) and in terms of debugging it's not always easy.

Hope you'll get it right, that'll make a lot of people life easier.

Brem

2010/4/21 Takahiro Yasui <[email protected]>:

Quoted 39 lines · brem belguebli
Quoted 1 line

I think things are not clear about this one, and everyone is confused.

I believe that we agreed on what was our goal through this thread.

Quoted 8 lines

Malahal (from IBM) and you have posted a few weeks ago design proposals and patches to add mirrored log capabilities and also the fact that it could be located on the mirror legs (pv in our cases) by using alloc_anywhere.

alloc_anywhere, as described in the man page is to let LVM put the data logical extents where ever it wants (not strict allocation policy) which is, in case a mirror is expected completely a nonsense.

Yes, you are right. We can't expect where logical extents are allocated for '--alloc anywhere'

Quoted 5 lines

You may, (this is a suggestion), when lvcreating a mirror with mirrored-log
- force strict allocation for the LE's (otherwise it' nonsense)
- put the mirrored log leg on each PV
- And may be disable alloc anywhare when creating mirrors ?

I think that 'mirrored log' capability is very useful and enhancing availability is our next step. It is helpful if users can directly build a mirror volume, which has a mirrored log and is built on two physical devices and also each physical device contains a mirror leg and a mirror log, by a simple command line.

I hope this explanation would be helpful.

Thanks,
Taka

--
lvm-devel mailing list
lvm-devel at redhat.com
https://www.redhat.com/mailman/listinfo/lvm-devel

#12 lore raw

Hi Brem,

Quoted 2 lines · brem belguebli

I've read in the RHEL 5.5 technical datasheet that the shipped LVM version 2.02.56 was alraedy capable of mirrored log.

As far as I see lvm2 code, I don't think lvm2 in RHEL5.5 has mirrored log feature. I'm not sure which document you referred to. Could you tell me the exact name of "RHEL 5.5 technical datasheet"?

Can we see that document in the following URL?
http://www.redhat.com/docs/manuals/enterprise/

Thanks,
Taka

#14 lore raw
In reply to brem belguebli
Quoted 9 lines · brem belguebli
Quoted 7 lines · Takahiro Yasui
Quoted 2 lines · brem belguebli

I've read in the RHEL 5.5 technical datasheet that the shipped LVM version 2.02.56 was alraedy capable of mirrored log.

As far as I see lvm2 code, I don't think lvm2 in RHEL5.5 has mirrored log feature. I'm not sure which document you referred to. Could you tell me the exact name of "RHEL 5.5 technical datasheet"?

Quoted 8 lines

http://www.redhat.com/f/pdf/rhel/RHEL_5_5_TechOverview_wp_web.pdf
page 4, LVM

" LVM ??? the Logical Volume Management storage suite has been augmented to provide hot sparing
for mirror journals, enabling automatic replacement or removal of
failed logging devices.
"

Thanks for the information, but I am not sure if this sentence is telling 'mirrored log.' What I can say is the lvm2-2.02.56-8 doesn't have 'mirrored log' feature. I hope someone may give you a explanation...

Thanks,
Taka

#13 lore raw
In reply to Takahiro Yasui

Hi Taka,

Quoted 9 lines · Takahiro Yasui

Hi Brem,

Quoted 2 lines · brem belguebli

I've read in the RHEL 5.5 technical datasheet that the shipped LVM version 2.02.56 was alraedy capable of mirrored log.

As far as I see lvm2 code, I don't think lvm2 in RHEL5.5 has mirrored log feature. I'm not sure which document you referred to. Could you tell me the exact name of "RHEL 5.5 technical datasheet"?

http://www.redhat.com/f/pdf/rhel/RHEL_5_5_TechOverview_wp_web.pdf
page 4, LVM

" LVM ? the Logical Volume Management storage suite has been augmented to provide hot sparing
for mirror journals, enabling automatic replacement or removal of
failed logging devices.
"

Quoted 11 lines

Can we see that document in the following URL?
http://www.redhat.com/docs/manuals/enterprise/

Thanks,
Taka

--
lvm-devel mailing list
lvm-devel at redhat.com
https://www.redhat.com/mailman/listinfo/lvm-devel

I may misunderstand the sentence, or someone at RedHat Marketing may have written something not yet in the pipe for mainstream...

Regards

Brem

#15 lore raw
In reply to Takahiro Yasui
Quoted 19 lines · Takahiro Yasui
Quoted 9 lines · brem belguebli
Quoted 7 lines · Takahiro Yasui
Quoted 2 lines · brem belguebli

I've read in the RHEL 5.5 technical datasheet that the shipped LVM version 2.02.56 was alraedy capable of mirrored log.

As far as I see lvm2 code, I don't think lvm2 in RHEL5.5 has mirrored log feature. I'm not sure which document you referred to. Could you tell me the exact name of "RHEL 5.5 technical datasheet"?

Quoted 8 lines

http://www.redhat.com/f/pdf/rhel/RHEL_5_5_TechOverview_wp_web.pdf
page 4, LVM

" LVM ??? the Logical Volume Management storage suite has been augmented to provide hot sparing
for mirror journals, enabling automatic replacement or removal of
failed logging devices.
"

Quoted 3 lines

Thanks for the information, but I am not sure if this sentence is telling 'mirrored log.' What I can say is the lvm2-2.02.56-8 doesn't have 'mirrored log' feature. I hope someone may give you a explanation...

For all I can tell, this means that if the log fails, it is automatically replaced when there's a hotspare. Which is true, but it does not imply mirroring.

Yours,
Petr.

#16 lore raw
Quoted 20 lines · Petr Rockai [prockai at redhat.com]
Quoted 19 lines · Takahiro Yasui
Quoted 17 lines · brem belguebli
Quoted 7 lines · Takahiro Yasui
Quoted 2 lines · brem belguebli

I've read in the RHEL 5.5 technical datasheet that the shipped LVM version 2.02.56 was alraedy capable of mirrored log.

As far as I see lvm2 code, I don't think lvm2 in RHEL5.5 has mirrored log feature. I'm not sure which document you referred to. Could you tell me the exact name of "RHEL 5.5 technical datasheet"?

http://www.redhat.com/f/pdf/rhel/RHEL_5_5_TechOverview_wp_web.pdf
page 4, LVM

" LVM ??? the Logical Volume Management storage suite has been augmented to provide hot sparing
for mirror journals, enabling automatic replacement or removal of
failed logging devices.
"

Quoted 6 lines
Quoted 3 lines

Thanks for the information, but I am not sure if this sentence is telling 'mirrored log.' What I can say is the lvm2-2.02.56-8 doesn't have 'mirrored log' feature. I hope someone may give you a explanation...

For all I can tell, this means that if the log fails, it is automatically replaced when there's a hotspare. Which is true, but it does not imply mirroring.

But is that new in 5.5? I thought that feature is available in 5.4 too.

Thanks, Malahal.

#17 lore raw
In reply to Petr Rockai

Hi Petr,

Quoted 20 lines · Petr Rockai
Quoted 19 lines · Takahiro Yasui
Quoted 17 lines · brem belguebli
Quoted 7 lines · Takahiro Yasui
Quoted 2 lines · brem belguebli

I've read in the RHEL 5.5 technical datasheet that the shipped LVM version 2.02.56 was alraedy capable of mirrored log.

As far as I see lvm2 code, I don't think lvm2 in RHEL5.5 has mirrored log feature. I'm not sure which document you referred to. Could you tell me the exact name of "RHEL 5.5 technical datasheet"?

http://www.redhat.com/f/pdf/rhel/RHEL_5_5_TechOverview_wp_web.pdf
page 4, LVM

" LVM ??? the Logical Volume Management storage suite has been augmented to provide hot sparing
for mirror journals, enabling automatic replacement or removal of
failed logging devices.
"

Quoted 7 lines
Quoted 3 lines

Thanks for the information, but I am not sure if this sentence is telling 'mirrored log.' What I can say is the lvm2-2.02.56-8 doesn't have 'mirrored log' feature. I hope someone may give you a explanation...

For all I can tell, this means that if the log fails, it is automatically replaced when there's a hotspare. Which is true, but it does not imply mirroring.

I have never seen this documented anywhere, could you provide any link to this hotspare based log replacement?

Quoted 3 lines

Yours,
Petr.

Thanks

Brem

Quoted 4 lines

--
lvm-devel mailing list
lvm-devel at redhat.com
https://www.redhat.com/mailman/listinfo/lvm-devel