Fix error message when encountering already in use
OSD store.
Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
The only remaining caller is sub_op_modify(). If we do have a non-empty
op transaction, we want to do this update, regardless of what we think
last_backfill is (our notion may be not completely in sync with the
primary). In particular, our last_backfill may be the same object but
a different snapid, but the primary disagrees and is pushing an op
transaction through.
Instead, update the collections if we have a non-empty transaction.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
Previously we would only encode the updated snaps vector for CLONE ops.
This doesn't work for MODIFY ops generated by the snap trimmer, which
may also adjust the clone collections. It is also possible that other
operations may need to populate this field in the future (e.g.,
LOST_REVERT may, although it currently does not).
Fixes: #4071, and possibly #4051.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
This commit breaks the swift unit test. The reason is that it
makes it so that returned error status ends with eol, which
is not as expected.
This reverts commit c31aff5f9f.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
If client->init() fails in mount, then client->shutdown()
should not be called. This patch uses a bool to ensure
that shutdown is only called if init() succeeds.
Signed-off-by: Joe Buck <jbbuck@gmail.com>
Reviewed-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Fix warning from clang(++):
common/Mutex.cc:14:17: warning: using directive refers to
implicitly-defined namespace 'std'
using namespace std;
^
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix warning from clang(++):
ceph_authtool.cc:15:17: warning: using directive refers to
implicitly-defined namespace 'std'
using namespace std;
^
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix warning from clang(++):
librados/librados.cc:15:17: warning: using directive refers to
implicitly-defined namespace 'std'
using namespace std;
^
Include what we need and use the related classes.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix warning from clang(++):
test/mon/test_mon_workloadgen.cc:311:23: warning: in-class
initializer for static data member of type 'const double' is
a GNU extension [-Wgnu]
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix warning for usage of objects.size(). Use empty() since it
should be prefered as it has, following the standard, a constant
time complexity regardless of the containter type. The same is not
guaranteed for size().
warning from cppchecker was:
[osd/PG.h:599]: (performance) Possible inefficient checking for
'objects' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix warning for usage of *.size(). Use empty() since it should be
prefered as it has, following the standard, a constant time
complexity regardless of the containter type. The same is not
guaranteed for size().
warning from cppchecker was:
[osd/OSD.h:265]: (performance) Possible inefficient checking for
'last_scrub_pg' emptiness.
[osd/OSD.h:274]: (performance) Possible inefficient checking for
'last_scrub_pg' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix warning for usage of out->size() in _void_dequeue(). Use empty()
since it should be prefered as it has, following the standard, a
constant time complexity regardless of the containter type. The
same is not guaranteed for size().
warning from cppchecker was:
[common/WorkQueue.h:97]: (performance) Possible inefficient
checking for 'queue' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix warning for usage of queue.size() in do_queues(). Use empty()
since it should be prefered as it has, following the standard, a
constant time complexity regardless of the containter type. The
same is not guaranteed for size().
warning from cppchecker was:
[common/AsyncReserver.h:40]: (performance) Possible inefficient
checking for 'queue' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Change declaration of config_option from 'class' to 'struct' since
it's defined as struct and used this way (access members). The declaration
as class doesn't change the behaviour.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Cleanup old entries and sort the existing entries. Remove no longer
existing entries/files. Move some entries from top level .gitignore
files down to the correct subdir .gitignore file.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Add some files which are part of the ceph-test package on RPM based
distributions already: ceph_test_mon_workloadgen, ceph_rgw_jsonparser,
ceph_test_objectcacher_stress.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Don't install rest-bench in ceph.spec.in section for ceph-test and
ceph-test.install twice. This file is already part of the rest-bench
package.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
The files from the ceph-test subpackage are installed to /usr/bin,
give them more useful names to make sure that the user know they
belong to ceph. add a 'ceph_' prefix and change some test* binaries
to ceph_test_*.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
After
buffer::ptr a(1);
a = a;
a call to a.get_raw() will return a null pointer and there will be
no pointer referencing the original buffer::raw object although its
reference count is 1.
buffer::ptr& buffer::ptr::operator= (const ptr& p) is modified to use
a local buffer::raw pointer to fix the memory leak. a = a
is a noop instead of loosing the original raw buffer.
A set of unit tests is added src/test/bufferlist.cc to demonstrate
that the proposed change works as expected. It is checked with
valgrind that reports no memory leak. The same test can be run against
the original code to show that it leaks.
http://tracker.ceph.com/issues/4070 refs #4070
Signed-off-by: Loic Dachary <loic@dachary.org>
Fix 4K memory leak in case RGWClientIO::read() fails in
read_all_chunked_input().
Error from cppcheck was:
Checking src/rgw/rgw_rest.cc...
[src/rgw/rgw_rest.cc:688]: (error) Memory leak: data
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix some memory leaks in case of error handling due to failed
client->open() calls.
Error from cppcheck was:
[src/client/SyntheticClient.cc:1980]: (error) Memory leak: buf
[src/client/SyntheticClient.cc:2040]: (error) Memory leak: buf
[src/client/SyntheticClient.cc:2090]: (error) Memory leak: buf
Fix error from cppcheck:
[src/rgw/rgw_xml.cc:212]: (error) Common realloc mistake: 'buf'
nulled but not freed upon failure
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix error from cppcheck:
[src/os/FileStore.cc:512]: (error) Common realloc mistake: 'fiemap'
nulled but not freed upon failure
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix error from cppcheck:
[src/common/fiemap.cc:73]: (error) Common realloc mistake: 'fiemap'
nulled but not freed upon failure
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Changes to the xattr code in Ceph require
a few tweaks to existing test cases.
Specifically, there is now a ceph.file.layout
xattr by default and user defined xattrs
are prepended with "user."
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joe Buck <jbbuck@gmail.com>
Reviewed-by: Noah Watkins <noahwatkins@gmail.com>