Piotr Dałek [Thu, 29 Oct 2015 14:16:29 +0000 (15:16 +0100)]
os/osd: disable extra iterator validation
In a number of loops using ObjectMapIterator, the iterator is validated
twice, first as an loop break condition, then during iter->next() call.
Suppress the validation in next() method in those cases for better
performance.
Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
Piotr Dałek [Mon, 19 Oct 2015 06:32:10 +0000 (08:32 +0200)]
os/KeyValueDB: don't call self.valid() from next() and prev()
In most loops using ObjectMapIteratorImpl, there is a call to valid()
followed by a call to next(), which calls valid() again. Calling
valid() alone is particularly expensive, so don't do it twice if
possible.
Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
Piotr Dałek [Fri, 23 Oct 2015 13:22:52 +0000 (15:22 +0200)]
kv/LevelDBStore: simpler code for single-key fetches
Often there's a need to fetch value for a specified, single key. Publish
a new method in LevelDB that takes key and prefix and puts just value at
specified address, without the need for interim keysets or resultsets.
Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
This patch builds on Sage's idea to reduce bufferlist copying on
::set() calls. Initial patch reduced LevelDB's Slice generation
time from ~57ns to ~5ns in best-case scenario (bufferlist with
single bufferptr or contiguous bufferptrs), this patch reduces
slice generation time from ~57ns to ~11ns in worst case scenario
(under assumption that entire value length is at most 128KB),
leaving old code path for extremely-bad cases.
Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
Yan, Zheng [Mon, 9 Nov 2015 03:37:02 +0000 (11:37 +0800)]
client: use null snapc to check pool permission
snap inodes' ->snaprealm can be NULL, so dereferencing it in
check_pool_perm() can cause segment fault. The pool permission
check does not write any data, so it's safe to use null snapc.
Douglas Fuller [Thu, 5 Nov 2015 00:58:12 +0000 (16:58 -0800)]
cls_rbd: change object_map_update to return 0 on success, add logging
The rbd_object_map_update class method returns the size of the data read
from the object map when no update is necessary. Change this to return 0
on success. Add error logging to differentiate error cases.
Signed-off-by: Douglas Fuller <dfuller@redhat.com>
Boris Ranto [Fri, 30 Oct 2015 17:33:36 +0000 (18:33 +0100)]
rbdmap: Move do_map and do_unmap shell functions to rbdmap script
This patch creates rbdmap shell script that is called from init-rbdmap
init script. The patch also renames src/rbdmap configuration file to
src/etc-rbdmap so that rbdmap shell script can be installed via build
system directly. Finally, the patch accomodates these changes in spec
file and build system.
Fixes: #13374 Signed-off-by: Boris Ranto <branto@redhat.com>
xiexingguo [Thu, 5 Nov 2015 14:59:00 +0000 (22:59 +0800)]
librados: wrongly passed in argument for stat command
The first argument of io_ctx_impl->stat() requires an obj(of type object_t), but an oid(of type string) is directly passed in instead. Fixes: #13703 Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
Loic Dachary [Wed, 4 Nov 2015 17:24:15 +0000 (18:24 +0100)]
tests: concatenate test_rados_test_tool from src and qa
It is good for src/test/test_rados_tool.sh to be run by
rados/singleton/all/radostool.yaml because it contains a lot more tests
than qa/workunits/rados/test_rados_tool.sh
Joaquim Rocha [Mon, 19 Oct 2015 13:31:45 +0000 (15:31 +0200)]
tools/rados/rados.cc: Write to different destinations
The write benchmark only writes the objects' contents, not the omap
nor the extended attributes, which is something also interesting to
measure depending on the cluster's configuration.
These changes add a way to specify where the contents should be
written, allowing to combine any of the destinations mentioned above.
Loic Dachary [Mon, 2 Nov 2015 23:21:51 +0000 (00:21 +0100)]
tests: test/librados/test.cc must create profile
Now that the create_one_ec_pool function removes the testprofile each
time it is called, it must create the testprofile erasure code profile
again for the test to use.
Loic Dachary [Mon, 2 Nov 2015 19:24:51 +0000 (20:24 +0100)]
tests: destroy testprofile before creating one
The testprofile erasure code profile is destroyed before creating a new
one so that it does not fail when another testprofile erasure code
profile already exists with different parameters.
This must be done when creating erasure coded pools with the C++
interface, in the same way it's done with the C interface.
Boris Ranto [Fri, 23 Oct 2015 14:39:16 +0000 (16:39 +0200)]
ceph.spec.in: We no longer need redhat-lsb-core
Drop the redhat-lsb-core dependency as it is no longer necessary on
fedora/rhel.
The other two init scripts do not use redhat-lsb-core either. The
init-ceph.in conditionally requires /lib/lsb/init-functions and does not
use any of the functions defined in that file (at least not directly).
The init-radosgw file includes /etc/rc.d/init.d/functions on non-debian
platforms instead of /lib/lsb/init-functions file so it does not require
redhat-lsb-core either.
Boris Ranto [Fri, 23 Oct 2015 13:31:27 +0000 (15:31 +0200)]
init-rbdmap: Rewrite to use logger + clean-up
This patch rewrites the init-rbdmap init script so that it uses logger
instead of the log_* functions. The patch also fixes various smaller
bugs like:
* MAP_RV was undefined if mapping already existed
* UMNT_RV and UMAP_RV were almost always empty (if they succeeded) ->
removed them
* use of continue instead RET_OP in various places (RET_OP was not being
checked after the switch to logger messages)
* removed use of DESC (used only twice and only one occurrence actually
made sense)
David Zafman [Fri, 30 Oct 2015 20:14:49 +0000 (13:14 -0700)]
Merge pull request #5783 from dzafman/wip-12738
Fix scrub error handling and log output
Add set-size and remove-clone-metadata to ceph-objectstore-tool
Fix trim_object() to not crash on corrupt snapset
Add scrub clones test and add clones to ceph-objectstore-tool test
Reviewed-by: Kefu Chai <kchai@redhat.com> Reviewed-by: Samuel Just <sjust@redhat.com>