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 [[email protected]] 发送时间: 2017年4月3日 23:00 收件人: 许雪寒 Cc: [email protected] 主题: Re: 答复: [ceph-users] 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, 许雪寒 <[email protected]> wrote: > Hi, the operation we performed is AioTruncate. > ________________________________________ > 发件人: Jason Dillaman [[email protected]] > 发送时间: 2017年4月3日 22:11 > 收件人: 许雪寒 > Cc: [email protected] > 主题: Re: [ceph-users] rbd expord-diff aren't counting AioTruncate op correctly > > On Fri, Mar 31, 2017 at 10:36 PM, 许雪寒 <[email protected]> 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 [email protected] http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
