All of lore.kernel.org
 help / color / mirror / Atom feed
* a bug in --namesnapshot merge
@ 2009-09-14 17:21 Mikulas Patocka
  2009-09-15 19:21   ` Mike Snitzer
  0 siblings, 1 reply; 3+ messages in thread
From: Mikulas Patocka @ 2009-09-14 17:21 UTC (permalink / raw)
  To: Mike Snitzer, Alasdair G Kergon; +Cc: dm-devel

Hi

When lvconvert -M --namesnapshot is invoked, there is a bug, it ends up 
with a message like
device-mapper: snapshots: exception for block 0 is on disk but not in 
memory

The bug is not in the kernel but in the lvm. It loads -real and -cow 
devices badly, so that the kernel treats the origin volume as the 
snapshot.

The --namesnapshot option causes that the snapshot becomes the origin and 
mergin starts, if we have
lv-origin   owi-a- origin
lv-snapshot swi--- snapshot
, after lvconvert -M --namesnapshot vg/lv-snapshot, we'll have
lv-snapshot Owi-a- mergin snapshot, containing the previous content of 
lv-snapshot

The trick that needs to be done is to preserve the logical volume 
structure and the device, but move it from one storage to another. Sadly, 
LVM2 is not designed to do it. That --pivotorigin option that Alasdair 
implemented needed the same trick and it was buggy too.

I'd suggest to remove --namesnapshot option at all (and remove patches
lvm-merge-swap-uuid.patch and 
lvm-merge-swap-lvid-of-underlying-devices.patch that do most of this 
stuff) and leave only --nameorigin and --onactivate.

The implementation of --namesnapshot is very dirty. I was writing that 
option --namesnapshot for a month, implemented it three times before 
getting it right. And now some other changes to lvm made it nonworking 
again. It is unmaintainable over the long term. It is not worth fixing, 
because it would be beroken again.

Other that that, I think that snapshot merging could be applied to the 
kernel and lvm.

Mikulas

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

* Re: a bug in --namesnapshot merge
  2009-09-14 17:21 a bug in --namesnapshot merge Mikulas Patocka
@ 2009-09-15 19:21   ` Mike Snitzer
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Snitzer @ 2009-09-15 19:21 UTC (permalink / raw)
  To: Mikulas Patocka; +Cc: dm-devel, Alasdair G Kergon, lvm-devel

On Mon, Sep 14 2009 at  1:21pm -0400,
Mikulas Patocka <mpatocka@redhat.com> wrote:

> Hi
> 
> When lvconvert -M --namesnapshot is invoked, there is a bug, it ends up 
> with a message like
> device-mapper: snapshots: exception for block 0 is on disk but not in 
> memory
> 
> The bug is not in the kernel but in the lvm. It loads -real and -cow 
> devices badly, so that the kernel treats the origin volume as the 
> snapshot.
> 
> The --namesnapshot option causes that the snapshot becomes the origin and 
> mergin starts, if we have
> lv-origin   owi-a- origin
> lv-snapshot swi--- snapshot
> , after lvconvert -M --namesnapshot vg/lv-snapshot, we'll have
> lv-snapshot Owi-a- mergin snapshot, containing the previous content of 
> lv-snapshot
> 
> The trick that needs to be done is to preserve the logical volume 
> structure and the device, but move it from one storage to another. Sadly, 
> LVM2 is not designed to do it. That --pivotorigin option that Alasdair 
> implemented needed the same trick and it was buggy too.
> 
> I'd suggest to remove --namesnapshot option at all (and remove patches
> lvm-merge-swap-uuid.patch and 
> lvm-merge-swap-lvid-of-underlying-devices.patch that do most of this 
> stuff) and leave only --nameorigin and --onactivate.
> 
> The implementation of --namesnapshot is very dirty. I was writing that 
> option --namesnapshot for a month, implemented it three times before 
> getting it right. And now some other changes to lvm made it nonworking 
> again. It is unmaintainable over the long term. It is not worth fixing, 
> because it would be beroken again.
> 
> Other that that, I think that snapshot merging could be applied to the 
> kernel and lvm.

I agree with the above.  The two times I rebased those swap uuid patches
they were fairly fragile/subtle/challenging.  Eliminating --namesnapshot
seems reasonable.  I updated the LVM2 snapshot-merge patches accordingly:

http://people.redhat.com/msnitzer/patches/snapshot-merge/lvm2/LVM2-2.02.52/

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

* Re: a bug in --namesnapshot merge
@ 2009-09-15 19:21   ` Mike Snitzer
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Snitzer @ 2009-09-15 19:21 UTC (permalink / raw)
  To: lvm-devel

On Mon, Sep 14 2009 at  1:21pm -0400,
Mikulas Patocka <mpatocka@redhat.com> wrote:

> Hi
> 
> When lvconvert -M --namesnapshot is invoked, there is a bug, it ends up 
> with a message like
> device-mapper: snapshots: exception for block 0 is on disk but not in 
> memory
> 
> The bug is not in the kernel but in the lvm. It loads -real and -cow 
> devices badly, so that the kernel treats the origin volume as the 
> snapshot.
> 
> The --namesnapshot option causes that the snapshot becomes the origin and 
> mergin starts, if we have
> lv-origin   owi-a- origin
> lv-snapshot swi--- snapshot
> , after lvconvert -M --namesnapshot vg/lv-snapshot, we'll have
> lv-snapshot Owi-a- mergin snapshot, containing the previous content of 
> lv-snapshot
> 
> The trick that needs to be done is to preserve the logical volume 
> structure and the device, but move it from one storage to another. Sadly, 
> LVM2 is not designed to do it. That --pivotorigin option that Alasdair 
> implemented needed the same trick and it was buggy too.
> 
> I'd suggest to remove --namesnapshot option at all (and remove patches
> lvm-merge-swap-uuid.patch and 
> lvm-merge-swap-lvid-of-underlying-devices.patch that do most of this 
> stuff) and leave only --nameorigin and --onactivate.
> 
> The implementation of --namesnapshot is very dirty. I was writing that 
> option --namesnapshot for a month, implemented it three times before 
> getting it right. And now some other changes to lvm made it nonworking 
> again. It is unmaintainable over the long term. It is not worth fixing, 
> because it would be beroken again.
> 
> Other that that, I think that snapshot merging could be applied to the 
> kernel and lvm.

I agree with the above.  The two times I rebased those swap uuid patches
they were fairly fragile/subtle/challenging.  Eliminating --namesnapshot
seems reasonable.  I updated the LVM2 snapshot-merge patches accordingly:

http://people.redhat.com/msnitzer/patches/snapshot-merge/lvm2/LVM2-2.02.52/



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

end of thread, other threads:[~2009-09-15 19:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-14 17:21 a bug in --namesnapshot merge Mikulas Patocka
2009-09-15 19:21 ` Mike Snitzer
2009-09-15 19:21   ` Mike Snitzer

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.