All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Durgin <josh.durgin@dreamhost.com>
To: Oliver Francke <Oliver.Francke@filoo.de>
Cc: ceph-devel@vger.kernel.org
Subject: Re: q. about rbd-header
Date: Wed, 14 Mar 2012 13:54:19 -0700	[thread overview]
Message-ID: <4F61057B.30808@dreamhost.com> (raw)
In-Reply-To: <9CB50149-F22E-4130-80FD-1A8472891BD5@filoo.de>

On 03/14/2012 08:05 AM, Oliver Francke wrote:
> Hey,
>
> anybody out there who could explain the structure of a rbd-header? After
> last crash we have about 10 images with a:
>     2012-03-14 15:22:47.998790 7f45a61e3760 librbd: Error reading
> header: 2 No such file or directory
> error opening image vm-266-disk-1.rbd: 2 No such file or directory
> ... error?
> I understand the "rb.x.y"-prefix, the 2 ^ 16hex as block-size. But
> the size/count encoding is not intuitive ;)

The data structure is rbd_obj_header_ondisk, defined in 
src/include/rbd_types.h.

The size of the objects is stored as a shift value in the 'order' field. 
That is, object size is (1 << order) bytes, and the default of 4MB is 
order 22. The total size (image_size) is just a number of bytes.

The encoding of snapshots is a bit more painful, since you'd need to 
look up the right snapshot ids for each image by looking at its existing 
objects. If you don't mind losing the snapshots, you can just zero out 
the fields after image_size. Extra zero bytes shouldn't matter after 
snap_names_len is 0.

> Besides one file, where I "created" a header and putted it via "rados
> put" back into the pool, and got some files
> back, many of the other images with lost headers have different sizes.

If you don't know the correct size, setting it too high won't use any 
more space unless the fs using it is expanded.

> We got bad luck again, too many crashed VM's, too much data-loss...
>
> Comments welcome ;)
>
> Oliver.

      parent reply	other threads:[~2012-03-14 20:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-14 15:05 q. about rbd-header Oliver Francke
2012-03-14 20:49 ` Oliver Francke
2012-03-14 21:22   ` Sage Weil
2012-03-14 21:59   ` Josh Durgin
2012-03-15 10:21     ` Oliver Francke
2012-03-14 20:54 ` Josh Durgin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F61057B.30808@dreamhost.com \
    --to=josh.durgin@dreamhost.com \
    --cc=Oliver.Francke@filoo.de \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.