1
0
mirror of https://github.com/ceph/ceph synced 2025-01-11 05:29:51 +00:00
Commit Graph

30651 Commits

Author SHA1 Message Date
Kri5
65a15039c3 Merge pull request from dachary/wip-large-output-daemon-config
common: fix large output in unittest_daemon_config

Reviewed-By: Christophe Courtaut <christophe.courtaut@gmail.com>
2014-01-08 02:26:03 -08:00
Sage Weil
6eea313346 Merge pull request from ceph/port/onexit
create on_exit replacement

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-07 23:57:08 -08:00
Josh Durgin
6fac2acc5e Merge pull request from ceph/wip-7083
radosgw-admin: fix object policy read op

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2014-01-07 11:23:58 -08:00
Noah Watkins
7acb0a17cb on_exit: remove side effects from asserts
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2014-01-07 11:14:42 -08:00
Loic Dachary
e3d0b0ae8c common: fix large output in unittest_daemon_config
All tests in daemon_config use the global g_ceph_context
object. Introducing an expansion loop in it will impact all tests and
generate a very large output.

Remove the SubstitutionLoop test case which is also covered in
test/common/test_config.cc.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-07 16:51:51 +01:00
Sage Weil
5300ed9428 Merge pull request from ceph/port/misc
misc portability patches

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-06 23:00:05 -08:00
Sage Weil
4eeee0e63f Merge pull request from kdreyer-inktank/automake-1.12
configure: support Automake 1.12
2014-01-06 22:29:03 -08:00
Sage Weil
ffc9d72d4f Merge pull request from dachary/wip-7103
common: recursive implementation of config::expand_meta …

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-06 21:30:18 -08:00
Jonathan Dieter
822ad58867 configure: support Automake 1.12
Signed-off-by: Jonathan Dieter <jdieter@lesbg.com>
Signed-off-by: Ken Dreyer <ken.dreyer@inktank.com>
2014-01-06 22:26:17 -07:00
Sage Weil
12a0f51360 Merge pull request from dachary/wip-duplicated-headers
autoconf: trim duplicated headers
2014-01-06 20:02:17 -08:00
Yehuda Sadeh
b1976dd00f radosgw-admin: fix object policy read op
Fixes: 
This was broken when we fixed . We use the same function to both
read the bucket policy and the object policy. However, each needed to be
treated differently. Restore old behavior for objects.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-06 12:53:58 -08:00
Loic Dachary
3f34dc7d52 common: unit tests for config::expand_meta
Part of the config.cc tests are in test/confutils.cc but they do not
cover meta variable expansion. Create unittest_config for config.{h,cc}
specific tests.

The test_md_config_t is made a friend of md_config_t to allow testing
private and protected methods.

test/cli/ceph-conf/show-config-value.t is used to check that the human
readable message message shows as expected when there is an expansion
loop.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-05 16:11:43 +01:00
Loic Dachary
94854090fb common: recursive implementation of config::expand_meta
Using a recursive implementation of variable expansions make it easier
to protect against loops and provide human readable messages when they
happen.

It also enables one variable to be substituted multiple times in the
same configuration option instead of just once because it is confused
with a variable expansion loop.

http://tracker.ceph.com/issues/7103 fixes: 

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-05 16:11:43 +01:00
Loic Dachary
87db534cea common: cosmetic inversion of tests arguments
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-05 16:11:43 +01:00
Loic Dachary
5bb1545eed common: multiple variable occurence expansion test
http://tracker.ceph.com/issues/7103 refs 

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-05 16:11:43 +01:00
Noah Watkins
7aa980528c log: use on exit manager to flush logs on exit
on_exit is not portable, and atexit doesn't allow parameters to be
passed to callbacks.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2014-01-04 12:54:03 -08:00
Noah Watkins
2181d25f7a onexit: add an on exit callback utility
Adds a class that executes registered callbacks in its destructor. Since
static duration objects have their destructors called when returning
from main or calling exit then this can be used as a replacement for
on_exit.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2014-01-04 12:54:03 -08:00
Noah Watkins
3d19f7c876 test: disable cross process sem tests on non-Linux
How to make this portable:

- MAP_ANONYMOUS -> MAP_ANON (OSX)

- sem_init (anonymous semaphore) needs to be replaced by named
semaphores using sem_open/sem_close. Use a memory address of the sem_t
variable to hack anonymous semaphore behavior.

- sem_getvalue isn't supported on OSX. it is used here to do
sem_wait/sem_post to bring a semaphore back to a specific value. to get
around this we may need to restructure the test so that the semaphore
can be destroyed and re-initialized rather than inspected as its
currently being done.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2014-01-04 09:18:04 -08:00
Noah Watkins
6342d05195 pipe: handle missing MSG_MORE and MSG_NOSIGNAL
On OSX (and currently any platform missing the MSG_MORE
macro) the MSG_MORE optimization is disabled. The MSG_NOSIGNAL flag is
available on OSX but is called SO_NOSIGPIPE and must be set via
setsockopt.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2014-01-04 09:18:04 -08:00
Noah Watkins
26c07d97ad ipaddr: use IN6_ARE_ADDR_EQUAL for comparison
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2014-01-04 09:18:04 -08:00
Noah Watkins
ef6a56aa26 keyutils: handle non-linux platform
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2014-01-04 09:18:04 -08:00
Josh Durgin
6663a5eee3 Merge pull request from ceph/wip-objectcacher-backoff
osdc/ObjectCacher: back off less during flush

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2014-01-03 16:58:28 -08:00
John Wilkins
ab2b2bb0fd doc: Fixed typo.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2014-01-03 16:30:12 -08:00
Sage Weil
a231f22032 Merge pull request from dachary/wip-mon-test
mon: get rid of --keyring /dev/null hack
2014-01-03 16:05:39 -08:00
Sage Weil
81d71f9df2 Merge pull request from kdreyer-inktank/gitignore-autotools-test-logs
add autotools-generated files to .gitignore
2014-01-03 16:05:24 -08:00
Ken Dreyer
bb8b7503b0 add autotools-generated files to .gitignore
When running "make check", Automake generates test-suite.log, along with
various *.log and *.trs files in the tree. Add these files to
.gitignore.

(It looks like this feature arrived in Automake 1.13.)

Signed-off-by: Ken Dreyer <ken.dreyer@inktank.com>
2014-01-03 16:47:23 -07:00
Loic Dachary
f2e33e8129 mon: get rid of --keyring /dev/null hack
No longer necessary when --auth-supported=none

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-04 00:34:45 +01:00
Dan Mick
3a42d4116d Merge pull request from dmsimard/ceph_rest_api_discovery
Be more explicit how to discover available API calls

Reviewed-by: Dan Mick <dan.mick@inktank.com>
2014-01-03 15:00:49 -08:00
John Wilkins
d110c913c1 doc: Removed dash from --dmcrypt option.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2014-01-03 14:37:23 -08:00
Sage Weil
5de7e5622e Merge pull request from dachary/wip-ceph-disk-activate-data-dir
ceph-disk: fix false positive for gitbuilder
2014-01-03 14:00:57 -08:00
Loic Dachary
c772b6d148 ceph-disk: fix false positive for gitbuilder
The output of test/ceph-disk.sh is very verbose which is good for
debugging errors. However it sometime contains strings that match
/error:/i which is picked by gitbuilder as a sign that the test fail,
even when the exit code is zero.

Remove from the output the three strings triggering false positive in
gitbuilder.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 22:52:55 +01:00
Sage Weil
e2ee52879e osdc/ObjectCacher: back off less during flush
In cce990efc8 we added a limit to avoid
holding the lock for too long.  However, if we back off, we currently
wait for a full second, which is probably a bit much--we really just want
to give other threads a chance.

Backport: emperor
Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-03 12:51:15 -08:00
Sage Weil
312107876c Merge pull request from dachary/wip-ceph-disk-activate-data-dir
ceph-disk : fixes and improvements for the --data-dir code path and associated tests

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-03 11:41:29 -08:00
David Moreau Simard
daefe8159f Be more explicit how to discover available API calls
Signed-off-by: David Moreau Simard <dmsimard@iweb.com>
2014-01-03 13:23:35 -05:00
Loic Dachary
de8522fa6c ceph-disk: tests for the --data-dir code path
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:33:52 +01:00
Loic Dachary
a71025d336 ceph-disk: implement --sysconfdir as /etc/ceph
Replace hardcoded /etc/ceph with the SYSCONFDIR global variable and
implement the --sysconfdir option to override the default value.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:41 +01:00
Loic Dachary
ca713f48ae ceph-disk: implement --statedir as /var/lib/ceph
Replace hardcoded /var/lib/ceph with the STATEDIR global variable and
implement the --statedir option to override the default value.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:41 +01:00
Loic Dachary
51ee3c0477 ceph-disk: add copyright notice
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:41 +01:00
Loic Dachary
306b099ab0 ceph-disk: create the data directory if it does not exist
Instead of failing if the OSD data directory does not exist, create
it. Only do so if the data directory is not enforced to be a device via
the use of the --data-dev flag. The directory is not recursively created.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:41 +01:00
Loic Dachary
0fcc081858 ceph-disk: run ceph-osd when --mark-init=none
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
e773b68f4c ceph-disk: implement --mark-init=none
It is meant to be used when preparing and activating a directory that is
not to be used with init. No file is created to identify the init
system, no symbolic link is made to the directory in /var/lib/ceph
and the init scripts are not called.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
b65eb377f5 ceph-disk: fsid is a known configuration option
Use get_conf_with_default instead of get_conf because fsid is a known
ceph configuration option. It allows overriding via CEPH_ARGS which is
convenient for testing. Only options that are not found in config_opts.h
are fetch via get_conf.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
97f516a1dd ceph-disk: use CalledProcessError.returncode
CalledProcessError has no errno data member

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
d09af0fa50 ceph-disk: display the command output on OSD creation failure
The string form of a CalledProcessError instance does not include the
output datamember. Add it to the Error exception for debug purposes.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
2b935bbf60 ceph-disk: which() uses PATH first
Instead of relying on a hardcoded set of if paths. Although this has the
potential of changing the location of the binary being used by ceph-disk
on an existing installation, it is currently only used for sgdisk. It
could be disruptive for someone using a modified version of sgdisk but
the odds of this happening are very low.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
ad6b4b4b08 ceph-disk: add --prepend-to-path to control execution
/usr/bin is hardcoded in front of some ceph programs which makes it
impossible to control where they are located via the PATH.

The hardcoded path cannot be removed altogether because it will most
likely lead to unexpected and difficult to diagnose problems for
existing installations where the PATH finds the program elsewhere.

The --prepend-to-path flag is added and defaults to /usr/bin : it prepends
to the PATH environment variable. The hardcoded path is removed
and the PATH will be used: since /usr/bin is searched first, the
legacy behavior will not change.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
908348b804 ceph-disk: make exception handling terse in main_activate_journal
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
55ca7bb2da ceph-disk: do not hide main_activate() exceptions
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
324804a81c ceph-disk: fix activate() indent
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
de0050596b ceph-disk: remove noop try:
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00