Bassam Tabbara [Sat, 5 Nov 2016 01:10:08 +0000 (18:10 -0700)]
embedded: Add RADOS classes to embedded cephd library
RADOS classes can now be statically compiled and added to
the embedded cephd library.
The RADOS ClassHandler now has an option to skip calling dlclose
just like PluginRegistry.
All RADOS classes where changed to use a CLS_INIT macro that
will either use __cls_init or classname_cls_init. this enables
the static compiling of all RADOS classes in a single library. Also
global method definitions where moved to inside cls_init.
Also added a few aconfig defines including WITH_EMBEDDED, WITH_CEPHFS,
WITH_RBD, and WITH_KVS. Note that WITH_RBD was not defined before
and the ceph-dencoder was broken when it was turned on.
Bassam Tabbara [Sat, 5 Nov 2016 01:10:08 +0000 (18:10 -0700)]
embedded: Add librbd and librados to embedded ceph
This commit add librados, librbd to the embedded ceph static library. This is needed to support daemons built with libcephd that want to run mon commands, create rbd volumes, snapshots etc.
Bassam Tabbara [Sat, 5 Nov 2016 01:10:08 +0000 (18:10 -0700)]
embedded: Add a skeleton libcephd library
libcephd is a library that contains ceph daemon code
that can be statically linked in other applications.
Added MergeStaticLibraries.cmake that can merge static libraries
to form a bigger one. This approach avoids the need to mess with
STATIC libraries all over the code base.
Sage Weil [Tue, 29 Nov 2016 03:47:53 +0000 (22:47 -0500)]
librbd/ImageCtx: no need for virtual dtor
CID 1396232 (#1 of 1): Non-virtual destructor (VIRTUAL_DTOR)
1. nonvirtual_dtor: Class librbd::<unnamed>::SafeTimerSingleton has a destructor and a pointer to it is upcast to class SafeTimer which doesn't have a virtual destructor.
The SafeTimerSingleton is not polymorphic; no need for
a virtual dtor.
Sage Weil [Mon, 28 Nov 2016 20:56:29 +0000 (15:56 -0500)]
os/bluestore/KernelDevice: fix race in aio_thread vs aio_wait
The caller is free to destroy the aio vector contents
once aio_wait completes. This is exactly what
BlueFS::_fsync() does. Delay the num_running dec
(which is what aio_wait waits for) until after we've
examined the aios.
Fixes: http://tracker.ceph.com/issues/17824 Signed-off-by: Sage Weil <sage@redhat.com>
Sage Weil [Mon, 28 Nov 2016 19:26:51 +0000 (14:26 -0500)]
os/Transaction: add missing break
CID 1395137 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: The case for value ObjectStore::Transaction::OP_TRY_RENAME is not terminated by a 'break' statement.
Sage Weil [Mon, 28 Nov 2016 19:26:21 +0000 (14:26 -0500)]
os/ObjectStore: pass by ref to clone
CID 1395658 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
pass_by_value: Passing parameter noid of type ghobject_t (size 144 bytes) by value.
Sage Weil [Mon, 28 Nov 2016 19:25:39 +0000 (14:25 -0500)]
os/ObjectStore: pass by ref to clone_range
CID 1395650 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
pass_by_value: Passing parameter noid of type ghobject_t (size 144 bytes) by value.
Sage Weil [Mon, 28 Nov 2016 19:24:57 +0000 (14:24 -0500)]
os/ObjectStore: add missing break
CID 1394998 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: The case for value ObjectStore::Transaction::OP_TRY_RENAME is not terminated by a 'break' statement.
Sage Weil [Mon, 28 Nov 2016 19:23:36 +0000 (14:23 -0500)]
os/bluestore: be pedantic about kv_stop locking
Makes coverity happy.
CID 1395346 (#1 of 1): Data race condition (MISSING_LOCK)
1. missing_lock: Accessing this->kv_stop without holding lock BlueStore.kv_lock. Elsewhere, "BlueStore.kv_stop" is accessed with BlueStore.kv_lock held 1 out of 2 times (1 of these accesses strongly imply that it is necessary).
Sage Weil [Mon, 28 Nov 2016 19:22:32 +0000 (14:22 -0500)]
os/bluestore: init all fields
9. uninit_member: Non-static class member block_size is not initialized in this constructor nor in any functions that it calls.
11. uninit_member: Non-static class member block_mask is not initialized in this constructor nor in any functions that it calls.
13. uninit_member: Non-static class member block_size_order is not initialized in this constructor nor in any functions that it calls.
CID 1396159 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
15. uninit_member: Non-static class member max_alloc_size is not initialized in this constructor nor in any functions that it calls.
Sage Weil [Mon, 28 Nov 2016 19:15:33 +0000 (14:15 -0500)]
os/bluestore: pass by ref to _collection_list
CID 1395617 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
pass_by_value: Passing parameter end of type ghobject_t (size 144 bytes) by value.
pass_by_value: Passing parameter start of type ghobject_t (size 144 bytes) by value.
Sage Weil [Mon, 28 Nov 2016 19:11:54 +0000 (14:11 -0500)]
os/bluestore/BlueRocksEnv: fix strerror args
CID 1395399 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
negative_returns: A negative constant -2 is passed as an argument to a parameter that cannot be negative.
Sage Weil [Mon, 28 Nov 2016 19:09:45 +0000 (14:09 -0500)]
os/bluestore/BlueFS: init iocv
CID 1396119 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
2. uninit_member: Non-static class member field iocv._M_elems is not initialized in this constructor nor in any functions that it calls.
Sage Weil [Mon, 28 Nov 2016 18:45:35 +0000 (13:45 -0500)]
os/bluestore/BlueFS: check flush result
CID 1394759 (#1 of 1): Unchecked return value (CHECKED_RETURN)
20. check_return: Calling _flush without checking return value (as is done elsewhere 4 out of 5 times).
Sage Weil [Mon, 28 Nov 2016 18:44:05 +0000 (13:44 -0500)]
os/bluestore/BlockDevice: init rotational
CID 1396126 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member rotational is not initialized in this constructor nor in any functions that it calls.
"ceph-disk trigger" invocation is currently performed in a mutually
exclusive fashion, with each call first taking an flock on the path
/var/lock/ceph-disk. On systems with a lot of osds, this leads to a
large amount of lock contention during boot-up, and can cause some
service instances to trip the 120 second timeout.
Take an flock on a device specific path instead of /var/lock/ceph-disk,
so that concurrent "ceph-disk trigger" invocations are permitted for
independent osds. This greatly reduces lock contention and consequently
the chance of service timeout. Per-device concurrency restrictions
required for http://tracker.ceph.com/issues/13160 are maintained.
Fixes: http://tracker.ceph.com/issues/18049 Signed-off-by: David Disseldorp <ddiss@suse.de>
Orit Wasserman [Fri, 25 Nov 2016 16:30:44 +0000 (17:30 +0100)]
Merge pull request #11982 from zhouruisong/master
rgw:bugfix for deleting objects name beginning and ending with underscores of one bucket using POST method of AWS's js sdk. Reviewed-by: Orit Wasserman <owasserm@redhat.com>
Loic Dachary [Thu, 24 Nov 2016 18:52:14 +0000 (19:52 +0100)]
tests: facilitate background process debug in ceph-helpers.sh
When displaying the output of a background process, do it on stderr so
that it is not bufferized. Otherwise the output of the background
process may be displayed after it completed.
Prefix the output of a background process with the PID of the process
known to the parent instead of the PID of the awk process processing the
output. When wait_background loops, it will print the process on which
it is waiting and it is confusing that they do not match with the PID
prefixing the process output.
Kefu Chai [Tue, 15 Nov 2016 06:21:03 +0000 (14:21 +0800)]
common,test: g_ceph_context->put() upon return
prior to this change, global_init() could create a new CephContext
and assign it to g_ceph_context. it's our responsibilty to release
the CephContext explicitly using cct->put() before the application
quits. but sometimes, we fail to do so.
in this change, global_init() will return an intrusive_ptr<CephContext>,
which calls `g_ceph_context->put()` in its dtor. this ensures that
the CephContext is always destroyed before main() returns. so the
log is flushed before _log_exp_length is destroyed.
there are two cases where global_pre_init() is called directly.
- ceph_conf.cc: g_ceph_context->put() will be called by an intrusive_ptr<>
deleter.
- rgw_main.cc: global_init() is called later on on the success code
path, so it will be taken care of.
John Spray [Thu, 17 Nov 2016 17:05:19 +0000 (17:05 +0000)]
mds: maybe_fragment earlier in openc
Check it during the initial request, not just
on completion, so that when doing lots of creates
we get a chance to split the directory before
it zooms past the size threshold.
John Spray [Thu, 24 Nov 2016 10:27:06 +0000 (10:27 +0000)]
mds/MDBalancer: separate out fragmentation from hit_dir
In _fragment_finish we would like to try splitting
the new frags without applying a spurious hit to their
temperatures. Same for the start of openc where we would
like to do an early check for splitting without hitting
the dir twice.
John Spray [Wed, 16 Nov 2016 22:05:22 +0000 (22:05 +0000)]
mds: tweak merge/split counters
Increment these when we have finished splitting
or merging, not partway through the process.
This makes testing more deterministic: once I've seen
the counter increment, I'm sure that the children
no longer have STATE_FRAGMENTING set as a result of
their parent's split-in-progress.
root [Mon, 14 Nov 2016 02:41:26 +0000 (10:41 +0800)]
rgw:fix for deleting objects name beginning and ending with underscores of one bucket using POST method of AWS's js sdk. Fixes: http://tracker.ceph.com/issues/17888 Signed-off-by: zhouruisong 236131368@qq.com