Re: Real size of rbd image

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

 



On 12/02/2013 08:10 AM, Stephen Taylor wrote:
I had not enabled discard/trim for the filesystem using the image, but I have done so this morning. I doesn't appear to make a difference.

The extents I'm seeing reported as "zero" are not actually discarded extents. They are extents that contain data that was added after the ending snapshot I'm giving to the diff command. If I specify a later ending snapshot or none, then the same extents are reported as "data" rather than as "zero" extents. Ignoring those seems to give me the correct size when I'm calculating a diff size from one snapshot to another, but I wanted to make sure that this situation is expected before I rely on it, although continuing to ignore these extents in the future if they simply go away seems easy enough.

Ah, I see where these are coming from now. It's confusing but
technically correct output for objects that do not exist in the
given snapshots, but do in the current version of the image.
We should probably omit these extents from the output. They don't
affect correctness of size calculations or applying diffs, so it
should be backwards compatible to do so. Issue created [1].

Like you said, ignoring any extents marked 'zero' is always fine
for this size calculation.

Josh

[1] http://tracker.ceph.com/issues/6926

Again, I appreciate your help.

Steve

-----Original Message-----
From: Josh Durgin [mailto:josh.durgin@xxxxxxxxxxx]
Sent: Wednesday, November 27, 2013 7:51 PM
To: Stephen Taylor; ceph-users@xxxxxxxxxxxxxx
Subject: Re:  Real size of rbd image

On 11/26/2013 02:22 PM, Stephen Taylor wrote:
  From ceph-users archive 08/27/2013:

On 08/27/2013 01:39 PM, Timofey Koolin wrote:

/Is way to know real size of rbd image and rbd snapshots?/

/rbd ls -l write declared size of image, but I want to know real
size./

You can sum the sizes of the extents reported by:

       rbd diff pool/image[@snap] [--format json]

That's the difference since the beginning of time, so it reports all

used extents.

Josh

I don't seem to be able to find any documentation supporting the
[@snap] parameter for this call, but it seems to work, at least in
part. I have a requirement to find the size of a snapshot relative to
another snapshot. Here is what I've used:

                  rbd diff pool/image@snap2 --from-snap snap1

Most rbd commands work on snapshots too. The help text could certainly be improved - suggestions welcome!

The returned list of extents seems to include all changes since snap1,
not just those up to snap2, but those that have been written after
snap2 are labeled "zero" rather than as "data" extents. If I ignore the "zero"
extents and sum the lengths of the "data" extents, it seems to give me
an accurate relative snapshot size. Is this expected behavior and the
correct way to calculate the size I'm looking for?

Do you have discard/trim enabled for whatever's using the image?
The diff will include discarded extents as "zero". For calculating size, it's fine to ignore them. It would be unexpected if these aren't listed when you leave out the @snap2 portion though.

Josh


_______________________________________________
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