[linux-lvm] ANNOUNCE: an experimental implementation of snapshot merging

Mikulas Patocka mpatocka at redhat.com
Wed Jun 4 11:11:20 UTC 2008


On Tue, 3 Jun 2008, Brian J. Murrell wrote:

> On Tue, 2008-06-03 at 20:20 -0400, Greg Freemyer wrote:
>> Your making it too complicated.
>>
>> Effectively the snapshot immediately becomes the primary volume
>
> How can that be done?  I thought the snapshot was simply a device which
> upon creation (i.e. before any writes to the origin) is just a series of
> block-by-block pointers to the origin.  As blocks in the origin are
> changed, those blocks are copied down to the snapshot are replace the
> pointer to itself.
>
> So in the case where the origin has had 50% of it's blocks updated, in
> order for the snapshot to become the origin, that 50% which has been
> written down in to the snapshot need to be written back up into the
> origin (along with any blocks which were changed in the snapshot
> directly).  How can the snapshot "immediately" become the primary volume
> if that data migration has to happen?

The requests are transparently re-routed to the merging snapshot.

So, when you start merging, the origin device physically contains the old 
data (that are being overwritten by data from the snapshot), but when you 
make a read or write request to the origin, that request causes look-up in 
the exception table of the merging snapshot and if a match is found, the 
request is remapped to the snapshot.

So the merging snapshot and the origin appear to contain the same data. 
(in the final version, one of them will not appear in the list of logical 
volumes, so that it won't confuse the user --- but this is only userspace 
thing)

Mikulas

> b.




More information about the linux-lvm mailing list