The input values are stored as-is, and any values read are dumped in
hex. Rename listomap to listomapkeys to distinguish from
listomapvalues. Also add it to the man page.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
No features exist right now, so there are no extra options for them.
The old format is still used by default, and since the default will
change with layering, --new-format will be removed at that point and is
intentionally left undocumented.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This will fail if features are requested that the client or server
does not support. Currently there are no features defined, so
zero is the only valid value.
copy() preserves the format and features of the source image.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
The value must be passed, and it shouldn't be below 4k
(enforced by the command line tool already) or above the
range expressible in the header.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Instead of interpreting the header, just copy all the data and
omap values from the original header to the newly name one.
This will continue working with future header changes.
We can create the new header and write all data and omap values
to it atomically to avoid some races.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Use the old or new methods make resize, snapshot add and snapsnhot
remove work with both old and new formats.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Make most of them take the parameters they actually use.
trim_image() now takes an ImageCtx, which means remove() must
open the image. This has the nice side effect of not duplicating
the snapshot listing code for the old format.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Checking that it exists doesn't prevent you from having the snapshot
change out from under you in the following situation:
You have the image open at snapshot "foo".
Someone removes snapshot "foo", writes some data to the image, and
creates a new snapshot called "foo".
This second snapshot will have a different id, but nothing prevents it
from having the name of a previously deleted snapshot.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
It now sets the member variables of ImageCtx so other functions
don't have to use the on-disk header. If the features use by
the new format are incompatible with this client, an error is returned.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Detect the format when an image is opened by the presence of the
original format header object. Use member variables of ImageCtx to
store image metadata instead of the on-disk header format
ImageCtx::header.
This lays the foundation for changing the rest of librbd to work with
old and new formats.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Add the client side (cls_rbd_client) for testing as well.
librbd will use the functions in cls_rbd_client to interact with cls_rbd.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
These will be useful in the new rbd header format. This brings the
API into parity with the available OSD ops for omaps.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
The osd ops and the librados methods all distinguish between keys
and values. It's useful to be able to read a bunch of keys without
fetching the values sometimes too.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Add a logging level parameter to CLS_LOG, and a CLS_ERR that's
analagous to derr.
For now cls_rgw is all logging at level 1, preserving existing
behavior. I'm more familiar with cls_rbd, so I changed those
logging levels.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This is dangerous, make sure they know what they're doing. I bet <someone>
$1 that Greg asked me to do this originally.
Signed-off-by: Sage Weil <sage@inktank.com>
Lines like
tunable <name> <value>
will adjust tunables. Right now only three are defined.
--enable-unsafe-tunables is required.
Signed-off-by: Sage Weil <sage@inktank.com>
We have three magic numbers in crush_choose that are now tunable. The
first two control the local retry behavior, including fallback to a
permutation. The last is the total map descent attempts.
We can avoid a drastic incompatibility by making these tunable and encoded
in the map. That means users can enable/disable local retry, for example,
without changing the code. As long as the clients understand the tunables,
they can be adjusted.
This patch doesn't address the compatibility and feature bit issue. We may
want to roll that into a larger revision with more drastic changes, once
we know what those changes will look like. However, a careful user can
use the new code and modify the behavior.
Signed-off-by: Sage Weil <sage@inktank.com>
This will help us figure out *why* nodes are in the prior set.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>