David Zafman [Mon, 11 Feb 2013 20:20:23 +0000 (12:20 -0800)]
osd/PG: store pg_info_t in leveldb (omap), purged_snaps separately
Separate the purged_snaps portion of pg_info_t (the one that gets big).
Feature #3891: osd: move purged_snaps out of info
Add a separate dirty_big_info flag so that we only update the pginfo
"biginfo" file if that state changes. This lets us avoid the cost in the
general case, like a regular PG write.
Add LEVELDBINFO feature
Put info, biginfo in leveldb
Move epoch to omap
Feature #3892: osd: move pg info into leveldb
Signed-off-by: Sage Weil <sage@inktank.com> Signed-off-by: David Zafman <david.zafman@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com> Reviewed-by: Sam Just <sam.just@inktank.com>
Sam Lang [Tue, 12 Feb 2013 17:32:29 +0000 (11:32 -0600)]
deb: Add ceph-coverage to ceph-test deb package
Teuthology uses the ceph-coverage script extensively
and expects it to be installed by the ceph task. Add
the script to the ceph-test debian package so that it
gets installed for that use case.
Sam Lang [Tue, 12 Feb 2013 22:33:58 +0000 (16:33 -0600)]
mds: Setting pool on a file requires latest osdmap
If we create a file, then create a pool, then try to
set the pool on the file with the vxattr, no mds operation
triggers a request for the latest osdmap, so we get back
EINVAL. So if we fail to find the pool initially, fall back
to requesting a new osdmap and trying the vxattr again. We
don't wait for a new map if we don't get anything newer than
what we already have.
Signed-off-by: Sam Lang <sam.lang@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Sage Weil [Tue, 12 Feb 2013 22:11:09 +0000 (14:11 -0800)]
osd: only share maps on hb connection of OSD_HBMSGS feature is set
Back in 1bc419a7affb056540ba8f9b332b6ff9380b37af we started sharing maps
with dead osds via the heartbeat connection, but old code will crash on an
unexpected message. Only do this if the OSD_HBMSGS feature is present.
Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Samuel Just <sam.just@inktank.com>
Danny Al-Gaaf [Tue, 12 Feb 2013 21:17:38 +0000 (22:17 +0100)]
mds/LogEvent.h: change print() signature to const
Fix print() function of src/mds/LogEvent.h, declare as
virtual void print(ostream& out) const {...}
Adapt functions of derived classes. This should fix a problem
with print function of derived classes EImportStart and
EImportFinish, which had a const signature, hiding virtual
function of the base class LogEvent (which wasn't const).
Fix -Woverloaded-virtual warning from clang was:
mds/events/EImportStart.h:43:8: warning: 'EImportStart::print'
hides overloaded virtual function [-Woverloaded-virtual]
void print(ostream& out) const {
^
mds/events/../LogEvent.h:95:16: note: hidden overloaded virtual
function 'LogEvent::print' declared here
virtual void print(ostream& out) {
^
In file included from mds/journal.cc:31:
mds/events/EImportFinish.h:35:8: warning: 'EImportFinish::print'
hides overloaded virtual function [-Woverloaded-virtual]
void print(ostream& out) const {
^
mds/events/../LogEvent.h:95:16: note: hidden overloaded
virtual function 'LogEvent::print' declared here
virtual void print(ostream& out) {
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
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>