Tommi Virtanen [Mon, 11 Jun 2012 22:27:02 +0000 (15:27 -0700)]
upstart: Read crush location and weight from ceph.conf.
This introduces two new config variables, osd_crush_location
and osd_crush_weight. Not currently included in config_opts.h,
as these are not used in the C++ code.
Yehuda Sadeh [Mon, 11 Jun 2012 17:14:43 +0000 (10:14 -0700)]
rgw: new config options
New config options for usage logging:
- rgw_enable_usage_log: enable usage logging
- rgw_usage_log_flush_threshold - limit on number of pending updates
before synchronously flushing update
- rgw_usage_log_tick_interval - asynchronous flush interval
- rgw_usage_max_shards - split info across that many objects
- rgw_usage_max_user_shards - split single user info across that many
objects
Yehuda Sadeh [Mon, 11 Jun 2012 17:11:17 +0000 (10:11 -0700)]
rgw: new class methods for handling usage information
The new methods are:
- user_usage_log_add: add new usage information
- user_usage_log_read: get usage information
- user_usage_log_trim: remove usage information
Josh Durgin [Mon, 11 Jun 2012 06:21:58 +0000 (23:21 -0700)]
cls_rbd: add get_all_features method
This is useful for reporting which features an osd supports, and for
testing rados_exec. Update the rados api tests to use this method
instead of test_exec, which was removed.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Josh Durgin [Sun, 10 Jun 2012 00:16:45 +0000 (17:16 -0700)]
librbd: ignore RBD_MAX_BLOCK_NAME_SIZE when generating object ids
The actual data object ids don't need to be artificially restricted in
length. RBD_MAX_BLOCK_NAME_SIZE just limits the size of the object
prefix, since it's used in rbd_info_t.
Josh Durgin [Fri, 8 Jun 2012 15:40:27 +0000 (08:40 -0700)]
rados: add commands to interact with object maps
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.
Josh Durgin [Fri, 8 Jun 2012 15:07:40 +0000 (08:07 -0700)]
rbd: update for the new format
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.
Josh Durgin [Fri, 8 Jun 2012 14:43:32 +0000 (07:43 -0700)]
librbd: add create2 to create an image with the new format
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.
Sage Weil [Sat, 9 Jun 2012 05:29:02 +0000 (22:29 -0700)]
crushtool: drop useless clitest
This is an ancient test for an old 'bug' in functionality we're removing.
Also, it is sensitive to tester output, which will be changing a lot in
the coming weeks/months.
Sage Weil [Sat, 9 Jun 2012 03:39:41 +0000 (20:39 -0700)]
CrushTester: simplify, clean up mark down
- put it in a separate function
- operate on temporary weight vector, not user-modified input
- guard the whole thing with an #ifdef
- permute candidates and use first N, to ensure we end up picking the right
number of buckets/items.
Josh Durgin [Fri, 8 Jun 2012 14:53:07 +0000 (07:53 -0700)]
librbd: make rename work with any header format
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.
Josh Durgin [Fri, 8 Jun 2012 07:05:41 +0000 (00:05 -0700)]
librbd: remove on-disk header argument from helper functions
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.
Josh Durgin [Fri, 8 Jun 2012 15:01:19 +0000 (08:01 -0700)]
librbd: update ictx_refresh to work with both formats
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.
Josh Durgin [Fri, 8 Jun 2012 06:14:17 +0000 (23:14 -0700)]
librbd: Update ImageCtx for new format
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.
Josh Durgin [Sun, 3 Jun 2012 10:41:02 +0000 (03:41 -0700)]
objclass: rename omap methods to be consistent with other interfaces
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.
Sage Weil [Thu, 7 Jun 2012 22:57:09 +0000 (15:57 -0700)]
crush: make magic numbers tunable
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.
Sage Weil [Wed, 6 Jun 2012 23:06:28 +0000 (16:06 -0700)]
assert: detect when /usr/include/assert.h clobbers us
The normal assert.h is very rude in that it clobbers any existing assert
define and replaces it with its own. An sadly, lots of things we include
include the generic version.
Be extra rude in response. Clobber any existing assert #define, and also
#define _ASSERT_H to be a magic value that our commonly-used dendl #define
depends on. This way we get a compile error if the system version replaces
out own.
This is imperfect, since we will only detect their rudeness when we use
the debug macros. I'm not coming up with something that is more widely
used that would work better, however.