From: Josh Durgin <josh.durgin@inktank.com>
To: ceph-devel <ceph-devel@vger.kernel.org>
Subject: Re: RBD format changes and layering
Date: Fri, 25 May 2012 16:07:37 -0700 [thread overview]
Message-ID: <4FC010B9.3030101@inktank.com> (raw)
In-Reply-To: <4FBEBECD.6040403@inktank.com>
On 05/24/2012 04:05 PM, Josh Durgin wrote:
> 1) making sure parent images are not deleted when children still
> refer to them
Yehuda and Tv and I talked about this more, and came up with a simpler
design that doesn't require the security changes or writing anything
to the parent.
Each image (and snapshot) has a 'preserved' flag that means it is
read-only and cannot be deleted without explicitly declaring it
deletable. Something like:
$ rbd preserve pool/image
$ rbd rm pool/image
Error: image is preserved. If you really know what you're doing,
unpreserve it.
$ rbd unpreserve pool/image
$ rbd rm pool/image
Images or snapshots that don't have the preserved flag set can't be
cloned. Images or snapshots that do have it set can't be deleted until
it is unset.
To answer the question 'does this image have children', we can have an
object in the child's pool that maintains info about which children
exist in that pool (rbd_clones). This could be an omap with keys of
(parent pool id, parent image id, parent snap name, child image id,
child snap name) and empty values, or keys with the parent info and
values consisting of lists of child info.
To check whether children exist, you can iterate over
all the pools and check the rbd_clones object in each one.
Since the number of pools is relatively small, this isn't
very expensive. If the pool is deleted, by definition all the children
in it are deleted.
With separate namespaces in the future, this will be a bit more
expensive, but it's only needed at base image deletion time,
which is relatively rare. Deleting the image itself already
requires an I/O per object, so this is probably not the slow
part anyway.
Yehuda, Tv, did I miss anything?
Josh
next prev parent reply other threads:[~2012-05-25 23:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-24 23:05 RBD format changes and layering Josh Durgin
2012-05-24 23:39 ` Yehuda Sadeh
2012-05-25 17:33 ` Josh Durgin
2012-05-25 14:57 ` Alex Elder
2012-05-25 20:21 ` Josh Durgin
2012-05-25 22:26 ` Sage Weil
2012-05-26 1:43 ` Josh Durgin
2012-05-25 20:55 ` Greg Farnum
2012-05-25 21:25 ` Josh Durgin
2012-05-25 23:07 ` Josh Durgin [this message]
2012-05-29 22:08 ` Tommi Virtanen
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=4FC010B9.3030101@inktank.com \
--to=josh.durgin@inktank.com \
--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.