Commit Graph

29921 Commits

Author SHA1 Message Date
Sage Weil
63755c42f9 Merge pull request #909 from dachary/wip-crush-unittest
more CrushWrapper unittest
2013-12-06 12:35:52 -08:00
Loic Dachary
4e26cc0dac crush: unittest CrushWrapper::get_immediate_parent
Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-06 20:40:48 +01:00
Loic Dachary
09938e6455 crush: unittest CrushWrapper::update_item
Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-06 20:40:48 +01:00
Loic Dachary
16ac59042e crush: unittest s/std::string/string/
Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-06 20:40:48 +01:00
Loic Dachary
b8190180c3 crush: unittest use const instead of define
And reduce the depth of the hierarchy because three levels of buckets
capture the same cases as four levels.

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-06 20:40:48 +01:00
Loic Dachary
dc095214d3 crush: unittest CrushWrapper::check_item_loc
Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-06 20:40:48 +01:00
Loic Dachary
000c59a9a2 crush: unittest remove useless c->create()
Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-06 20:40:48 +01:00
Yehuda Sadeh
516788d15b Merge remote-tracking branch 'origin/next' 2013-12-06 11:24:06 -08:00
Sage Weil
f4c16236b7 Merge pull request #901 from dachary/wip-crush-unittest
crush: check for invalid names in loc[]

Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-06 08:29:01 -08:00
Loic Dachary
aedbc99ffc crush: check for invalid names in loc[]
Add the is_valid_crush_loc helper to test for invalid crush names in
insert_item and update_item, before performing any side
effect. Implement the associated unit tests.

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-06 09:43:47 +01:00
João Eduardo Luís
80fb336b4c Merge pull request #900 from ceph/wip-mon-mds-trim
mon: MDSMonitor: trim versions and let PaxosService decide whether to propose

We were not trimming mdsmap versions and were generating a new map every time
we modified the pending value.

Now we not only make sure that MDSMonitor will trim old maps (configurable
option allowing us to set the maximum number of maps to keep, defaulting to 500,
much like other services do) but we also delegate to PaxosService the decision on
whether to propose our pending value.

We also perform several modifications to 'ceph-kvstore-tool', allowing one to obtain
the contents of a given prefix:key and have them outputted to a file instead of stdout,
and also add support for getting the size of a given prefix:key's value.

'ceph report' was also modified so that we always output the first and last
committed versions for all services; up until this point, we would only output the
first committed version on all services, and only a few were also outputting the
last committed version.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-05 18:15:21 -08:00
Joao Eduardo Luis
47ee79704f mon: ceph-kvstore-tool: get size of value for prefix/key
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-12-06 01:06:17 +00:00
Joao Eduardo Luis
c98c1043e3 tools: ceph-kvstore-tool: output value contents to file on 'get'
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-12-06 01:06:17 +00:00
Joao Eduardo Luis
00048fe33f mon: Have 'ceph report' print last committed versions
Only for those services that weren't doing it.

Backport: dumpling
Backport: emperor

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-12-06 01:06:16 +00:00
Joao Eduardo Luis
cc64382822 mon: MDSMonitor: let PaxosService decide on whether to propose
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-12-06 01:06:11 +00:00
tamil
11e26ee424 s/true/1 and s/false/0
Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
2013-12-05 13:05:12 -08:00
Joao Eduardo Luis
cf099415ad mon: MDSMonitor: implement 'get_trim_to()' to let the mon trim mdsmaps
This commit also adds two options to the MDSMonitor:

  - mon_max_mdsmap_epochs: the maximum amount of maps we'll keep (def: 500)
  - mon_mds_force_trim: the version we want to trim to

This results in 'get_trim_to()' returning the possible values:

  - if we have set mon_mds_force_trim, and this value is greater than the
    last committed version, trim to mon_mds_force_trim
  - if we hold more than the max number of maps, trim to last - max
  - if we have set mon_mds_force_trim and if we hold more than the max
    number of maps, and mon_mds_force_trim is lower than last - max,
    then trim to last - max

Backport: dumpling
Backport: emperor

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-12-05 17:47:37 +00:00
Joao Eduardo Luis
3e845b56a3 mon: MDSMonitor: print map on encode_pending() iff debug mon = 30+
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-12-05 17:41:37 +00:00
Joao Eduardo Luis
62fb47509b mon: MDSMonitor: consider 'debug level' parameter on 'print_map()'
The parameter was there, just not used.  It does default to 7, so
existing callers are okay.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-12-05 17:41:37 +00:00
Joao Eduardo Luis
032a00bb35 mon: MDSMonitor: remove reference to no-longer-used encode_trim()
We weren't using it and it's no longer used by anyone anyway.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-12-05 17:41:37 +00:00
Sage Weil
39ddd213da Merge pull request #899 from dachary/wip-crush-unittest
CrushWrapper::insert_item unittest and minor fixes

Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-05 09:18:50 -08:00
Loic Dachary
ccc6014512 crush: CrushWrapper unit tests
Covers all cases for the following methods. All but insert_item are trivial.

* insert_item
* set_item_name
* name_exists
* item_exists
* get_item_id
* get_item_name
* get_num_type_names
* get_type_id
* get_type_name
* is_valid_crush_name

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-05 18:07:03 +01:00
Loic Dachary
b9bff8e8cb crush: remove redundant test in insert_item
A year after the last modification of test to check if an item was added
twice to the same bucket, the subtree_contains test was added a few
lines above it, making it redundant.

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-05 18:07:03 +01:00
Loic Dachary
8af75968ac crush: insert_item returns on error if bucket name is invalid
A bucket name may be created as a side effect of insert_item. All names
in the loc argument are checked for validity at the beginning of the
method and an error is returned immediately if one is found. This allows
to not check for errors when setting the name of an item later on.

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-05 18:06:55 +01:00
Loic Dachary
0dd7d2985a Merge pull request #892 from jpds/ceph-disk-journal-mbrtogpt
Call --mbrtogpt on journal run of sgdisk should the drive require a GPT ...

Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Loic Dachary <loic@dachary.org>
2013-12-04 11:42:30 -08:00
Sage Weil
ea600d0e0b Merge pull request #782 from danchai/master
ObjBencher: add rand_read_bench to support rand test in rados-bench
2013-12-04 07:42:48 -08:00
Jonathan Davies
35011e0b01 Call --mbrtogpt on journal run of sgdisk should the drive require a GPT table.
Signed-off-by: Jonathan Davies <jonathan.davies@canonical.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Loic Dachary <loic@dachary.org>
2013-12-04 13:57:13 +00:00
danchai
cae10830c7 ObjBencher: add rand_read_bench functions to support rand test in rados-bench
Signed-off-by: Tengwei Cai <tengweicai@gmail.com>
2013-12-04 15:41:42 +08:00
Sage Weil
e829859291 doc/rados/operations/crush: fix more
Signed-off-by: Sage Weil <sage@inktank.com>
2013-12-03 22:46:37 -08:00
Sage Weil
7709a10f52 doc/rados/operations/crush: fix rst
Signed-off-by: Sage Weil <sage@inktank.com>
2013-12-03 22:18:50 -08:00
Sage Weil
8cf2a84a03 Merge pull request #893 from jdurgin/wip-init-highlander
init, upstart: prevent daemons being started by both

Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-03 16:39:38 -08:00
Josh Durgin
5e34beb61b init, upstart: prevent daemons being started by both
There can be only one init system starting a daemon. If there is a
host entry in ceph.conf for a daemon, sysvinit would try to start it
even if the daemon's directory did not include a sysvinit file. This
preserves backwards compatibility with older installs using sysvinit,
but if an upstart file is present in the daemon's directory, upstart
will try to start them, regardless of host entries in ceph.conf.

If there's an upstart file in a daemon's directory and a host entry
for that daemon in ceph.conf, both sysvinit and upstart would attempt
to manage it.

Fix this by only starting daemons if the marker file for the other
init system is not present. This maintains backwards compatibility
with older installs using neither sysvinit or upstart marker files,
and does not break any valid configurations. The only configuration
that would break is one with both sysvinit and upstart files present
for the same daemon.

Backport: emperor, dumpling
Reported-by: Tim Spriggs <tims@uahirise.org>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-03 15:28:05 -08:00
Gregory Farnum
e94ca0bd9c Merge pull request #891 from ceph/wip-filestore-remount
allow various threaded services to be restarted to allow mount->umount->mount to work

Reviewed-by: Greg Farnum <greg@inktank.com>
2013-12-03 12:56:25 -08:00
Sage Weil
8f377cc1f7 Merge pull request #879 from xinglin/coverity-fixes
Coverity fixes

The rgw patch is
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>

The rest is
Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-03 12:47:25 -08:00
Sage Weil
858a21b90f common/WorkQueue: allow start() after stop()
Signed-off-by: Sage Weil <sage@inktank.com>
2013-12-03 12:27:14 -08:00
Sage Weil
36505e85b4 os/FileStore: allow mount after umount
Clear the stop flag on successful shutdown so that we can start again
later.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-12-03 12:27:14 -08:00
Sage Weil
cd6be292b1 common/Finisher: allow finisher to be restarted
Allow a start() after stop() by clearing the stop flag on a successful
stop.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-12-03 12:27:14 -08:00
Sage Weil
f60f5fe943 Merge pull request #843 from ceph/wip-osd-metadata
feed osd info about os, kernel, memory, arch to the mons

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Loic Dachary <loic@dachary.org>
2013-12-03 10:48:57 -08:00
Josh Durgin
9770d5d84e Merge pull request #860 from dachary/wip-6827
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-03 10:39:17 -08:00
Xing Lin
dc06e23e23 test/mon/workloadgen: added check of return value for statfs()
check the return value of statfs() in update_osd_stat()

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>

test/mon/workloadgen: fixed typo in error message

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>
2013-12-03 11:19:13 -07:00
Xing Lin
0fd3cbf631 rgw/rgw_op: added check of return value for rgw_unlink_bucket()
checked the return value of rgw_unlink_bucket() in RGWCreateBucket::execute()

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>
2013-12-03 11:19:13 -07:00
Xing Lin
9c8df34919 os/WBThrottle: added check of return value for posix_fadvise()
check the return value of posix_fadvise() in WBThrottle::entry()

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>
2013-12-03 11:19:13 -07:00
Xing Lin
de09778561 test/filestore: add check of return values in StoreTest::SetUp
add return value check for function calls, including mkdir, mkfs
and mount

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>

test/filestore: fix return value check for mkdir

allow EEXIST from mkdir()

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>
2013-12-03 11:18:55 -07:00
Xing Lin
2884c81766 test/filestore/workloadgen: added check of return value for mkdir
check return value of mkdir

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>

test/filestore/workloadgen: fix return value check for mkdir

allow EEXIST from mkdir()

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>
2013-12-03 11:18:19 -07:00
Sage Weil
6ac9269d45 Merge pull request #889 from dachary/wip-osd-metadata
depends on #843 : CPU info + check osd metadata
2013-12-03 08:13:03 -08:00
Loic Dachary
602d5d53c0 osd: include CPU info
It will be handy when trying to figure out CPU bound problems / benchmarks.

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-03 15:39:36 +01:00
Loic Dachary
f5025307d9 pybind: syntax check osd metadata
Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-03 15:12:23 +01:00
Loic Dachary
6570197871 ceph-disk: blacklist /dev/fd0
blkid -s TYPE /dev/fd0 has been verified to hang forever on a
H8DMR-82 supermicro motherboard running

3.8.0-33-generic #48~precise1-Ubuntu SMP Thu Oct 24 16:28:06 UTC 2013
x86_64

It is unlikely that ceph will ever be used on floppy disks, they
can be blacklisted.

http://tracker.ceph.com/issues/6827 fixes: #6827

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-03 09:31:05 +01:00
Xing Lin
bcb6bfd29d test/ceph_decoder: add return value check for read_file()
check the return value of read_file function call

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>
2013-12-02 23:36:20 -07:00
Sage Weil
031b9ed5da Merge pull request #877 from ceph/wip-6892
rgw: don't error out on empty owner when setting acls

Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-02 21:55:28 -08:00