Skip to contentSkip to conversation

Duplicate PV's - how does LVM choose which one to use

linux-lvm Danilo Godec 4 participants 6 messages Feb 21, 2012

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 1 line · Danilo Godec

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

#2 lore raw

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?

Signature · 16 lines
Ray Morris
[email protected]

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
Quoted 18 lines · Alasdair G Kergon
Quoted 2 lines · Danilo Godec

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
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#3 lore raw
Quoted 3 lines · Ray Morris

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

#4 lore raw

Long ago, Nostradamus foresaw that on 02/21/2012 11:43 AM, Alasdair G Kergon would write:

Quoted 7 lines · Ray Morris
Quoted 3 lines

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).

Quoted 7 lines

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?

#5 lore raw
Quoted 5 lines · Stuart D Gathman

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