linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Duplicate PV's - how does LVM choose which one to use
@ 2012-02-21  8:40 Danilo Godec
  2012-02-21 12:09 ` Alasdair G Kergon
  0 siblings, 1 reply; 6+ messages in thread
From: Danilo Godec @ 2012-02-21  8:40 UTC (permalink / raw)
  To: LVM general discussion and development

Hi,

I had VG's and LV's on top of a Linux MD RAID1 array using two iSCSI 
volumes. Apparently this RAID1 array wasn't started properly after a 
reboot, so LVM detected two duplcate PV's (both RAID1 members had the 
same PV UUID) and chose to use one of them. Unfortunately I didn't 
notice it so it ran like that for a while.

I was lucky and the machine was only rebooted once, so LVM used the same 
PV all the time, but what would happen on a next reboot?

How does LVM decide which one to use?  Will it always choose the same one?


    Thanks, Danilo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Duplicate PV's - how does LVM choose which one to use
  2012-02-21  8:40 [linux-lvm] Duplicate PV's - how does LVM choose which one to use Danilo Godec
@ 2012-02-21 12:09 ` Alasdair G Kergon
  2012-02-21 16:35   ` Ray Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Alasdair G Kergon @ 2012-02-21 12:09 UTC (permalink / raw)
  To: LVM general discussion and development

On Tue, Feb 21, 2012 at 09:40:43AM +0100, Danilo Godec wrote:
> How does LVM decide which one to use?  Will it always choose the same one?

You can't rely on that.

I'm starting to wonder if we should add an lvm.conf option to stop when it sees
duplicates of equal priority instead of going ahead and using one, and to make
that the default behaviour.

Alasdair

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Duplicate PV's - how does LVM choose which one to use
  2012-02-21 12:09 ` Alasdair G Kergon
@ 2012-02-21 16:35   ` Ray Morris
  2012-02-21 16:43     ` Alasdair G Kergon
  0 siblings, 1 reply; 6+ messages in thread
From: Ray Morris @ 2012-02-21 16:35 UTC (permalink / raw)
  To: linux-lvm

Perhaps when duplicates are found the seqno should be incremented 
so it DOES use the same one next time, and generate a warning 
indicating which one is out of date?
-- 
Ray Morris
support@bettercgi.com

Strongbox - The next generation in site security:
http://www.bettercgi.com/strongbox/

Throttlebox - Intelligent Bandwidth Control
http://www.bettercgi.com/throttlebox/

Strongbox / Throttlebox affiliate program:
http://www.bettercgi.com/affiliates/user/register.php




On Tue, 21 Feb 2012 12:09:33 +0000
Alasdair G Kergon <agk@redhat.com> wrote:

> On Tue, Feb 21, 2012 at 09:40:43AM +0100, Danilo Godec wrote:
> > How does LVM decide which one to use?  Will it always choose the
> > same one?
> 
> You can't rely on that.
> 
> I'm starting to wonder if we should add an lvm.conf option to stop
> when it sees duplicates of equal priority instead of going ahead and
> using one, and to make that the default behaviour.
> 
> Alasdair
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Duplicate PV's - how does LVM choose which one to use
  2012-02-21 16:35   ` Ray Morris
@ 2012-02-21 16:43     ` Alasdair G Kergon
  2012-02-21 16:49       ` Stuart D Gathman
  0 siblings, 1 reply; 6+ messages in thread
From: Alasdair G Kergon @ 2012-02-21 16:43 UTC (permalink / raw)
  To: LVM general discussion and development

On Tue, Feb 21, 2012 at 10:35:03AM -0600, Ray Morris wrote:
> Perhaps when duplicates are found the seqno should be incremented 
> so it DOES use the same one next time, and generate a warning 
> indicating which one is out of date?

Wouldn't be possible - it can't distinguish between them (or we'd not
be in this situation).

If they have the same UUID it assumes they are different paths to the same
device and picks one of them to use.

But there are other cases (like hardware snapshot, mirror that failed to
start up first) where it's better to stop and force the sysadmin to fix
things.

Alasdair

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Duplicate PV's - how does LVM choose which one to use
  2012-02-21 16:43     ` Alasdair G Kergon
@ 2012-02-21 16:49       ` Stuart D Gathman
  2012-02-21 17:07         ` Alasdair G Kergon
  0 siblings, 1 reply; 6+ messages in thread
From: Stuart D Gathman @ 2012-02-21 16:49 UTC (permalink / raw)
  To: linux-lvm

Long ago, Nostradamus foresaw that on 02/21/2012 11:43 AM, Alasdair G 
Kergon would write:
> On Tue, Feb 21, 2012 at 10:35:03AM -0600, Ray Morris wrote:
>> Perhaps when duplicates are found the seqno should be incremented
>> so it DOES use the same one next time, and generate a warning
>> indicating which one is out of date?
> Wouldn't be possible - it can't distinguish between them (or we'd not
> be in this situation).
>
> If they have the same UUID it assumes they are different paths to the same
> device and picks one of them to use.
>
> But there are other cases (like hardware snapshot, mirror that failed to
> start up first) where it's better to stop and force the sysadmin to fix
> things.
>
But if they are different paths, incrementing seqno won't hurt, both 
paths will see the change.  And if it is a mirror that failed to start, 
then the chosen leg is now distinguishable.  Is there a problem with 
incrementing seqno an extra time at startup when multipath is the normal 
situation?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Duplicate PV's - how does LVM choose which one to use
  2012-02-21 16:49       ` Stuart D Gathman
@ 2012-02-21 17:07         ` Alasdair G Kergon
  0 siblings, 0 replies; 6+ messages in thread
From: Alasdair G Kergon @ 2012-02-21 17:07 UTC (permalink / raw)
  To: Stuart D Gathman; +Cc: linux-lvm

On Tue, Feb 21, 2012 at 11:49:40AM -0500, Stuart D Gathman wrote:
> But if they are different paths, incrementing seqno won't hurt, both  
> paths will see the change.  And if it is a mirror that failed to start,  
> then the chosen leg is now distinguishable.  Is there a problem with  
> incrementing seqno an extra time at startup when multipath is the normal  
> situation?

If you update some PV-level indicator and only one path sees the update, then
that's exactly a case where you must use neither until the sysadmin decides
which was the right one to use.  And the other case - multipath - well again,
why didn't your multipath software start up and take control?

Alasdair

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-02-21 17:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-21  8:40 [linux-lvm] Duplicate PV's - how does LVM choose which one to use Danilo Godec
2012-02-21 12:09 ` Alasdair G Kergon
2012-02-21 16:35   ` Ray Morris
2012-02-21 16:43     ` Alasdair G Kergon
2012-02-21 16:49       ` Stuart D Gathman
2012-02-21 17:07         ` Alasdair G Kergon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).