Re: Consistency problems when taking RBD snapshot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 13, 2016 at 4:11 PM, Nikolay Borisov <kernel@xxxxxxxx> wrote:
>
>
> On 09/13/2016 04:30 PM, Ilya Dryomov wrote:
> [SNIP]
>>
>> Hmm, it could be about whether it is able to do journal replay on
>> mount.  When you mount a snapshot, you get a read-only block device;
>> when you mount a clone image, you get a read-write block device.
>>
>> Let's try this again, suppose image is foo and snapshot is snap:
>>
>> # fsfreeze -f /mnt
>>
>> # rbd snap create foo@snap
>> # rbd map foo@snap
>> /dev/rbd0
>> # file -s /dev/rbd0
>> # fsck.ext4 -n /dev/rbd0
>> # mount /dev/rbd0 /foo
>> # umount /foo
>> <full dmesg>
>> # file -s /dev/rbd0
>> # fsck.ext4 -n /dev/rbd0
>>
>> # rbd clone foo@snap bar
>> $ rbd map bar
>> /dev/rbd1
>> # file -s /dev/rbd1
>> # fsck.ext4 -n /dev/rbd1
>> # mount /dev/rbd1 /bar
>> # umount /bar
>> <full dmesg>
>> # file -s /dev/rbd1
>> # fsck.ext4 -n /dev/rbd1
>>
>> Could you please provide the output for the above?
>
> Here you go : http://paste.ubuntu.com/23173721/

OK, so that explains it: the frozen filesystem is "needs journal
recovery", so mounting it off of read-only block device leads to
errors.

root@alxc13:~# fsfreeze -f /var/lxc/c11579
root@alxc13:~# rbd snap create rbd/c11579@snap_test
root@alxc13:~# rbd map c11579@snap_test
/dev/rbd151
root@alxc13:~# fsfreeze -u /var/lxc/c11579
root@alxc13:~# file -s /dev/rbd151
/dev/rbd151: Linux rev 1.0 ext4 filesystem data (needs journal
recovery) (extents) (large files) (huge files)

Now, to isolate the problem, the easiest would probably be to try to
reproduce it with loop devices.  Can you try dding one of these images
to a file, make sure that the filesystem is clean, losetup + mount,
freeze, make a "snapshot" with cp and losetup -r + mount?

Try sticking file -s before unfreeze and also compare md5sums:

root@alxc13:~# fsfreeze -f /var/lxc/c11579
<md5sum for /var/lxc/c11579 device>
root@alxc13:~# rbd snap create rbd/c11579@snap_test
root@alxc13:~# rbd map c11579@snap_test
<md5sum for /var/lxc/c11579 device>
<md5sum for /dev/rbd151>
root@alxc13:~# file -s /dev/rbd151
root@alxc13:~# fsfreeze -u /var/lxc/c11579
<md5sum for /var/lxc/c11579 device>
<md5sum for /dev/rbd151>
root@alxc13:~# file -s /dev/rbd151

Thanks,

                Ilya
_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com



[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux