Sage Weil [Sun, 10 Feb 2013 05:36:58 +0000 (21:36 -0800)]
osd: make coll_t::is_pg() correctly validate the snapid suffix
The strtoull() man page suggests resetting errno and using that to
check for a parsing error. This ensures the OSD::load_pgs() callers are
getting what they expect (now that they aren't relying on the broken
behavior). The other callers in the os/* code is moved to a different
method that ignores the suffix.
Sage Weil [Sun, 10 Feb 2013 05:34:02 +0000 (21:34 -0800)]
os: use coll_t:is_pg_prefix() check instead of is_pg()
The objectstore code was trying to parse out a pgid from the collection
name and using the is_pg() helper, which incorrectly tolerates a _TEMP
suffix and returns a bad value for the snapid. The objectstore doesn't
actually care about that value, so this is harmless, but sloppy.
Introduce a simpler is_pg_prefix() helper and use that instead.
Sage Weil [Mon, 11 Feb 2013 14:23:54 +0000 (06:23 -0800)]
osd: update snap collections for sub_op_modify log records conditionaly
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>
Sage Weil [Mon, 11 Feb 2013 00:59:48 +0000 (16:59 -0800)]
osd: unconditionally encode snaps buffer
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>
Joe Buck [Sun, 10 Feb 2013 02:48:57 +0000 (18:48 -0800)]
libcephfs: fix for #4068
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>
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>
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>
Danny Al-Gaaf [Thu, 7 Feb 2013 19:16:46 +0000 (20:16 +0100)]
src/osd/PG.h: use empty() instead of size()
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>
Danny Al-Gaaf [Thu, 7 Feb 2013 19:14:34 +0000 (20:14 +0100)]
src/osd/OSD.h: use empty() instead of size()
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>
Danny Al-Gaaf [Thu, 7 Feb 2013 19:04:39 +0000 (20:04 +0100)]
common/WorkQueue.h: use empty() instead of size()
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>
Danny Al-Gaaf [Thu, 7 Feb 2013 18:55:52 +0000 (19:55 +0100)]
common/AsyncReserver.h: use empty() instead of size()
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>
Danny Al-Gaaf [Wed, 6 Feb 2013 15:03:09 +0000 (16:03 +0100)]
common/config.h: declaration of config_option as struct
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>
Danny Al-Gaaf [Sun, 10 Feb 2013 19:52:21 +0000 (20:52 +0100)]
.gitignore: cleanup and sort entries
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>
Danny Al-Gaaf [Sun, 10 Feb 2013 18:00:40 +0000 (19:00 +0100)]
ceph-test.install: updated filelist
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>
Danny Al-Gaaf [Sun, 10 Feb 2013 17:33:56 +0000 (18:33 +0100)]
ceph-test: give binaries from ceph-test package useful names
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>
Loic Dachary [Sun, 10 Feb 2013 13:23:36 +0000 (14:23 +0100)]
buffer::ptr self assignment bug + patch
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.
Sage Weil [Sat, 9 Feb 2013 05:36:13 +0000 (21:36 -0800)]
java: make CephMountTest use user.* xattr names
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>
Yehuda Sadeh [Fri, 8 Feb 2013 21:14:49 +0000 (13:14 -0800)]
rgw: change json formatting for swift list container
Fixes: #4048
There is some difference in the way swift formats the
xml output and the json output for list container. In
xml the entity is named 'name' and in json it is named
'subdir'.
Sage Weil [Sat, 9 Feb 2013 08:05:33 +0000 (00:05 -0800)]
osd: fix load_pgs collection handling
On a _TEMP pg, is_pg() would succeed, which meant we weren't actually
hitting the cleanup checks. Instead, restructure this loop as positive
checks and handle each type of collection we understand.
This fixes _TEMP cleanup.
Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Samuel Just <sam.just@inktank.com>
Sage Weil [Sat, 9 Feb 2013 08:04:29 +0000 (00:04 -0800)]
osd: fix load_pgs handling of pg dirs without a head
If there is a pgid that passes coll_t::is_pg() but there is no head, we
will populate the pgs map but then fail later when we try to do
read_state. This is a side-effect of 55f8579.
Take explicit note of _head collections we see, and then warn when we
find stray snap collections.
Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Samuel Just <sam.just@inktank.com>
Greg Farnum [Fri, 25 Jan 2013 02:15:13 +0000 (18:15 -0800)]
mds: use modern encoding for LogEvent
It's a pretty simple encoding, but if we ever want to encode more than
the event type and the event itself we'll be glad to have versioned
the super-structure as well.
Greg Farnum [Fri, 25 Jan 2013 01:54:21 +0000 (17:54 -0800)]
mds: ESessions now uses modern encoding
To facilitate this (since it had no versioning previously), it
gets a new encoding number and LogEvent::decode() sets a switch
if it's the old encoding.