Commit Graph

21426 Commits

Author SHA1 Message Date
Josh Durgin
582001eb49 rbd: add --format option
This chooses whether to use the original (supported by krbd)
or the new (supports layering) format.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-18 15:19:07 -07:00
Josh Durgin
a1124193c2 librbd: prevent racing clone and snap unprotect
If the following sequence of events occured,
a clone could be created of an unprotected snapshot:

1. A: begin clone - check that snap foo is protected
2. B: rbd unprotect snap foo
3. B: check that all pools have no clones of foo
4. B: unprotect snap foo
5. A: finish creating clone of foo, add it as a child

To stop this from happening, check at the beginning and end of
cloning that the parent snapshot is protected. If it is not,
or checking protection status fails (possibly because the parent
snapshot was removed), remove the clone and return an error.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-18 15:18:59 -07:00
Dan Mick
e85a238303 rbd: add "children" command, update cli test files
Fixes: #2720
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-18 15:18:50 -07:00
Dan Mick
bd9405844b librbd: add {rbd_}list_children() methods
These iterate over all pools and check for children of a
particular snapshot.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
2012-09-18 15:18:27 -07:00
Sage Weil
f6b2f79c39 mon: make heartbeat grace and down out interval scaling optional
Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:39:01 -07:00
Sage Weil
be5039155e mon: add tunable to control laggy probability weighting. simplify decoding.
Default to .3. Setting to 0 effectively turns this off.

Also make OSDMap::osd_xinfo_t decode into a float to simplify the
arithmetic conversions.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:39:01 -07:00
Sage Weil
5499778f8d mon: apply grace period scaling to mon_osd_down_out_interval
Scale the down/out interval the same way we do the heartbeat grace, so that
we give laggy osds a bit longer to recovery.

See #3047.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:39:01 -07:00
Sage Weil
2ad62d5256 mon: decay laggy calculations over time
Add a configurable halflife for the laggy probability and duration and
apply it at the time those values are used to adjust the heartbeat grace
period.  Both are multiplied together, so it doesn't matter which you
think is being decayed (the probability or the interval).

Default to an hour.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:39:01 -07:00
Sage Weil
abd2ae7423 mon: factor reporter lagginess into grace adjustment
Use reporters as a proxy for laggy subclusters within the overall cluster.
See #3046.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:39:00 -07:00
Sage Weil
adf0fe6a10 mon: scale heartbeat grace based on laggy probability, interval
If, based on historical behavior, an observed osd failure is likely to be
due to unresponsiveness and not the daemon stopping, scale the heartbeat
grace period accordingly:

 grace' = grace + laggy_probabiliy * laggy_interval

This will avoid fruitlessly marking OSDs down and generating additional
map update overhead when the cluster is overloaded and potentially
struggling to keep up with map updates.   See #3045.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:39:00 -07:00
Sage Weil
3f51d31639 mon: check failures in tick
Currently we only trigger a failure on receipt of a failure report.  Move
the checks into a helper and check during tick() too, so that we will
trigger failures even when the thresholds are not met at failure report
time.  This is rarely true now, but will be true once we locally scale the
grace period.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:39:00 -07:00
Sage Weil
09b251cd22 mon: clean up osd failure logging
Debug log when we get a report, info log when we actual fail the osd.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:39:00 -07:00
Sage Weil
a3e8ed1e4e mon: reply to all reporters when an osd is failed
Track the latest report message for each reporter.  When the osd is
eventually marked failed, send map updates to them all.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:39:00 -07:00
Sage Weil
7952c35926 mon: locally apply osd heartbeat grace to failure checks
Aggregate the failure reports into a single mon 'failed_since' value (the
max, currently), and wait until we have exceeded the grace period to
consider the osd failed.

WARNING: This slightly changes the semantics.  Previously, the grace could
be adjusted in the [osd] section.  Now, the [osd] option controls when the
failure messages are sent, and the [mon] option controls when it is marked
down, and sane users should set it once in [global].

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:39:00 -07:00
Sage Weil
3eb7341aab mon: no_reply() to failure messages we don't reply to
This makes use clean up request state when requests have been forwarded.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:39:00 -07:00
Sage Weil
d328a28cc6 mon: send 'null' reply to requests we won't reply to
This is a no-op if the client was talking to us, but in the forwarded
request case will clean up the request state (and request message) on the
forwarding monitor.  Otherwise, MOSDFailure messages (and probably others)
can accumulate on the non-leader mon indefinitely.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:39:00 -07:00
Sage Weil
e06818be04 mon: refactor osd failure report tracking
- use structs to track allegedly failed nodes, and reports against them.
- use methods to handle report, and failure threshold logic.
- calculate failed_since based on OSD's reported failed_for duration

This will make it simpler to extend the logic when we add dynamic
grace periods.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:38:59 -07:00
Sage Weil
66f31c1091 mon: adjust or decay laggy probabilities on osd boot
On each osd boot, determine whether the osd was laggy (wrongly marked down)
or newly booted.  Either update the laggy probability and interval or
decay the values, as appropriate.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:38:59 -07:00
Sage Weil
e9f051ef3c osdmap: include osd_xinfo_t to track laggy probabilities, timestamps
Track information about laggy probabilities for each OSD.  That is, the
probability that if it is marked down it is because it is laggy, and
the expected interval over which it will take to recovery if it is laggy.

We store this in the OSDMap because it is not convenient to keep it
elsewhere in the monitor.  Yet.  When the new mon infrastructure is in
place, there is a bunch of stuff that can be moved out of the OSDMap
'extended' section into other mon data structures.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:38:59 -07:00
Sage Weil
b64641c3dd osd: include boot_epoch in MOSDBoot
This will let the monitor infer whether we were wrongly marked down or
the daemon restarted.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:38:59 -07:00
Sage Weil
4f1792d769 osd: include failed_for in MOSDFailure reports
The monitor will need this to dynamically adjust the heartbeat grace.

Closes: #3044
Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-18 14:38:59 -07:00
Samuel Just
6f5c4a913d PG: need pg lock to read osdmap_ref
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-09-18 14:30:22 -07:00
Samuel Just
59f85874b9 OSD: in enqueue_op, cannot read *pg since we don't hold the pg lock
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-09-18 14:27:13 -07:00
Samuel Just
78a322b224 OSD: remove some commented out pg->unlock calls
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-09-18 14:26:37 -07:00
John Wilkins
f418172e80 Merge branch 'master' of https://github.com/ceph/ceph 2012-09-18 14:17:19 -07:00
John Wilkins
ed18eea47d :doc: Changed rados.gateway to radosgw.gateway. Start with /etc/init.d.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-18 14:16:44 -07:00
Sage Weil
900e4ceb83 workqueue: allow thread pool size to be adjusted dynamically
Allow thread pool sizes to be adjusted on the fly by telling the
ThreadPool which config option to monitor.  Add some basic unit tests
for resizing.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
2012-09-18 14:16:22 -07:00
John Wilkins
5e095ec889 :doc: Trimmed up the stack diagram and fixed a few hyperlink refs.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-18 13:55:18 -07:00
John Wilkins
53508306b3 :doc: Modified hostname to hostname -s.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-18 13:44:16 -07:00
John Wilkins
7c178be1a6 :doc: Modified hostname to hostname -s.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-18 13:43:47 -07:00
John Wilkins
5936ded85a :doc: Modified hostname to hostname -s.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-18 13:43:25 -07:00
Yehuda Sadeh
9b628efee1 Merge branch 'wip-3127'
Conflicts:
	src/rgw/rgw_rados.cc

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-09-18 13:24:52 -07:00
Yehuda Sadeh
fa93ea117e rgw: fix unused warning message
Remove unused variable.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-09-18 13:20:06 -07:00
Yehuda Sadeh
496c5d458e rgw: fix uninitialized var in error message
Used the wrong variable in error message.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-09-18 13:13:48 -07:00
Yehuda Sadeh
6bc1ef0aa2 rgw, cls_rgw: a tool to rebuild bucket stats
radosgw-admin bucket check [--fix] --bucket=<bucket>

The command will dump the existing bucket header stats,
and the calculated bucket header stats. If --fix is provided
the bucket stats will be overwritten by the recalculated
stats.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-09-18 13:08:56 -07:00
John Wilkins
11b80ae78b :doc: Changed title to RBD from RADOS. Clearer.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-18 13:02:17 -07:00
John Wilkins
9829039eb9 :doc: Made notice to stop i/o a warning. Initial format clean up.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-18 13:01:50 -07:00
John Wilkins
84c50dd8de :doc: Added discussion and stack diagram. Initial format cleanup.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-18 13:00:58 -07:00
John Wilkins
171fcd8133 :doc: Remove legacy usage. Initial format cleanup.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-18 13:00:07 -07:00
Yehuda Sadeh
08e9fc02fe rgw: obj_stat() returns object version (epoch), use it
We now pass the object version returned by obj_stat. We use that
epoch for setting the object version through the index suggestion
mechanism. This was broken by a recent change that switched from
reading the obj stats by (wrongly) calling directly to ioctx->stat()
to calling get_obj_state().

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-09-18 12:57:05 -07:00
Yehuda Sadeh
15e97d7307 cls_rgw: complete_op() only skip update if epoch is non zero
An update shouldn't be skipped if epoch is zero. We'd see a zero
epoch if we tried to read an object and it didn't exist. That
could happen e.g., when a delete object operation failed to
call the complete earlier, and now we're recalling delete on
the (now non-existent object).
However, note that the zero epoch is racy. We may end up racing
with an object creation. This will be taken care of by a new
rados change that will set the returned object version even if
it didn't exist.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-09-18 12:57:05 -07:00
Yehuda Sadeh
316722848c cls_rgw: update index stats based on correct category
only refer to the on-disk category if the object existed.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-09-18 12:57:05 -07:00
Yehuda Sadeh
0f82a3931a rgw: fix suggested object size
We can't just stat the head object, we need to go through
get_obj_state() to get obj attributes.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-09-18 12:57:05 -07:00
Yehuda Sadeh
6a054ea9d8 rgw: set exists flag when suggesting existing bucket entry
We weren't setting the 'exists' flag on the bucket entry,
so we ended up not updating the index correctly.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-09-18 12:57:05 -07:00
Yehuda Sadeh
b12c1477a3 cls_rgw: change scoping of suggested changes vars
Fixes: #3127
Bad variable scoping made it so that specific variables
weren't initialized between suggested changes iterations.
This specifically affected a case where in a specific
change we had an updated followed by a remove, and the
remove was on a non-existent key (e.g., was already
removed earlier). We ended up re-substracting the
object stats, as the entry wasn't reset between
the iterations (and we didn't read it because the
key didn't exist).

backport:argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-09-18 12:57:05 -07:00
Yehuda Sadeh
c11e05f532 test/rgw: add a test for index suggest
test the bucket index suggest api

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-09-18 12:57:02 -07:00
John Wilkins
5b7e60d0d8 Merge branch 'master' of https://github.com/ceph/ceph 2012-09-18 12:55:35 -07:00
Yehuda Sadeh
12175386d9 cls_rgw: configurable tag timeout
we'll be using that for bucket index unitest

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-09-18 12:55:33 -07:00
Yehuda Sadeh
64b9a898b6 test/rgw: add bucket index unitest
Tests objects creation, removal, prepare, complete

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-09-18 12:50:07 -07:00
Gary Lowell
519ed2471c cpeh.spec.in: Don't package boto_tool. 2012-09-18 12:43:36 -07:00