Sage Weil [Tue, 13 Aug 2013 23:12:08 +0000 (16:12 -0700)]
types: pretty_si_t
Similar to si_t, but leaves a space between the numbers and the units. In
the degenerate case (no M, K, etc. modifier) there's simply a trailing
space. For example,
Laurent Barbe [Tue, 13 Aug 2013 15:16:35 +0000 (17:16 +0200)]
init-rbdmap: fix for recursive umount
Umount is not always done in the correct order.
For exemple in that case :
/dev/rbd1 on /myrbd
/dev/rbd2 on /myrbd/.snapshots/@GMT-2013.08.09-10.14.44
rbd2 should be umounted before rbd1
Gary Lowell [Tue, 6 Aug 2013 00:57:26 +0000 (17:57 -0700)]
Makefile.am: fix libglobal.la races
Several targets had libglobal.la in the _LDFLAGS macro definition
when it should have been in the _LDADD macro. Remove those occurrance
and add the LIBGLOBAL_LDA macro to the targets _LDADD instead.
common: pick_addresses: fix bug with observer class that triggered #5205
The Observer class we defined to observe conf changes and thus avoid
triggering #5205 (as fixed by eb86eebe1ba42f04b46f7c3e3419b83eb6fe7f9a),
was returning always the same const static array, which would lead us to
always populate the observer's list with an observer for 'public_addr'.
This would of course become a problem when trying to obtain the observer
for 'cluster_add' during md_config_t::set_val() -- thus triggering the
same assert as initially reported on #5205.
Backport: cuttlefish Fixes: #5205 Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com> Reviewed-by: Sage Weil <sage@inktank.com>
Yehuda Sadeh [Fri, 9 Aug 2013 18:52:25 +0000 (11:52 -0700)]
rgw: return 423 Locked response when failing to lock object
Fixes: #5882
Translate the EBUSY we get when trying to lock a shard / object
to 423 Locked response. Beforehand it was just translated to the
default 500.
Reviewed-by: Sage Weil <sage@inktank.com> Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Yehuda Sadeh [Fri, 9 Aug 2013 16:31:28 +0000 (09:31 -0700)]
rgw: rename data receive callbacks in swift token revocation
Fixes: #5921
As part of the work that was made for dumpling, the http
client in-data callback was renamed in order to avoid confusion.
However, we missed the rename in a couple of places, which this
patch amend.
Reported-by: Roald van Loon <roaldvanloon@gmail.com> Reviewed-by: Sage Weil <sage@inktank.com> Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Dan Mick [Tue, 6 Aug 2013 01:18:59 +0000 (18:18 -0700)]
ceph.in: Re-enable ceph interactive mode (missing its output).
Also, loop on error. There's no reason to exit the interpreter loop on
an error, and it's probably less annoying if we don't. Print the error,
and any output, and continue.
Fixes: #5746 Signed-off-by: Dan Mick <dan.mick@inktank.com>
Sage Weil [Thu, 8 Aug 2013 15:30:01 +0000 (08:30 -0700)]
mon: fix 'osd crush rule rm ...' dup arg
This was broken way back in 0d66c9ebbf626117c641c975a8682a0aaba588c4, but
we were ignoring the dup until recently.
t Signed-off-by: Sage Weil <sage@inktank.com>
If an entity already existed, 'auth add' would smash its key and caps
with whatever was on the supplied keyring file; if a keyring weren't
specified, we would simply generate a new key and destroy all existing
caps (unless caps were specified and happened to be different from the
already in-place caps). This behaviour is obviously sketchy.
With this patch we now enforce the following behaviour:
- if entity does not exist in current state, check if we are about to
create it (by checking the pending state); if so, wait for the new state
to be committed and re-handle the command then, so we don't get bad
results from pending request
- if the command reproduces the current state (same key, same caps), we
return 0; else,
- if entity exists and supplied key OR caps are different, return -EINVAL
- else create a new entity.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Dan Mick [Sat, 3 Aug 2013 04:26:51 +0000 (21:26 -0700)]
mon/PGMonitor: add 'pg dump pgs_brief' subcommand
It is useful to map OSDs to PGs and vice-versa; pg dump gives that
information, but gives a lot of other stuff. This is the same dump
as pg dump pgs, but omitting everything except pgid, state, and
osd up and acting sets.
Signed-off-by: Dan Mick <dan.mick@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Dan Mick [Sat, 3 Aug 2013 03:46:00 +0000 (20:46 -0700)]
ceph_argparse.py: add stderr note if nonrequired param is invalid
If we run across a user-supplied parameter that doesn't validate against
a non-required descriptor, it may be that it's a valid entry for a later
descriptor...or it may be that it's supposed to match. We can't really tell.
A possible heuristic would be to call it invalid-for-sure if we're at the
end of the descriptor list, but that's not very generic.
Warn about it and try to drive on anyway.
Signed-off-by: Dan Mick <dan.mick@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Dan Mick [Fri, 2 Aug 2013 05:35:08 +0000 (22:35 -0700)]
Fix "too few args validate"
Check that number of validated arguments matches the number of required
arguments in the signature. Also, sort all possible matches by
length of signature. This way "ceph osd crush set" and
"ceph osd crush set <args>" can work while still insisting that
extra args or too few args are errors.
Also, restructure and factor out some of the work of validate() to make
its inner loop smaller and hopefully more comprehensible.
Signed-off-by: Dan Mick <dan.mick@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
commit 0071b8e75b (mds: stay in SCAN state in file_eval) makes
Locker::file_eval() ignore lock in LOCK_SCAN state. If there
is no request changes the lock state, the lock can be stuck in
LOCK_SCAN state forever. This can cause client read/write hang
because lock in LOCK_SCAN state does not allow Frw caps.
The fix is change LOCK_SCAN to a unstable state. Thank to the
CInode::STATE_RECOVERING check in Locker::eval_gather(), the
lock stays in the SCAN state while file is being recovering.
The lock will transit to a stable state once the recovery
finishes.
mds: handle "state == LOCK_LOCK_XLOCK" when cancelling xlock
If we find lock state is LOCK_LOCK_XLOCK when cancelling xlock,
set lock state to LOCK_XLOCK_DONE and call Locker::eval_gather().
This makes sure the lock will eventually transit to a stable state.
(LOCK_XLOCK_DONE's next state is stable)
mds: remove "type != CEPH_LOCK_DN" check in Locker::cancel_locking()
For acquiring/cancelling xlock, the lock state transitions for
dentry lock and other types of locks are the same. So I think
the "type != CEPH_LOCK_DN" check doesn't make sense.
If lock state is LOCK_XLOCKDONE, the xlocker can have GSHARED cap.
So when finishing xlock, we may need to revoke the GSHARED cap.
In most cases Locker::_finish_xlock() directly set lock state to
LOCK_LOCK or LOCK_EXCL, which hides the issue. If 'num_rdlock > 0'
or 'num_wrlock > 0' when finishing xlock, the issue reveals.
(lock get stuck in LOCK_XLOCKDONE forever)
The fix is always call Locker::_finish_xlock() when xlock count
reaches zero. _finish_xlock() checks if it can change lock state
to LOCK_EXCL immediately. If not, it uses Locker::eval_gather()
to transit lock state.
Another change of this patch is avoid changing lock state to
LOCK_LOCK directly. because lock in LOCK_XLOCK_DONE state allows
GSHARED cap, lock in LOCK_LOCK state does not.
There are several issues in the Capability::confirm_receipt()
1. when receiving a client caps message with 'seq == last_sent',
it doesn't mean we finish revoking caps. The client can send
caps message that only flushes dirty metadata.
2. When receiving a client caps message with 'seq == N', we should
forget pending revocations whose seq numbers are less than N.
This is because, when revoking caps, we create a revoke_info
structure and set its seq number to 'last_sent', then increase
the 'last_sent'.
3. When client actively releases caps (by request), the code only
works for the 'seq == last_sent' case. If there are pending
revocations, we should update them as if the release message
is received before we revoke the corresponding caps.