]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
11 years agoceph_argparse.py: add stderr note if nonrequired param is invalid
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>
11 years agoFix "too few args validate"
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>
11 years agoqa/workunits/cephtool/test_daemon.sh: we should error on bad command
Sage Weil [Sun, 4 Aug 2013 22:24:49 +0000 (15:24 -0700)]
qa/workunits/cephtool/test_daemon.sh: we should error on bad command

See #5872.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoPG: set !flushed in Reset()
Samuel Just [Fri, 2 Aug 2013 18:58:52 +0000 (11:58 -0700)]
PG: set !flushed in Reset()

Otherwise, we might serve a pull before we start_flush in the
ReplicaActive constructor.

Fixes: #5799
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge branch 'wip-5831' into next
Yehuda Sadeh [Fri, 2 Aug 2013 01:27:34 +0000 (18:27 -0700)]
Merge branch 'wip-5831' into next

11 years agoMerge branch 'wip-5810' into next
Yehuda Sadeh [Fri, 2 Aug 2013 01:27:20 +0000 (18:27 -0700)]
Merge branch 'wip-5810' into next

11 years agorgw: only fetch cors info when needed
Yehuda Sadeh [Thu, 1 Aug 2013 20:20:19 +0000 (13:20 -0700)]
rgw: only fetch cors info when needed

Fixes: #5831
This commit moves around the cors handling code. Beforehand
we were unnecessarily reading the cors headers for every
request whether that was needed or not. Moved that code to
be only called when needed. While at it, cleaned up the
layering a bit so that not to mix S3 specific code with
the generic functionality (except for debugging).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agorgw: don't read cors attrs if there's no bucket in operation
Yehuda Sadeh [Wed, 31 Jul 2013 00:34:49 +0000 (17:34 -0700)]
rgw: don't read cors attrs if there's no bucket in operation

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agorgw: rename sync-type to update-type
Yehuda Sadeh [Wed, 31 Jul 2013 19:24:36 +0000 (12:24 -0700)]
rgw: rename sync-type to update-type

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agorgw: only check version if meta object exists
Yehuda Sadeh [Wed, 31 Jul 2013 19:23:17 +0000 (12:23 -0700)]
rgw: only check version if meta object exists

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoMerge pull request #478 from dalgaaf/wip-da-spec-req
Gary Lowell [Thu, 1 Aug 2013 18:11:44 +0000 (11:11 -0700)]
Merge pull request #478 from dalgaaf/wip-da-spec-req

Fix BuildRequires in SPEC file
Reviewed-by: Gary Lowell <gary.lowell@inktank.com>
11 years agoceph.spec.in: merge back JUnit handling from SUSE spec 478/head
Danny Al-Gaaf [Thu, 1 Aug 2013 13:01:22 +0000 (15:01 +0200)]
ceph.spec.in: merge back JUnit handling from SUSE spec

Merge back what we have in the (open)SUSE ceph spec file for JUnit.
Add missing Requires and the package is named junit4 on some SUSE
versions.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoceph.spec.in: move junit BuildRequires to the cephfs-java subpackage
Danny Al-Gaaf [Thu, 1 Aug 2013 11:37:48 +0000 (13:37 +0200)]
ceph.spec.in: move junit BuildRequires to the cephfs-java subpackage

JUnit is only needed by cephfs-java. Move the BuildRequires to this
subpackage.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoceph.spec.in: use snappy-devel only on RHEL derivatives
Danny Al-Gaaf [Thu, 1 Aug 2013 11:34:11 +0000 (13:34 +0200)]
ceph.spec.in: use snappy-devel only on RHEL derivatives

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoceph.spec.in: add missing buildrequires for Fedora
Erik Logtenberg [Thu, 1 Aug 2013 11:29:45 +0000 (13:29 +0200)]
ceph.spec.in: add missing buildrequires for Fedora

This patch adds two buildrequires to the ceph.spec file, that are needed
to build the rpms under Fedora. Danny Al-Gaaf commented that the
snappy-devel dependency should actually be added to the leveldb-devel
package. I will try to get that fixed too, in the mean time, this patch
does make sure Ceph builds on Fedora.

Signed-off-by: Erik Logtenberg <erik@logtenberg.eu>
11 years agoMerge branch 'wip-5815' into next
Dan Mick [Thu, 1 Aug 2013 06:01:03 +0000 (23:01 -0700)]
Merge branch 'wip-5815' into next

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge branch 'wip-5784' into next
David Zafman [Thu, 1 Aug 2013 04:24:28 +0000 (21:24 -0700)]
Merge branch 'wip-5784' into next

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agomon/MDSMonitor: don't call all EINVALs "unrecognized command"
Dan Mick [Thu, 1 Aug 2013 01:10:04 +0000 (18:10 -0700)]
mon/MDSMonitor: don't call all EINVALs "unrecognized command"

Some of them are valid EINVALs (like mds setmap with the wrong epochnum)

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agorest/test.py: retry mds setmap in case epoch has changed
Dan Mick [Thu, 1 Aug 2013 01:09:20 +0000 (18:09 -0700)]
rest/test.py: retry mds setmap in case epoch has changed

Loop 10 times retrying mds dump/getmap/setmap.

Fixes: #5815
Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agorest/test.py: expect_nofail() to allow examination of reason
Dan Mick [Thu, 1 Aug 2013 01:08:39 +0000 (18:08 -0700)]
rest/test.py: expect_nofail() to allow examination of reason

Also remove unused MyException

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoMerge tag 'v0.67-rc3' into next
Sage Weil [Thu, 1 Aug 2013 01:08:08 +0000 (18:08 -0700)]
Merge tag 'v0.67-rc3' into next

v0.67-rc3

11 years agoVerify that deleting op never in check_latest_map_ops map
David Zafman [Thu, 1 Aug 2013 00:04:09 +0000 (17:04 -0700)]
Verify that deleting op never in check_latest_map_ops map

Signed-off-by: David Zafman <david.zafman@inktank.com>
11 years agoosdc: op left in check_lastest_map_ops
David Zafman [Wed, 31 Jul 2013 18:08:34 +0000 (11:08 -0700)]
osdc: op left in check_lastest_map_ops

Call op_cancel_map_check before cancel_op() in send_linger()

Fixes: #5784
Signed-off-by: David Zafman <david.zafman@inktank.com>
11 years agoqa/workunits/cephtool/test_daemon.sh: sudo
Sage Weil [Wed, 31 Jul 2013 20:46:12 +0000 (13:46 -0700)]
qa/workunits/cephtool/test_daemon.sh: sudo

Fixes: #5814
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosdc: Add asserts that client_lock is held
David Zafman [Wed, 31 Jul 2013 18:10:51 +0000 (11:10 -0700)]
osdc: Add asserts that client_lock is held

Clarify locking by indicating that client_lock is held

Signed-off-by: David Zafman <david.zafman@inktank.com>
11 years agotest: Fix valgrind found "Mismatched free() / delete / delete []"
David Zafman [Wed, 31 Jul 2013 01:41:14 +0000 (18:41 -0700)]
test: Fix valgrind found "Mismatched free() / delete / delete []"

Use delete[] in set_argv() so that valgrind runs clean

Signed-off-by: David Zafman <david.zafman@inktank.com>
11 years agoqa: Add workunit that hangs for manual thrasher testing
David Zafman [Wed, 31 Jul 2013 18:59:55 +0000 (11:59 -0700)]
qa: Add workunit that hangs for manual thrasher testing

Signed-off-by: David Zafman <david.zafman@inktank.com>
11 years agoceph: developer mode: set PATH, too
Sage Weil [Wed, 31 Jul 2013 06:08:58 +0000 (23:08 -0700)]
ceph: developer mode: set PATH, too

Otherwise the call to ceph-conf may fail if it is not installed on the
local machine.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agocephtool/test.sh: add tests for mon daemon command
Sage Weil [Wed, 31 Jul 2013 06:04:41 +0000 (23:04 -0700)]
cephtool/test.sh: add tests for mon daemon command

[Also move into a separatate test script; validate result -sage]

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMake all AdminSocket commands use argparse/cmdmap.
Dan Mick [Wed, 31 Jul 2013 03:53:57 +0000 (20:53 -0700)]
Make all AdminSocket commands use argparse/cmdmap.

Fixes regression in daemon commands with arguments; also resolves
reported bug with existing daemon code for arguments with
embedded spaces.

Fixes: #5503
Fixes: #5800
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agorgw: fix set_buckets_enabled(), set_bucket_owner()
Yehuda Sadeh [Tue, 30 Jul 2013 20:53:53 +0000 (13:53 -0700)]
rgw: fix set_buckets_enabled(), set_bucket_owner()

Fixes: 5808
We cannot call get_bucket_instance_info() at that point,
as the bucket structure wasn't initialized, so we don't
have the bucket instance location information. Just calling
get_bucket_info().

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoObjecter: set c->session to NULL if acting is empty
Samuel Just [Tue, 30 Jul 2013 22:46:22 +0000 (15:46 -0700)]
Objecter: set c->session to NULL if acting is empty

Otherwise, we might leave a session attached to the
CommandOp for an down OSD.  handle_osd_map will then
delete the session for the down OSD.  tick() will then
attempt to follow the invalid pointer to find a
connection over which to send a MPing.

Fixes: #5798
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agov0.67-rc3 v0.67-rc3
Gary Lowell [Tue, 30 Jul 2013 21:37:56 +0000 (14:37 -0700)]
v0.67-rc3

11 years agoMerge remote-tracking branch 'gh/wip-mon' into next
Sage Weil [Tue, 30 Jul 2013 19:40:55 +0000 (12:40 -0700)]
Merge remote-tracking branch 'gh/wip-mon' into next

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
11 years agomon: add missing state name
Sage Weil [Tue, 30 Jul 2013 05:19:39 +0000 (22:19 -0700)]
mon: add missing state name

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agomon: allow others to sync from us across bootstrap calls
Sage Weil [Tue, 30 Jul 2013 00:14:57 +0000 (17:14 -0700)]
mon: allow others to sync from us across bootstrap calls

If someone is syncing from us and there is an election, they currently get
reset and have to restart their sync.  This can lead to situations where
they can never finish, e.g., when the load from them syncing makes us time
out commits and call elections.

There is nothing that changes during bootstrap that would prevent a sync
from proceeding.  The only time we need to stop providing is when we
ourselves decide to sync from someone else; modify that reset call to
reset provider state.  All other resets become requester resets.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agomon: drop useless sync_reset() calls
Sage Weil [Tue, 30 Jul 2013 00:10:09 +0000 (17:10 -0700)]
mon: drop useless sync_reset() calls

These are both right before bootstrap(), which also resets.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agomon/Paxos: be more vocal about calling elections
Sage Weil [Mon, 29 Jul 2013 23:09:06 +0000 (16:09 -0700)]
mon/Paxos: be more vocal about calling elections

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agorgw: keep a region connection map
Yehuda Sadeh [Sat, 27 Jul 2013 01:15:32 +0000 (18:15 -0700)]
rgw: keep a region connection map

Fixes: #5793
Beforehand all remote copies were going to the master region
which was awfully wrong.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agorgw: cors subresource needs to be in canonical auth header
Yehuda Sadeh [Fri, 26 Jul 2013 23:14:31 +0000 (16:14 -0700)]
rgw: cors subresource needs to be in canonical auth header

Fixes: #5789
This was fixed before, however, might have been lost due to
recent refactoring + merge.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agorgw: set bucket attrs are a bucket instance meta operation
Yehuda Sadeh [Sat, 27 Jul 2013 08:12:49 +0000 (01:12 -0700)]
rgw: set bucket attrs are a bucket instance meta operation

Need to do the action through the bucket instance handler
and not through the bucket handler, otherwise it's wrongly
recorded (and wrongly replayed, ouch).

Fixes: #5791
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agorgw: track bucket instance oid
Yehuda Sadeh [Fri, 26 Jul 2013 23:40:34 +0000 (16:40 -0700)]
rgw: track bucket instance oid

We now keep the bucket instance oid in rgw_bucket. The reason
we need it is that the bucket might have been created before
the entrypoint / bucket instance separation.

Fixes: #5790
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agorgw: read / write bucket attributes from bucket instance
Yehuda Sadeh [Fri, 26 Jul 2013 23:35:24 +0000 (16:35 -0700)]
rgw: read / write bucket attributes from bucket instance

and not from bucket entry point.

Fixes: #5770
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agomon/PGMonitor: fix 'pg dump_[pools_]json'
Sage Weil [Mon, 29 Jul 2013 20:13:24 +0000 (13:13 -0700)]
mon/PGMonitor: fix 'pg dump_[pools_]json'

Use the correct type for the dumpcontents arg.  Fixes the dump_pools_json
output and avoids these errors:

2013-07-29 13:09:14.089188 7fa0c5d21700 -1 0x7fa0c5d1e7a8
2013-07-29 13:09:16.306560 7fa0c5d21700 -1 bad boost::get: key dumpcontents is not type std::vector<std::string, std::allocator<std::string> >
2013-07-29 13:09:16.317104 7fa0c5d21700 -1 0x7fa0c5d1e7a8
2013-07-29 13:09:16.317136 7fa0c5d21700 -1 bad boost::get: key dumpcontents is not type std::vector<std::string, std::allocator<std::string> >

Fixes: #5786
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agomon: fix xml element name
Sage Weil [Mon, 29 Jul 2013 20:00:31 +0000 (13:00 -0700)]
mon: fix xml element name

Should be the type, not the name.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agocheck_new_interval must compare old acting with old osdmap
Loic Dachary [Sun, 28 Jul 2013 11:50:43 +0000 (13:50 +0200)]
check_new_interval must compare old acting with old osdmap

When trying to establish if the old acting set is either empty or
smaller than the min_size of the osdmap,
pg_interval_t::check_new_interval compares with the min_size of the
new osdmap. Since the goal is to try to determine if the previous
interval may have been writeable, it should not enter the if when
there were not enough osds in the acting set ( i.e. < min_size ). But
it may enter it anyway if min_size was decremented in the new osdmap.

A complete set of unit tests were added to cover the logic of
check_new_interval. The parameters are prepared to describe a
situation where the function returns false (i.e. no new
interval). Each case is described in a separate bloc that introduces
the minimal changes to demonstrate the intended test case.

Because a number of cases have the same output while implementing a
different logic, the debug output is parsed to differentiate between them.

A test case demonstrating the problem ( check_new_interval must
compare old acting with old osdmap ) is added, with a link to the bug
number for future reference. The problem is fixed. The text of two
debug messages are slightly changed to make the maintenance of the
test that match them easier.

http://tracker.ceph.com/issues/5780 refs #5780

Signed-off-by: Loic Dachary <loic@dachary.org>
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoOSD: suspend tp timeout while taking pg lock in OpWQ
Samuel Just [Mon, 29 Jul 2013 16:36:04 +0000 (09:36 -0700)]
OSD: suspend tp timeout while taking pg lock in OpWQ

If N op_tp threads are configured, and recovery_max_active
is set to a sufficiently large number, all N op_tp threads
might grab a MOSDPGPush op off of the queue for the same PG.
The last thread to get the lock will have waited
N*time_to_handle_push before completing its item and pinging
the heartbeat timeout.  If that time exceeds the timeout
and there are enough ops waiting, each thread subsequently
will end up exceeding the timeout before completeing an
item preventing the OSD from heartbeating indefinitely.

We prevent this by suspending the timeout while we try to
get the PG lock.  Even if we do block for an excessive
period of time attempting to get the lock, hopefully,
the thread holding the lock will cause the threadpool
to time out.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoWorkQueue: fix bracing on reset_tp_timeout
Samuel Just [Mon, 29 Jul 2013 16:29:00 +0000 (09:29 -0700)]
WorkQueue: fix bracing on reset_tp_timeout

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoosd: get initial full map after a map gap
Sage Weil [Sun, 28 Jul 2013 15:59:21 +0000 (08:59 -0700)]
osd: get initial full map after a map gap

If there is a gap in our map history, get the full range of maps that
the mon has.  Make sure the first one is a full map.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoosd: fix off-by-one in map gap logic
Sage Weil [Sun, 28 Jul 2013 15:55:38 +0000 (08:55 -0700)]
osd: fix off-by-one in map gap logic

If we have map 250, and monitor's first is 251, but sends 260, we can
request the intervening range.

Fixes: #5784
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoceph_test_rados: print version banner on startup
Sage Weil [Sun, 28 Jul 2013 22:42:08 +0000 (15:42 -0700)]
ceph_test_rados: print version banner on startup

It is helpful when looking at qa run logs to see what version of the
tester is running.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoceph-authtool: fix cli tests
Sage Weil [Sun, 28 Jul 2013 22:29:49 +0000 (15:29 -0700)]
ceph-authtool: fix cli tests

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agotest/system/*: parse CEPH_ARGS environment
Sage Weil [Sun, 28 Jul 2013 16:04:05 +0000 (09:04 -0700)]
test/system/*: parse CEPH_ARGS environment

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #474 from dalgaaf/wip-da-next-fix-help
Sage Weil [Sun, 28 Jul 2013 22:26:17 +0000 (15:26 -0700)]
Merge pull request #474 from dalgaaf/wip-da-next-fix-help

Add missing commands to help/usage and manpage of ceph-authtool

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoceph-authtool.8: add missing commands to man page 473/head 474/head
Danny Al-Gaaf [Sun, 28 Jul 2013 21:39:09 +0000 (23:39 +0200)]
ceph-authtool.8: add missing commands to man page

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoceph_authtool.cc: update help/usage text
Danny Al-Gaaf [Sun, 28 Jul 2013 21:25:58 +0000 (23:25 +0200)]
ceph_authtool.cc: update help/usage text

Added implemented but not listed commands to the help/usage text:
* -g  shortcut for --gen-key
* -a  shortcut for --add-key
* -u/--set-uid to set auid
* --gen-print-key
* --import-keyring

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agomon/DataHealthService: do not name xml key after mon
Sage Weil [Sun, 28 Jul 2013 15:19:12 +0000 (08:19 -0700)]
mon/DataHealthService: do not name xml key after mon

The name might be something like '0', which is illegal.  This should be
the *type*, not name.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agodebian, rpm: make python-ceph depend on python-requests
Sage Weil [Sun, 28 Jul 2013 00:32:49 +0000 (17:32 -0700)]
debian, rpm: make python-ceph depend on python-requests

For ceph-rest-api.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #471 from dalgaaf/wip-da-fix-pylint
Sage Weil [Sat, 27 Jul 2013 14:33:21 +0000 (07:33 -0700)]
Merge pull request #471 from dalgaaf/wip-da-fix-pylint

Cleanup minor issues from pylint

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agopybind/rbd.py: remove unused import of 'pointer' 471/head
Danny Al-Gaaf [Sat, 27 Jul 2013 08:59:18 +0000 (10:59 +0200)]
pybind/rbd.py: remove unused import of 'pointer'

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agocephfs.py: remove unused imports
Danny Al-Gaaf [Sat, 27 Jul 2013 08:56:49 +0000 (10:56 +0200)]
cephfs.py: remove unused imports

Removed ctypes, c_uint64, c_ubyte, pointer, CFUNCTYPE since they
are not used in the code.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorados.py: fix bad indentation
Danny Al-Gaaf [Sat, 27 Jul 2013 09:37:26 +0000 (11:37 +0200)]
rados.py: fix bad indentation

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoceph_argparse.py: add missing spaces after comma
Danny Al-Gaaf [Sat, 27 Jul 2013 09:36:35 +0000 (11:36 +0200)]
ceph_argparse.py: add missing spaces after comma

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoceph_argparse.py: remove unnecessary semicolons
Danny Al-Gaaf [Sat, 27 Jul 2013 09:35:38 +0000 (11:35 +0200)]
ceph_argparse.py: remove unnecessary semicolons

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoceph_rest_api.py: fix bad indentation
Danny Al-Gaaf [Sat, 27 Jul 2013 09:32:34 +0000 (11:32 +0200)]
ceph_rest_api.py: fix bad indentation

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest/admin_socket: fix admin_socket unit tests
Sage Weil [Sat, 27 Jul 2013 05:28:40 +0000 (22:28 -0700)]
test/admin_socket: fix admin_socket unit tests

Command is now JSON!

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agorgw: fix RGWFormatter_Plain
Sage Weil [Sat, 27 Jul 2013 05:14:47 +0000 (22:14 -0700)]
rgw: fix RGWFormatter_Plain

Needs dump_format_unqouted.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agocommon/admin_socket: do not populate empty help strings
Sage Weil [Sat, 27 Jul 2013 05:08:26 +0000 (22:08 -0700)]
common/admin_socket: do not populate empty help strings

Hidden commands have no help string.  Make this consistent: the m_help
entry is always there, but may be empty.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agocommon/perf_counters: fix unit tests
Sage Weil [Sat, 27 Jul 2013 04:42:41 +0000 (21:42 -0700)]
common/perf_counters: fix unit tests

The commands are now in json.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agocommon/perf_counters: fix missing decimal in time, quoting
Sage Weil [Sat, 27 Jul 2013 04:42:25 +0000 (21:42 -0700)]
common/perf_counters: fix missing decimal in time, quoting

We shouldn't quote integer or float values.  Also easier to use
dump_unsigned.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agocommon/Formatter: add dump_format_unquoted()
Sage Weil [Sat, 27 Jul 2013 04:41:27 +0000 (21:41 -0700)]
common/Formatter: add dump_format_unquoted()

Sometimes a savvy caller wants to format the output but doesn't want it
quoted.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agorados.py: missing parameter to make_ex()
Dan Mick [Sat, 27 Jul 2013 00:47:49 +0000 (17:47 -0700)]
rados.py: missing parameter to make_ex()

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoceph-rest-api: clean up options/environment
Dan Mick [Sat, 27 Jul 2013 00:47:32 +0000 (17:47 -0700)]
ceph-rest-api: clean up options/environment

ceph-rest-api:
* create app from wrapper by calling generate_app()
* pass args to generate_app() (early parsed in wrapper)
* parse -i/--id here as well
* set addr:port on returned app object
* handle only EnvironmentError exceptions; let others spew traceback
* turn off debug when running singlethreaded server

ceph_rest_api.py:
* put glob.* on app.ceph_* instead; pass around app in init code
* drop conf parsing (let librados do its job)

Documentation updated to match.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoqa/fs/.gitignore
Sage Weil [Sat, 27 Jul 2013 04:06:14 +0000 (21:06 -0700)]
qa/fs/.gitignore

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoceph_test_admin_socket: fix unit test
Sage Weil [Sat, 27 Jul 2013 04:06:06 +0000 (21:06 -0700)]
ceph_test_admin_socket: fix unit test

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agomessage: Fix asserts that dont' trigger
David Zafman [Fri, 26 Jul 2013 21:00:06 +0000 (14:00 -0700)]
message: Fix asserts that dont' trigger

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agolibrados: EINVAL on a negative osd id
Sage Weil [Sat, 27 Jul 2013 00:26:48 +0000 (17:26 -0700)]
librados: EINVAL on a negative osd id

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoceph.in: make osdids() (and mon, mds) work on old mons
Dan Mick [Fri, 26 Jul 2013 23:25:26 +0000 (16:25 -0700)]
ceph.in: make osdids() (and mon, mds) work on old mons

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoosd: humor coverity
Sage Weil [Sat, 27 Jul 2013 00:14:44 +0000 (17:14 -0700)]
osd: humor coverity

CID 1058392: Out-of-bounds access (OVERRUN_DYNAMIC) [select issue]

CID 1058391 (#1 of 1): Out-of-bounds access (OVERRUN)
32. alloc_strlen: Allocating insufficient memory for the terminating null of the string.

CID 1058390 (#1 of 1): Unchecked return value from library (CHECKED_RETURN)
13. check_return: Calling function "this->class_handler->open_all_classes()" without checking return value. It wraps a library function that may fail and return an error code. [show details]
     14. unchecked_value: No check of the return value of "this->class_handler->open_all_classes()".

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agomon/MonCap: mds needs to subscribe to the osdmap
Sage Weil [Fri, 26 Jul 2013 22:46:51 +0000 (15:46 -0700)]
mon/MonCap: mds needs to subscribe to the osdmap

Usually it can get it from the OSD, but it assumes the mon will also share
and doesn't behave when it does not.

Fixes: #5767
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoremove unused fiemap code
Sage Weil [Fri, 26 Jul 2013 23:42:41 +0000 (16:42 -0700)]
remove unused fiemap code

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoPendingReleaseNotes: note on 'ceph tell <pgid> ...'
Sage Weil [Fri, 26 Jul 2013 23:21:09 +0000 (16:21 -0700)]
PendingReleaseNotes: note on 'ceph tell <pgid> ...'

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge remote-tracking branch 'gh/wip-tell-unified' into next
Sage Weil [Fri, 26 Jul 2013 23:12:19 +0000 (16:12 -0700)]
Merge remote-tracking branch 'gh/wip-tell-unified' into next

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoceph_rest_api.py: cleanup, more docstrings, unused vars
Dan Mick [Fri, 26 Jul 2013 22:23:57 +0000 (15:23 -0700)]
ceph_rest_api.py: cleanup, more docstrings, unused vars

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoceph_argparse.py: make find_cmd_target handle tell <pgid>
Dan Mick [Thu, 25 Jul 2013 04:56:15 +0000 (21:56 -0700)]
ceph_argparse.py: make find_cmd_target handle tell <pgid>

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoceph_argparse, mon: make "tell <pgid>" work (duplicating "pg <pgid>")
Dan Mick [Wed, 24 Jul 2013 05:13:14 +0000 (22:13 -0700)]
ceph_argparse, mon: make "tell <pgid>" work (duplicating "pg <pgid>")

It's a wad of special cases, but it implements "tell <pgid>" such that
it has the same effect as "pg <pgid>".

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoceph_rest_api.py: obtain and handle tell <osd-or-pgid> commands
Dan Mick [Tue, 23 Jul 2013 07:50:15 +0000 (00:50 -0700)]
ceph_rest_api.py: obtain and handle tell <osd-or-pgid> commands

Contact an OSD that's up to get a list of the commands, and use
them to add to the URL map.

Special treatment throughout for these commands:

* hack the help signature dump
* keep a 'flavor' per command to allow special handler() processing
* strip off 'tell/<target>' when constructing command
* allow multiple dicts with the same url
  (the parameters and get/put methods can change)
* because of above, method must be validated in handler()
* validate the given OSD
* calculate target for command (mon, osd, pg)

Unrelated: make method_dict into global METHOD_DICT

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agomon/PGMonitor: reset in-core PGMap if on-disk format changes
Sage Weil [Fri, 26 Jul 2013 22:25:12 +0000 (15:25 -0700)]
mon/PGMonitor: reset in-core PGMap if on-disk format changes

We might have a sequence like:

- start mon, load pgmap 100
- sync
 - including a format upgrade at say v 150
- refresh
 - see format_version==1, and try read pgmap:101 as new format

This simply clears our in-memory state if we see that the format has
changed.  That will make update_from_paxos reload the latest and prevent
it from walking through the old and useless inc updates.

Note: this does not affect the auth monitor because we unconditionally
load the latest map in update_from_paxos on upgrade.  Also, the upgrade
there wasn't a format change--just a translation of cap strings from the
old to new style.

Fixes: #5764
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoMerge pull request #470 from dalgaaf/wip-da-CID-3.v2
Sage Weil [Fri, 26 Jul 2013 22:08:56 +0000 (15:08 -0700)]
Merge pull request #470 from dalgaaf/wip-da-CID-3.v2

Fix several CID issues - v2

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agorgw/rgw_metadata.cc: delete md_log (RGWMetadataLog) in destructor 470/head
Danny Al-Gaaf [Fri, 26 Jul 2013 21:28:44 +0000 (23:28 +0200)]
rgw/rgw_metadata.cc: delete md_log (RGWMetadataLog) in destructor

Call delete on md_log in the destructor.

CID 1054826 (#1 of 1): Resource leak in object (CTOR_DTOR_LEAK)
 1. alloc_new: Allocating memory by calling "new RGWMetadataLog(_cct, _store)".
 2. var_assign: Assigning: "this->md_log" = "new RGWMetadataLog(_cct, _store)".
 3. ctor_dtor_leak: The constructor allocates field "md_log" of
    "RGWMetadataManager" but the destructor and whatever functions it calls
    do not free it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorgw/rgw_rest_log.cc: free 'handle' to prevent memory leak
Danny Al-Gaaf [Fri, 26 Jul 2013 19:13:54 +0000 (21:13 +0200)]
rgw/rgw_rest_log.cc: free 'handle' to prevent memory leak

Call complete_list_entries() at end of RGWOp_MDLog_List::execute()
to free the 'handle'.

CID 1054834 (#1-2 of 2): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "handle" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_cls_log.cc: fix resource leak, delete 'rop'
Danny Al-Gaaf [Thu, 25 Jul 2013 22:44:26 +0000 (00:44 +0200)]
test_cls_log.cc: fix resource leak, delete 'rop'

Fixes for:

CID 1054838 (#14 of 14): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "rop" going out of scope leaks the
  storage it points to.

CID 1054836 (#5 of 5): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "rop" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_cls_log.cc: remove empty lines
Danny Al-Gaaf [Thu, 25 Jul 2013 22:39:29 +0000 (00:39 +0200)]
test_cls_log.cc: remove empty lines

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_cls_statelog.cc: fix memory leak, delete 'rop'
Danny Al-Gaaf [Thu, 25 Jul 2013 22:27:50 +0000 (00:27 +0200)]
test_cls_statelog.cc: fix memory leak, delete 'rop'

CID 1054840 (#3 of 3): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "rop" going out of scope leaks
  the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_cls_version.cc: close some memory leaks
Danny Al-Gaaf [Thu, 25 Jul 2013 22:14:59 +0000 (00:14 +0200)]
test_cls_version.cc: close some memory leaks

Close some memory leaks caused by calling new() without
freeing the memory already assigned to 'rop'.

CID 1054848 (#1-6 of 6): Resource leak (RESOURCE_LEAK)
  overwrite_var: Overwriting "rop" in "rop = new_rop()"
  leaks the storage that "rop" points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMerge pull request #467 from dalgaaf/wip-da-next-SCA-cppcheck-1
Sage Weil [Fri, 26 Jul 2013 21:54:50 +0000 (14:54 -0700)]
Merge pull request #467 from dalgaaf/wip-da-next-SCA-cppcheck-1

Fix typical smaller issues from SCA

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoupstart: stop ceph-create-keys when the monitor stops
Sage Weil [Fri, 26 Jul 2013 21:07:02 +0000 (14:07 -0700)]
upstart: stop ceph-create-keys when the monitor stops

This avoids lingering ceph-create-keys tasks.

Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd: make open classes on start optional
Sage Weil [Fri, 26 Jul 2013 21:02:07 +0000 (14:02 -0700)]
osd: make open classes on start optional

Some might want the old behavior.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd: load all classes on startup
Sage Weil [Fri, 26 Jul 2013 20:58:46 +0000 (13:58 -0700)]
osd: load all classes on startup

This avoid creating a wide window between when ceph-osd is started and
when a request arrives needing a class and it is loaded.  In particular,
upgrading the packages in that window may cause linkage errors (if the
class API has changed, for example).

Fixes: #5752
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agoPG: add formatted output to pg <pgid> query, list_missing
Dan Mick [Sat, 20 Jul 2013 01:04:29 +0000 (18:04 -0700)]
PG: add formatted output to pg <pgid> query, list_missing

Signed-off-by: Dan Mick <dan.mick@inktank.com>