Commit Graph

30169 Commits

Author SHA1 Message Date
Sage Weil
7e618c937b mon: move supported_commands fields, methods into Monitor, and fix leak
We were leaking the static leader_supported_mon_commands.  Move this into
the class so that we can clean up in the destructor.

Rename get_command_descriptions -> format_command_descriptions.

Fixes: #7009
Signed-off-by: Sage Weil <sage@inktank.com>
2013-12-16 16:09:44 -08:00
Sage Weil
1597d4e9f5 Merge pull request #951 from ceph/wip-linux-version
common: introduce get_linux_version()

Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-16 09:27:43 -08:00
Ilya Dryomov
824b3d8e84 FileJournal: use pclose() to close a popen() stream
In FileJournal::_check_disk_write_cache(), use pclose() instead of
fclose() to close a stream, created by popen().

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2013-12-16 18:57:22 +02:00
Ilya Dryomov
6696ab6479 FileJournal: switch to get_linux_version()
For the purposes of FileJournal::_check_disk_write_cache(), use
get_linux_version(), which is based on uname(2), instead of parsing the
contents of /proc/version.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2013-12-16 18:57:22 +02:00
Ilya Dryomov
fcf6e9878b common: introduce get_linux_version()
get_linux_version() returns a version of the currently running kernel,
encoded as in int, and is contained in common/linux_version.[ch].

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2013-12-16 18:57:21 +02:00
Ilya Dryomov
a2babe27e8 configure: break up AC_CHECK_HEADERS into one header-file per line
Break up AC_CHECK_HEADERS macro into one header-file per line so it's
easier to read and make changes.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2013-12-16 18:57:21 +02:00
Sage Weil
58d68995c4 Merge pull request #947 from dachary/wip-6824
mon: set ceph osd (down|out|in|rm) error code on failure

Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-15 21:16:48 -08:00
Sage Weil
edc4224de4 Merge remote-tracking branch 'gh/wip-hitset'
Reviewed-by: Greg Farnum <greg@inktank.com>

Conflicts:
	src/common/config_opts.h
	src/osd/ReplicatedPG.cc
	src/osdc/Objecter.cc
	src/vstart.sh
2013-12-15 16:57:23 -08:00
Sage Weil
f192a600c5 Revert "common/Formatter: add newline to flushed output if m_pretty"
This reverts commit d6146b0d91.

As Yehuda points out, this does not properly handle cases where we flush
the same output stream multiple times.
2013-12-15 16:23:09 -08:00
Sage Weil
c7b44d6675 Revert "common: fix perf_counters unittests for trailing newline in m_pretty"
This reverts commit ba5572397c.
2013-12-15 16:22:59 -08:00
Loic Dachary
31507c90f0 qa: test for error when ceph osd rm is EBUSY
http://tracker.ceph.com/issues/6824 fixes #6824

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-15 23:06:26 +01:00
Loic Dachary
4b9a41aa17 qa: make cephtool test imune to pool size
instead of assuming the pool size is 2, query it and increment it to
test for pool set data size. It allows to run the test from vstart.sh
without knowing what the required pool size is in advance:

    rm -fr dev out ;  mkdir -p dev ; \
     MON=1 OSD=3 ./vstart.sh -n -X -l mon osd

    LC_ALL=C PATH=:$PATH CEPH_CONF=ceph.conf \
      ../qa/workunits/cephtool/test.sh

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-15 21:45:31 +01:00
Loic Dachary
f9cfa24adc qa: add function name and line number to cephtool output
Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-15 21:45:31 +01:00
Loic Dachary
cb352484f1 qa: silence cephtool tests cleanup
The file removal installed to be triggered when the script stops must
not fail if the file does not exist.

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-15 21:45:31 +01:00
Loic Dachary
15b8616b13 mon: set ceph osd (down|out|in|rm) error code on failure
Instead of always returning true, the error code is set if at least one
operation fails.

EINVAL if the OSD id is invalid (osd.foobar for instance).
EBUSY if trying to remove and OSD that is up.

When used with the ceph command line, it looks like this:

    ceph -c ceph.conf osd rm osd.0
    Error EBUSY: osd.0 is still up; must be down before removal.
    kill PID_OF_osd.0
    ceph -c ceph.conf osd down osd.0
    marked down osd.0.
    ceph -c ceph.conf osd rm osd.0 osd.1
    Error EBUSY: removed osd.0, osd.1 is still up; must be down before removal.

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

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-15 21:45:31 +01:00
Sage Weil
80c6c54d93 Merge pull request #716 from ceph/wip-formatter-newlines
common/Formatter: add newline to flushed output if m_pretty
2013-12-15 10:24:03 -08:00
Sage Weil
3862ad8f8f Merge pull request #943 from dachary/wip-formatter-newlines
common: fix perf_counters unittests for trailing newline in m_pretty
2013-12-15 10:23:33 -08:00
Sage Weil
550adb824f Merge pull request #942 from sstock/master
Add -n option to mount.ceph, feature 7006

Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-15 10:18:49 -08:00
Steve Stock
e37467b7bf Add -n option to mount.ceph. Required by autofs when /etc/mtab is a link to /proc/mounts (e.g. Debian Wheezy), otherwise automounting a ceph file system fails. Also useful when /etc is read-only. feature 7006
Signed-off-by: Steve Stock <steve@technolope.org>
2013-12-15 12:49:42 -05:00
Sage Weil
11065b5a76 Merge pull request #937 from christian-marie/master
Document librados's rados_write's behaviour in reguards to return value.
2013-12-15 08:41:16 -08:00
Sage Weil
25838f3b0d Merge pull request #924 from dachary/wip-erasure-doc
doc: update erasure code development doc
2013-12-15 08:40:52 -08:00
Sage Weil
62a7d9c7bd Merge pull request #946 from dachary/wip-80-column
osd: format test_osd_types.cc to 80 columns
2013-12-15 08:40:32 -08:00
Sage Weil
caf5963565 Merge pull request #945 from dachary/wip-6981
ceph-disk: zap needs at least one device

Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-15 08:40:16 -08:00
Sage Weil
89dd0206ee Merge pull request #944 from dachary/wip-6679
common: fix rare race condition in Throttle unit tests

Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-15 08:39:55 -08:00
Sage Weil
9c71d97b2c Merge pull request #948 from dachary/wip-6736-1
mon: typo s/degrated/degraded/

Backport: emperor, dumpling
2013-12-15 08:32:41 -08:00
Loic Dachary
aa365e4b1a mon: typo s/degrated/degraded/
http://tracker.ceph.com/issues/6736 refs #6736

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-15 17:15:46 +01:00
Loic Dachary
5741bfe9fc osd: format test_osd_types.cc to 80 columns
Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-15 16:23:53 +01:00
Loic Dachary
07888ef3fd ceph-disk: zap needs at least one device
If given no argument, ceph-disk zap should display the usage instead of
silently doing nothing. Silence can be confused with "I zapped all the
disks".

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

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-15 15:34:17 +01:00
Loic Dachary
e57239e920 common: fix rare race condition in Throttle unit tests
The thread created to test Throttle race conditions updates a value (
throttle.get_current() ) that is tested by the main gtest thread but is
not protected by a lock. Instead of adding a lock, the main thread tests
the value after pthread_join() on the child thread.

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

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-15 14:31:27 +01:00
Loic Dachary
938f22cae2 common: format Throttle test to 80 columns
Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-15 14:30:38 +01:00
Loic Dachary
ba5572397c common: fix perf_counters unittests for trailing newline in m_pretty
Signed-off-by: Loic Dachary <loic@dachary.org>
2013-12-15 13:24:14 +01:00
Loic Dachary
c744aec660 Merge pull request #929 from kazhang/add-pkg-config
add apt-get install pkg-config for ubuntu server

Reviewed-by: Loic Dachary <loic@dachary.org>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-15 03:26:21 -08:00
John Wilkins
b7946ff4b3 doc: Added additional comments on placement targets and default placement.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-12-13 16:09:35 -08:00
John Wilkins
902f19c23a doc: Updates to federated config.
Reverted Emperor versionadded to Dumpling as it gets backported.
Added default index and bucket pools to pool creation
Added default default_placment setting
Added placement_pools key val pair examples.
Added comments for re-running the procedure for the secondary region.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-12-13 16:08:37 -08:00
Sage Weil
29cc722998 test_ipaddr: add another unit test
Was checking something for kbader.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-12-13 16:02:22 -08:00
Sage Weil
026b724b0d osd/ReplicatedPG: drop unused hit_set_start_stats
Signed-off-by: Sage Weil <sage@inktank.com>
2013-12-13 16:02:02 -08:00
Sage Weil
3d768d2301 osd/ReplicatedPG: maintain stats for the hit_set_* objects
We also make hit_set.current_info reflect only the on-disk 'current', not
anything that is not persisted.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-12-13 16:01:48 -08:00
Sage Weil
9814b93aa2 osd/ReplicatedPG: set object_info_t, SnapSet on hit_set objects
These are first-class user-visible rados objects and need these attrs.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-12-13 14:54:16 -08:00
Sage Weil
dabd5d6e34 vstart.sh: --hitset <pool> <type>
Signed-off-by: Sage Weil <sage@inktank.com>
2013-12-13 14:50:34 -08:00
Sage Weil
1c0083029e Merge remote-tracking branch 'gh/wip-objecter-full-2'
Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-13 10:49:10 -08:00
Josh Durgin
8e4b5bf8ca Merge pull request #936 from ceph/wip-rbd-single-major
rbd: support for single-major device number allocation scheme

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 10:40:11 -08:00
Sage Weil
e7652e6b4d Merge pull request #932 from ceph/wip-6979
replace sgdisk subprocess calls with a helper

Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-13 10:03:43 -08:00
Sage Weil
d5ac73658d Merge remote-tracking branch 'gh/next' 2013-12-13 09:58:10 -08:00
Yan, Zheng
5bb04763de test/libcephfs: release resources before umount
Fixes: #6742
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-12-13 09:57:50 -08:00
Alfredo Deza
897dfc113f use the new get_command helper in check_call
Signed-off-by: Alfredo Deza <alfredo@deza.pe>
2013-12-13 12:06:25 -05:00
Ilya Dryomov
eae8531e42 rbd: modprobe with single_major=Y on newer kernels
On kernels that support it, and if 'rbd map' is given a chance to
modprobe, turn on single-major device number allocation scheme.  For
users who for some reason don't want it, the workaround is to insert
the rbd module manually before executing the first 'rbd map' command.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2013-12-13 17:40:52 +02:00
Ilya Dryomov
8a473bcc99 rbd: add support for single-major device number allocation scheme
With the preparatory commits ("rbd: match against wholedisk device
numbers on unmap" and "rbd: match against both major and minor on unmap
on kernels >= 3.14") in, this amounts to chosing to work with new rbd
bus interfaces (/sys/bus/rbd/{add,remove}_single_major) if they are
available, instead of the old ones (/sys/bus/rbd/{add,remove}).

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2013-12-13 17:40:52 +02:00
Ilya Dryomov
784cc894e0 rbd: match against both major and minor on unmap on newer kernels
As described in commit "rbd: match against wholedisk device numbers on
unmap", currently we only match against major numbers.  In preparation
for support for single-major device number allocation scheme, start
matching against minor numbers also, which newer kernels provide in
a /sys/bus/rbd/devices/<id>/minor sysfs attribute.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2013-12-13 17:40:52 +02:00
Ilya Dryomov
462b3898e5 rbd: match against whole disks on unmap
Currently the way 'rbd unmap' translates a user-provided block device
into an rbd id is it matches the major number of the specified device
against /sys/bus/rbd/devices/<id>/major for each rbd mapping and
declares success on the first match.  This works for both entire disks
and partitions, because under the current device number allocation
scheme, each mapping means a new major number.

In preparation for support for single-major device number allocation
scheme, which would require matching both major and minor numbers, make
sure to always match against entire disk device numbers, by converting
the specified device major:minor pair into wholdedisk major:minor pair.
To achive that, use the libblkid library, which accomplishes this goal
by walking stable sysfs structures.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2013-12-13 17:40:52 +02:00
Ilya Dryomov
a42130592d rbd: switch to strict_strtol for major parsing
Use common/strict_strtol, which actually parses integers in a proper
way, instead of atoi for parsing /sys/bus/rbd/devices/<id>/major.  This
is important, because the kernel apparently can write things like
"(none)" into that file, and in general is more bulletproof.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2013-12-13 17:40:52 +02:00