Commit Graph

19864 Commits

Author SHA1 Message Date
Josh Durgin
a5026303f4 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.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-09 17:24:50 -07:00
Josh Durgin
123250b49d test_librbd, test_rbd.py: optionally use the new format
Read the desired features from an environment variable, RBD_FEATURES.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-09 17:24:50 -07:00
Josh Durgin
074ffc5940 rbd.py: add support for creating images in the new format
The new arguments are optional, so they are backwards compatible.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-09 17:24:50 -07:00
Josh Durgin
857bbccc59 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.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-09 17:24:50 -07:00
Josh Durgin
5b40b4b94c 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.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-09 17:24:50 -07:00
Josh Durgin
bfbed50886 librbd: use ImageCtx members instead of the old header in resize()
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 16:38:23 -07:00
Josh Durgin
5bc34f4a9a librbd: validate order before creating an image
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>
2012-06-08 16:38:22 -07:00
Josh Durgin
127b425901 librbd: rename md_oid parameters to header_oid
This is more consistent with the rest of the code now,
and is a bit more clear.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 16:38:22 -07:00
Josh Durgin
ef38394f21 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.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 16:38:22 -07:00
Josh Durgin
f1d69639c5 librbd: use cls_client functions for calling class methods
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>
2012-06-08 16:38:22 -07:00
Josh Durgin
8e51e06094 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.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 16:38:22 -07:00
Josh Durgin
00f4e84153 librbd: check that the current snapid for a snap name matches
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>
2012-06-08 16:38:22 -07:00
Josh Durgin
4eb2138e63 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.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 16:38:22 -07:00
Josh Durgin
7376a77364 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.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 16:38:22 -07:00
Josh Durgin
dcc7c96339 cls_rbd: add methods for interacting with the new header format
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>
2012-06-08 16:38:19 -07:00
Josh Durgin
70686c599b librbd: remove useless ENOMEM checks
There will be an exception if memory can't be allocated.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 14:31:49 -07:00
Josh Durgin
13aa578d63 DBObjectMap: remove extra semicolon
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 14:31:49 -07:00
Josh Durgin
8c637f56e5 vstart: debug osd classes when debugging is on
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 14:31:49 -07:00
Josh Durgin
49059b232b objclass: add methods to get keys without values, and set multiple values
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>
2012-06-08 14:31:49 -07:00
Josh Durgin
23ebc093a6 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.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 14:31:49 -07:00
Josh Durgin
715c1f1394 objclass: allow classes to log at different levels
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>
2012-06-08 14:31:49 -07:00
Josh Durgin
fe46a74954 class_debug: add indent settings header
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 14:31:49 -07:00
Josh Durgin
5750e53e36 test_librbd: don't include a .cc file
Add it as a source like the rest of the gtests.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 14:31:49 -07:00
Josh Durgin
ba56d81273 cls_rgw: add indent settings header
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 14:31:49 -07:00
Josh Durgin
e0fda59d7b objclass: pass strings as const references
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 14:31:49 -07:00
Josh Durgin
60c684a4d3 objclass: add indent settings header
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 14:31:49 -07:00
Josh Durgin
fefedc1bb1 cls_rbd: add indent settings header
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 14:31:48 -07:00
Josh Durgin
92325d0f84 cls_rbd: remove unused test_exec and snap_revert methods
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-06-08 14:31:48 -07:00
Sage Weil
b2793c426e mon: require force argument for 'mds newfs ...'
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>
2012-06-08 12:48:02 -07:00
Sage Weil
3876dbfdd7 Merge branch 'wip-crush-tunables'
Reviewed-by: Sam Just <sam.just@inktank.com>
2012-06-08 11:18:59 -07:00
Sage Weil
c0a02a4a49 crushtool: refine tunables warning message
Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-08 11:17:14 -07:00
Sage Weil
978d5419a1 re-include assert after boost::pool
Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-08 11:02:44 -07:00
Sage Weil
740aa3dfbd crush: compile/decompile tunables
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>
2012-06-08 10:58:12 -07:00
Sage Weil
1a2959edd6 crushtool: add --enable-unsafe-tunables option
This is required to adjust tunables.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-08 10:58:12 -07:00
Sage Weil
cfbe34d518 crushtool: --show-* instead of --output-*
Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-08 10:58:12 -07:00
Sage Weil
eaad984545 CrushTester: clean up output interface
Multiple accessors.  Init in ctor.  Avoid temp vars in crushtool.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-08 10:58:12 -07:00
Sage Weil
dba70eedbe CrushTester: dump histogram of choose attempts
Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-08 10:58:12 -07:00
Sage Weil
c04de2b34d crush: generate histogram of choose tries
Optionally populate a histogram of choose descent attempts.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-08 10:58:12 -07:00
Sage Weil
4abb53d4f3 crush: fix leaf recursion if we already collided
This just saves us some cycles, but does not effect placement results at
all.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-08 10:58:11 -07:00
Sage Weil
487371149b CrushTester: optionally output bad mappings
Optionally dump bad inputs to stdout.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-08 10:58:11 -07:00
Sage Weil
c4336a3a2e crushtool: arguments to adjust tunables
Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-08 10:58:11 -07:00
Sage Weil
8b79697489 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.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-07 15:57:09 -07:00
Sage Weil
7332e9c717 mon: use mode 0600 throughout
Fixes: #2526
Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-07 13:57:10 -07:00
Sage Weil
8093997761 Merge remote-tracking branch 'gh/mon-auth'
Reviewed-by: Greg Farnum <greg@inktank.com>
2012-06-07 12:22:47 -07:00
John Wilkins
07169d2e43 doc: Added mount cephfs with fstab.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-06-07 11:35:37 -07:00
Sage Weil
7d1b32a091 osd: include past_intervals in pg query results
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>
2012-06-07 11:21:52 -07:00
Samuel Just
36a3979590 OSD: _have_pg should return NULL if pg is not in map
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-06-07 11:21:49 -07:00
Sage Weil
ff470104d1 Merge remote-tracking branch 'gh/wip-assert2'
"So be it"

Reviewed-by: Sam Just <sam.just@dreamhost.com>
2012-06-07 11:21:39 -07:00
Sage Weil
fae1d47aae deliberately break encoding macros when wrong assert is present
Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-07 10:19:09 -07:00
Sage Weil
3571f43c00 misc assert #include cleanup, hackery
Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-07 10:18:56 -07:00