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.
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
Venky Shankar [Wed, 23 Nov 2016 09:05:03 +0000 (14:35 +0530)]
librbd: account m_processing when failing request after refresh
AioImageRequestWQ::_void_process() dequeues an item from the
work queue by invoking ThreadPool::_void_process() which also
performs accounting by incrementing ->m_processing which never
gets decremented if an image refresh fails. This is exactly
the flow when running test_lock_fence.sh which blacklists a
client and expects failed I/O operation from the client.
Without this fix, running test_lock_fence.sh in a loop fails
with an assert in PointerWQ dtor within 100 odd runs.
Kefu Chai [Wed, 23 Nov 2016 08:16:36 +0000 (16:16 +0800)]
cmake: regroup CMAKE_CXX_FLAGS and CMAKE_C_FLAGS
- some options are only meaningful for C++, so move them into
CMAKE_CXX_FLAGS.
- regroup CMAKE_CXX_FLAGS and CMAKE_C_FLAGS, and remove the duplicated
options.
- do not reset CMAKE_CXX_FLAGS with ${CMAKE_C_FLAGS}, instead, always
append ${CMAKE_C_FLAGS} to existing ${CMAKE_CXX_FLAGS}. so we don't
clobber CMAKE_CXX_FLAGS set by command line.
ceph/src/erasure-code/jerasure/gf-complete/src/gf_w32.c: In
function ‘gf_w32_cfmgk_multiply_region_from_single’:
ceph/src/erasure-code/jerasure/gf-complete/src/gf_w32.c:410:5:
warning: ‘a’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
g = _mm_insert_epi64 (a, g_star, 0);
^
Kefu Chai [Wed, 23 Nov 2016 06:48:11 +0000 (14:48 +0800)]
FileStore::_do_fiemap: do not reference fiemap after it is freed
`last` points to fiemap::fm_extends[n], and if fiemap gets freed, we can
not reference any of its fieldis. so we could remember the check result before
freeing it.
Kefu Chai [Wed, 23 Nov 2016 06:08:10 +0000 (14:08 +0800)]
hobject: better left-shift an unsigned
this silences the warning of
The result of the '<<' expression is undefined
quote from n3337, §5.8 expr.shift:
If E1 has an unsigned type, the value ... (is deterministic)...
Otherwise, if E1 has a signed type and non-negative value, and E1 x 2^E2
is representable in the result type, then that is the resulting value;
otherwise, the behavior is undefined.
Kefu Chai [Wed, 23 Nov 2016 05:58:08 +0000 (13:58 +0800)]
osd_types: pg_t::is_split(): use unsigned for bits operations
this silences the warning of
The result of the '<<' expression is undefined
quote from n3337, §5.8 expr.shift:
If E1 has an unsigned type, the value ... (is deterministic)...
Otherwise, if E1 has a signed type and non-negative value, and E1 x 2^E2
is representable in the result type, then that is the resulting value;
otherwise, the behavior is undefined.