Oh, sorry again. We didn't resize the image, just "aio_discard"ed the data from the offset 1048576 to the end of the rbd image. ________________________________________ 发件人: 许雪寒 发送时间: 2017年4月9日 16:37 收件人: dillaman@xxxxxxxxxx Cc: ceph-users@xxxxxxxxxxxxxx 主题: 答复: 答复: 答复: rbd expord-diff aren't counting AioTruncate op correctly Ah, sorry, I didn't understand you correctyly. We did use the librbd::Image::aio_discard method to resize the image from 4MB to 1MB. ________________________________________ 发件人: ceph-users [ceph-users-bounces@xxxxxxxxxxxxxx] 代表 许雪寒 [xuxuehan@xxxxxx] 发送时间: 2017年4月3日 23:27 收件人: dillaman@xxxxxxxxxx Cc: ceph-users@xxxxxxxxxxxxxx 主题: 答复: 答复: rbd expord-diff aren't counting AioTruncate op correctly Hi, actually, in our test, we created an image with the size 4MB which means it has only one object, then we write data into it, create a snap, clone it and create a snap of the new image, say "snap1", and then we send a "AioTruncate" to truncate the image to 1MB and create the second snap of the new image, say "snap2". Then, we use export-diff to calculate the "diff" between snap1 and snap2. By examing the result of export-diff, we confirmed that only the data that left in object are recorded into the export-diff's result, the truncate operation is lost. By the way, according to our understanding of the source code, it seems that the reason for this is that when doing copy-up, no clone is created even if there has already been some snapshot of the new image. So, if there's only one "WRITE" op is sent to the object, which leads to a "copy-up", before a new snapshot is created after which a export-diff is conducted, the export-diff will copy all the data in the HEAD object, which, in our case, is not the "diff" that we want. ________________________________________ 发件人: Jason Dillaman [jdillama@xxxxxxxxxx] 发送时间: 2017年4月3日 23:00 收件人: 许雪寒 Cc: ceph-users@xxxxxxxxxxxxxx 主题: Re: 答复: rbd expord-diff aren't counting AioTruncate op correctly Are you referring to the class "AioTruncate"? If so, *how* did you issue the truncate against a specific object? Did you use the RBD API's discard method? Did you resize an image? I need a repeatable set of instructions. On Mon, Apr 3, 2017 at 10:58 AM, 许雪寒 <xuxuehan@xxxxxx> wrote: > Hi, the operation we performed is AioTruncate. > ________________________________________ > 发件人: Jason Dillaman [jdillama@xxxxxxxxxx] > 发送时间: 2017年4月3日 22:11 > 收件人: 许雪寒 > Cc: ceph-users@xxxxxxxxxxxxxx > 主题: Re: rbd expord-diff aren't counting AioTruncate op correctly > > On Fri, Mar 31, 2017 at 10:36 PM, 许雪寒 <xuxuehan@xxxxxx> wrote: >> We created an image, write data into it, then protect it and clone a new image. Then we create a snapshot, snap1, of the cloned image, then truncate it and create a snapshot, snap2. In the diff of the two snapshot, we found that only the data that are not truncated is recorded in the diff, which means the truncate operation is not reflected by the diff. > > When you say "truncate" above, what specific operation are you > performing so that I can attempt to recreate it? > > > -- > Jason -- Jason _______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com _______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com