linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: "Tomas Dalebjörk" <tomas.dalebjork@gmail.com>
To: Zdenek Kabelac <zkabelac@redhat.com>
Cc: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] exposing snapshot block device
Date: Mon, 4 Nov 2019 15:40:59 +0100	[thread overview]
Message-ID: <CACrcyfJxYvr7BC6Srts1bnNWLxsme8d3hjEQqYQyBz9sqbNp6g@mail.gmail.com> (raw)
In-Reply-To: <29ad8317-4a55-f017-6a0b-c06bf40ccab8@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 5103 bytes --]

Thanks for feedback.

Let me try to type different scenarios:

We have an origin volume, lets call it: /dev/vg00/lv00
We convert a snapshot volume to origin volume, lets call it:
/dev/vg00/lv00-snap
- all blocks has been changed, and are represented in the
/dev/vg00/lv00-snap, when we start the lvconvert process

I assume that something reads the data from /dev/vg00/lv00-snap and copy
that to /dev/vg00/lv00
It will most likely start from the first block, to the last block to copy.
The block size is 1MB on /dev/vg00/lv00-snap, and we have for simplicity
the same block size on the origin /dev/vg00/lv00

Scenario 1: A read comes want to read block LP 100, but lvconvert has not
yet copied that LP block.
Will the read comes from /dev/vg00/lv00-snap directly and delivered to
requestor?
Or will lvconvert prioritize to copy data from /dev/vg00/lv00-snap to
/dev/vg00/lv00 for that block, and let the requestor wait until the copying
has been completed, so that a read operation can happen from origin?
Or will the requestor have to wait until the copy data from
/dev/vg00/lv00-snap to /dev/vg00/lv00 for that block has been completed,
without any prioritization?

Scenario 2: A write comes want to write block LP 100, but lvconvert has not
yet copied that LP block (yes, I do understand that origin is hidden now)
Will lvconvery prioritize to copy data from /dev/vg00/lv00-snap to
/dev/vg00/lv00 for that block, and let the requestor write the changes
directly on the origin after the copying has been performed?
Or will the write be blocked until lvconvert has finished the copying of
the requested block, and than a write can be accepted to the origin?
Or where will the changes be written?

It is important for me to understand, as the backup device that I want to
map as a COW device is a read only target, and is not allowed to be written
to.
If read happends from the backup COW device, and writes happends to the
origin, than it is possible to create an instant recovery.
If writes happends to the backup COW device, than it not that easy to
implement a instance reovery solution, as the backup device is write
protected.

Thanks in advance.

Den mån 4 nov. 2019 kl 11:07 skrev Zdenek Kabelac <zkabelac@redhat.com>:

> Dne 04. 11. 19 v 6:54 Tomas Dalebjörk napsal(a):
> > Hi
> >
> > I have some additional questions related to this.
> > regarding this statement:
> > “ While the merge is in progress, reads or writes to the origin appear
> as they
> > were directed to the snapshot being merged. ”
> >
> > What exactly does that mean?
> >
> > Will that mean that before changes are being placed on the origin
> device, it
> > has to first:
> > read the data from the snapshot back to origin, copy the data back from
> origin
> > to the snapshot, and than after that allow changes to happen?
> > if that is the case, does it keep track of that this block should not be
> > copied again?
>
> Hi
>
> When the 'merge' is in progress -  your 'origin' is no longer accessible
> for your normal usage. It's hiddenly active and only usable by
> snapshot-merge
> target)
>
> So during 'merging' - you can already use you snapshot like if it would be
> and
> origin - and in the background there is a process that reads data from
> 'snapshot' COW device and copies them back to hidden origin.
> (this is what you can observe with 'lvs' and copy%)
>
> So any 'new' writes to such device lends at right place -  reads are
> either
> from COW (if the block has not yet been merged) or from origin.
>
> Once all blocks from 'COW' are merged into origing - tables are remapped
> again
> so all 'supportive' devices are removed and only your 'now fully merged'
> origin becomes present for usage (while still being fully online)
>
> Hopefully it gets more clear.
>
>
> For more explanation how DM works - probably visit:
> http://people.redhat.com/agk/talks/
>
> > and will the ongoing merge priorities this block before the other
> background
> > copying?
> >
> > how about read operations ?
> > will the requested read operations on the origin volume be prioritized
> before
> > the copying of snapshot data?
>
> The priority is that you always get proper block.
> Don't seek there the 'top most' performance - the correctness was always
> the
> priority there and for long time there is no much devel effort on this
> ancient
> target - since  thin-pool usage is simply way more superior....
>
> 1st. note - major difficulty comes from ONLINE usage. If you do NOT need
> device to be online (aka you keep 'reserve' copy of device) - you can
> merge
> things directly into a device - and I simply don't see why you would want
> to
> complicate this whole with extra step of transforming data into COW format
> first and the do online merge.
>
> 2nd. note - clearly one cannot start 'merge' of snapshot into origin while
> such origin device is in-use (i.e. mounted) - as that would lead to
> 'modification' of such filesystem under its hands.
>
> Regards
>
> Zdenek
>
>

[-- Attachment #2: Type: text/html, Size: 6031 bytes --]

  reply	other threads:[~2019-11-04 14:40 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22 10:47 [linux-lvm] exposing snapshot block device Dalebjörk, Tomas
2019-10-22 13:57 ` Zdenek Kabelac
2019-10-22 15:29   ` Dalebjörk, Tomas
2019-10-22 15:36     ` Zdenek Kabelac
2019-10-22 16:13       ` Dalebjörk, Tomas
2019-10-23 10:26         ` Zdenek Kabelac
2019-10-23 10:56           ` Tomas Dalebjörk
2019-10-22 16:15       ` Stuart D. Gathman
2019-10-22 17:02         ` Tomas Dalebjörk
2019-10-22 21:38         ` Gionatan Danti
2019-10-22 22:53           ` Stuart D. Gathman
2019-10-23  6:58             ` Gionatan Danti
2019-10-23 10:06               ` Tomas Dalebjörk
2019-10-23 10:12             ` Zdenek Kabelac
2019-10-23 10:46         ` Zdenek Kabelac
2019-10-23 11:08           ` Gionatan Danti
2019-10-23 11:24             ` Tomas Dalebjörk
2019-10-23 11:26               ` Tomas Dalebjörk
2019-10-24 16:01               ` Zdenek Kabelac
2019-10-25 16:31                 ` Tomas Dalebjörk
2019-11-04  5:54                   ` Tomas Dalebjörk
2019-11-04 10:07                     ` Zdenek Kabelac
2019-11-04 14:40                       ` Tomas Dalebjörk [this message]
2019-11-04 15:04                         ` Zdenek Kabelac
2019-11-04 17:28                           ` Tomas Dalebjörk
2019-11-05 16:24                             ` Zdenek Kabelac
2019-11-05 16:40                         ` Mikulas Patocka
2019-11-05 20:56                           ` Tomas Dalebjörk
2019-11-06  9:22                             ` Zdenek Kabelac
2019-11-07 16:54                             ` Mikulas Patocka
2019-11-07 17:29                               ` Tomas Dalebjörk
2020-09-04 12:09                                 ` Tomas Dalebjörk
2020-09-04 12:37                                   ` Zdenek Kabelac
2020-09-07 13:09                                   ` Mikulas Patocka
2020-09-07 14:14                                     ` Dalebjörk, Tomas
2020-09-07 14:17                                       ` Zdenek Kabelac
2020-09-07 16:34                                         ` Tomas Dalebjörk
2020-09-07 16:42                                           ` Zdenek Kabelac
2020-09-07 17:37                                             ` Tomas Dalebjörk
2020-09-07 17:50                                               ` Zdenek Kabelac
2020-09-08 12:32                                                 ` Dalebjörk, Tomas
2020-09-07 19:56                                             ` Tomas Dalebjörk
2020-09-07 20:22                                               ` Tomas Dalebjörk
2020-09-07 21:02                                               ` Tomas Dalebjörk
2019-10-23 12:12             ` Ilia Zykov
2019-10-23 12:20             ` Ilia Zykov
2019-10-23 13:05               ` Zdenek Kabelac
2019-10-23 14:40                 ` Gionatan Danti
2019-10-23 15:46                   ` Ilia Zykov
2019-10-23 12:59             ` Zdenek Kabelac
2019-10-23 14:37               ` Gionatan Danti
2019-10-23 15:37                 ` Zdenek Kabelac
2019-10-23 17:16                   ` Gionatan Danti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACrcyfJxYvr7BC6Srts1bnNWLxsme8d3hjEQqYQyBz9sqbNp6g@mail.gmail.com \
    --to=tomas.dalebjork@gmail.com \
    --cc=linux-lvm@redhat.com \
    --cc=zkabelac@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).