From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Snitzer Subject: Re: Snapshot merging Date: Wed, 9 Sep 2009 12:12:48 -0400 Message-ID: <20090909161247.GA16156@redhat.com> References: <4A97A035.9010604@redhat.com> <20090831221149.GB15126@redhat.com> <20090909155642.GB15981@redhat.com> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20090909155642.GB15981@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Mikulas Patocka Cc: dm-devel@redhat.com List-Id: dm-devel.ids On Wed, Sep 09 2009 at 11:56am -0400, Mike Snitzer wrote: > On Wed, Sep 09 2009 at 11:47am -0400, > Mikulas Patocka wrote: > > > Hi > > > > I found one bug in the userspace code --- start merging, then from the > > other console deactivate the origin volume with lvchange -an, then wait > > next 15 seconds for the next poll interval: > > > > the poll process will think that the merging finished, removing the > > snapshot, leaving partially merged origin and causing data corruption: > > > > [slunicko:~]# lvconvert -M vg1/lv2_snap1 > > Merging of volume lv2_snap1 started. > > lv2: Merged: 13.1% > > ( .... deactivate the volume from the other console ....) > > lv2: Merged: -1.0% > > Merge into logical volume lv2 finished. > > Logical volume "snapshot4" successfully removed > > > > Maybe this bug was in my code too, I don't remember. > > Likely, considering I merely ported your LVM2 patches to the latest > version. That said, I could've introduced this issue by missing > something in the port. Regardless, I'll have a look at preventing the > origin LV from being deactivated during a merge. Or more correctly: gracefully halt the merge and deactivate merging snapshot along with the origin. Then on activation the merge should just resume (in the background). Mike