]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agomon: DataHealthService: log to derr instead if we're about to shutdown 124/head
Joao Eduardo Luis [Wed, 20 Mar 2013 20:51:06 +0000 (20:51 +0000)]
mon: DataHealthService: log to derr instead if we're about to shutdown

Otherwise the message would -- or could -- be lost.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon: DataHealthService: shutdown mon if failed to obtain disk stats
Joao Eduardo Luis [Wed, 20 Mar 2013 20:49:20 +0000 (20:49 +0000)]
mon: DataHealthService: shutdown mon if failed to obtain disk stats

Being unable to run a ::statfs() may be a symptom of something bigger.

We want to cleanly shutdown the monitor ASAP if such thing happens.

Fixes: #4509
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agoMerge pull request #121 from ceph/wip-4448
Sage Weil [Wed, 20 Mar 2013 13:33:18 +0000 (06:33 -0700)]
Merge pull request #121 from ceph/wip-4448

mon: Monitor: clearer output on error during attempt to convert store

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomon: Monitor: clearer output on error during attempt to convert store 121/head
Joao Eduardo Luis [Wed, 20 Mar 2013 13:31:14 +0000 (13:31 +0000)]
mon: Monitor: clearer output on error during attempt to convert store

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agoMerge pull request #106 from ceph/wip-crush
Sage Weil [Tue, 19 Mar 2013 21:53:23 +0000 (14:53 -0700)]
Merge pull request #106 from ceph/wip-crush

crush: update weights properly for DAG (not tree) maps

Reviewed-by: caleb miles <caleb.miles@inktank.com>
12 years agoMerge pull request #118 from dalgaaf/wip-da-enum
Sage Weil [Tue, 19 Mar 2013 20:36:12 +0000 (13:36 -0700)]
Merge pull request #118 from dalgaaf/wip-da-enum

QuorumService.h: use enum instead of static const int

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoQuorumService.h: use enum instead of static const int 118/head
Danny Al-Gaaf [Tue, 19 Mar 2013 20:33:18 +0000 (21:33 +0100)]
QuorumService.h: use enum instead of static const int

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoPendingReleaseNotes: fix typo
Josh Durgin [Sat, 16 Mar 2013 00:51:13 +0000 (17:51 -0700)]
PendingReleaseNotes: fix typo

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: optionally wait for a flush before enabling writeback
Josh Durgin [Sat, 16 Mar 2013 00:28:13 +0000 (17:28 -0700)]
librbd: optionally wait for a flush before enabling writeback

Older guests may not send flushes properly (i.e. never), so if this is
enabled, rbd_cache=true is safe for them transparently.

Disable by default, since it will unnecessarily slow down newer guest
boot, and prevent writeback caching for things that don't need to send
flushes, like the command line tool.

Refs: #3817
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMakefile: missing header
Sage Weil [Tue, 19 Mar 2013 17:39:50 +0000 (10:39 -0700)]
Makefile: missing header

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: use enum instead of static const int
Sage Weil [Tue, 19 Mar 2013 17:21:52 +0000 (10:21 -0700)]
mon: use enum instead of static const int

This way it compiles.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMakefile.am: fix misspelt header name
Joao Eduardo Luis [Tue, 19 Mar 2013 16:31:48 +0000 (16:31 +0000)]
Makefile.am: fix misspelt header name

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agoMerge branch 'next'
Sage Weil [Tue, 19 Mar 2013 05:54:25 +0000 (22:54 -0700)]
Merge branch 'next'

12 years agoceph-disk-prepare: 'mkfs -t' instead of 'mkfs --type='
Sage Weil [Tue, 19 Mar 2013 04:13:34 +0000 (21:13 -0700)]
ceph-disk-prepare: 'mkfs -t' instead of 'mkfs --type='

Older mkfs (el6) doesn't like --type=.

Fixes: #4495
Reported-by: Alexandre Maragone <alexandre.maragone@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: Handle ENODATA returned from getxattr
Sam Lang [Mon, 18 Mar 2013 21:59:04 +0000 (16:59 -0500)]
mds: Handle ENODATA returned from getxattr

The osds might return ENODATA if we request an
xattr that doesn't exist.  In this case, we're
requesting the 'parent' xattr so that we can
remove all the forwarding pointers, but the xattr
may not have been written (which only happens on
log segment trim), so we don't assert here.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomon/PaxosService: fix proposal waiter handling
Sage Weil [Tue, 19 Mar 2013 04:00:06 +0000 (21:00 -0700)]
mon/PaxosService: fix proposal waiter handling

- Cancel the propsal waiters with EAGAIN on election, etc.
- Drop the wakeup helper and open-code the one caller.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agoMakefile: fix header name
Sage Weil [Mon, 18 Mar 2013 23:18:46 +0000 (16:18 -0700)]
Makefile: fix header name

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #115 from ceph/wip-4199
Sage Weil [Mon, 18 Mar 2013 22:53:56 +0000 (15:53 -0700)]
Merge pull request #115 from ceph/wip-4199

Resolves #4199

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomon: Monitor: take advantage of the new HealthMonitor class. 115/head
Joao Eduardo Luis [Sun, 17 Mar 2013 18:41:42 +0000 (18:41 +0000)]
mon: Monitor: take advantage of the new HealthMonitor class.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon: HealthMonitor: Keep track of monitor cluster's health
Joao Eduardo Luis [Sun, 17 Mar 2013 18:40:58 +0000 (18:40 +0000)]
mon: HealthMonitor: Keep track of monitor cluster's health

The HealthMonitor builds upon the QuorumService interface, and should be
used to keep track of all and any relevant information about the monitor
cluster (maybe even about all the cluster if need be).

This patch also introduces the HealthService interface, used to define
a HealthMonitor service, responsible for dispatching 'MMonHealth' messages
(the QuorumService interface dispatches generic 'Message').

Based on the HealthService interface, we introduce the DataHealthService
class, a service that will track disk space consumption by the monitors,
warn when a given threshold is crossed, and gracefully shutdown the monitor
if disk space usage hits critical levels that might affect the correct
monitor behavior.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon: QuorumService: Allow for services quorum-bound to be easily created
Joao Eduardo Luis [Sun, 17 Mar 2013 18:33:15 +0000 (18:33 +0000)]
mon: QuorumService: Allow for services quorum-bound to be easily created

As the monitor grows in features, we have been dumping them in the Monitor
class as they don't really fit anywhere else.

Most of those latest features have been, and some of the future changes
will also be, quorum-bounded.  By that we mean that these features tend
to require a quorum to be present in order to work.

Although we already have the PaxosService interface, it really isn't
adequate for this kind of features, as they don't really require Paxos,
nor do they access the store.  Furthermore, they don't really need to
tick at the same rate as the monitor, and can be fairly independent.

Therefore we now introduce the concept of a QuorumService, a class to be
built upon, managing the tick and dispatch for any kind of service
basically requiring a quorum to function.

Among the already existing monitor features that could take advantage of
this new class we can find the Timecheck infrastructure, as it is by
nature quorum bounded.  The monitor store sync could also take advantage
of this service, although it doesn't really require a quorum to work,
and even the PaxosService-related classes could use this.

This patch also introduces the MMonQuorumService base class, to be used
by any message that should want to.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agoqa: add 16MB direct-io write test
Sage Weil [Mon, 18 Mar 2013 21:13:29 +0000 (14:13 -0700)]
qa: add 16MB direct-io write test

See bug #2657.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #113 from dalgaaf/wip-da-performance-3
Sage Weil [Mon, 18 Mar 2013 20:53:16 +0000 (13:53 -0700)]
Merge pull request #113 from dalgaaf/wip-da-performance-3

Iterator related fixes

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #112 from dalgaaf/wip-da-performance-2-v2
Sage Weil [Mon, 18 Mar 2013 20:51:57 +0000 (13:51 -0700)]
Merge pull request #112 from dalgaaf/wip-da-performance-2-v2

prefer prefix ++/--operator for e.g. iterators for performance reasons

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agosignal_handler: add func to queue an async signal
Sage Weil [Mon, 18 Mar 2013 20:10:36 +0000 (13:10 -0700)]
signal_handler: add func to queue an async signal

For example, queue a SIGINT without actually sending the signal via the
OS.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoclient: Remove unecessary set_inode() in _rmdir()
Sam Lang [Mon, 18 Mar 2013 19:40:48 +0000 (14:40 -0500)]
client:  Remove unecessary set_inode() in _rmdir()

With the recent changes in fc80c1dc6ee315ae5e039986602ffadba46cb43b,
we only allow setting the inode once on a MetaRequest.  This triggered
a bug in _rmdir(), where the parent dir inode passed in and being set
on the MetaRequest, and then also setting the dir inode on the MetaRequest.
Removing the set_inode() using the parent dir inode resolves this issue.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomon/Session.h: prefer prefix ++operator for iterators 113/head
Danny Al-Gaaf [Mon, 18 Mar 2013 14:00:41 +0000 (15:00 +0100)]
mon/Session.h: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest/filestore/workload_generator.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:39:09 +0000 (14:39 +0100)]
test/filestore/workload_generator.cc: prefer prefix ++operator for iterators

Prefer prefix ++operator for iterator. Move the iterator declaration into
the for-loop header since the iterator isn't used outside the loop.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest/filestore/test_idempotent.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:38:49 +0000 (14:38 +0100)]
test/filestore/test_idempotent.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest/filestore/test_idempotent.cc: fix ~TestFileStoreState()
Danny Al-Gaaf [Mon, 18 Mar 2013 13:34:37 +0000 (14:34 +0100)]
test/filestore/test_idempotent.cc: fix ~TestFileStoreState()

Fix interator handling in ~TestFileStoreState(). After std::map::erase()
the used iterator is invalid. Use a while-loop and erase the object with
post-incremented iterator instead.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest/test_snap_mapper.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:34:15 +0000 (14:34 +0100)]
test/test_snap_mapper.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest/osd/RadosModel.h: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:33:32 +0000 (14:33 +0100)]
test/osd/RadosModel.h: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest/filestore/TestFileStoreState.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:33:06 +0000 (14:33 +0100)]
test/filestore/TestFileStoreState.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest/xattr_bench.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:32:41 +0000 (14:32 +0100)]
test/xattr_bench.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest/osd/Object.cc: prefer prefix --/++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:31:23 +0000 (14:31 +0100)]
test/osd/Object.cc: prefer prefix --/++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest/encoding/ceph_dencoder.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:30:51 +0000 (14:30 +0100)]
test/encoding/ceph_dencoder.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest/bench/bencher.h: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:30:23 +0000 (14:30 +0100)]
test/bench/bencher.h: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoObjectMap/test_object_map.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:29:38 +0000 (14:29 +0100)]
ObjectMap/test_object_map.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotools/rest_bench.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:29:00 +0000 (14:29 +0100)]
tools/rest_bench.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotools/common.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:28:31 +0000 (14:28 +0100)]
tools/common.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoceph-filestore-dump.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:28:07 +0000 (14:28 +0100)]
ceph-filestore-dump.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorgw/rgw_user.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:27:43 +0000 (14:27 +0100)]
rgw/rgw_user.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorgw/rgw_rest_swift.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:26:51 +0000 (14:26 +0100)]
rgw/rgw_rest_swift.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosd/OSDMap.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:26:19 +0000 (14:26 +0100)]
osd/OSDMap.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/MDCache.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:25:55 +0000 (14:25 +0100)]
mds/MDCache.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/CInode.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:25:29 +0000 (14:25 +0100)]
mds/CInode.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoclient/Client.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:24:27 +0000 (14:24 +0100)]
client/Client.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoauth/AuthMethodList.cc: fix remove_supported_auth()
Danny Al-Gaaf [Mon, 18 Mar 2013 13:08:22 +0000 (14:08 +0100)]
auth/AuthMethodList.cc: fix remove_supported_auth()

Make sure the iterator isn't incremented twice if a element gets erased.
Move increment out of the for-loop header and add it to a new else block.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/mdstypes.h: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 12:03:30 +0000 (13:03 +0100)]
mds/mdstypes.h: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorgw/rgw_rados.cc: make sure range_iter != ranges.end() 112/head
Danny Al-Gaaf [Mon, 18 Mar 2013 11:45:15 +0000 (12:45 +0100)]
rgw/rgw_rados.cc: make sure range_iter != ranges.end()

Make sure range_iter is valid, set range_iter = next_iter instead of
++range_iter, since next_iter is already checked against ranges.end() and
is the same as ++range_iter.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorados.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 11:33:12 +0000 (12:33 +0100)]
rados.cc: prefer prefix ++operator for iterators

Prefer prefix ++operator for iterators, move some iterator declaration into
the for-loop header, since the iterator is only used within the loop.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorgw/rgw_rados.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 11:32:29 +0000 (12:32 +0100)]
rgw/rgw_rados.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorgw/rgw_admin.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 11:32:03 +0000 (12:32 +0100)]
rgw/rgw_admin.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorgw/rgw_acl_s3.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 11:31:13 +0000 (12:31 +0100)]
rgw/rgw_acl_s3.cc: prefer prefix ++operator for iterators

Prefer prefix ++operator for iterators, move some iterator declaration into
the for-loop header, since the iterator is only used within the loops.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosdmaptool.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 11:30:29 +0000 (12:30 +0100)]
osdmaptool.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosdc/Striper.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 11:30:02 +0000 (12:30 +0100)]
osdc/Striper.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosdc/Objecter.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 11:29:21 +0000 (12:29 +0100)]
osdc/Objecter.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosdc/ObjectCacher.cc: prefer prefix ++/--operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 11:28:16 +0000 (12:28 +0100)]
osdc/ObjectCacher.cc: prefer prefix ++/--operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosdc/ObjectCacher.h: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 10:17:21 +0000 (11:17 +0100)]
osdc/ObjectCacher.h: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosdc/Objecter.h: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 10:14:47 +0000 (11:14 +0100)]
osdc/Objecter.h: prefer prefix ++operator for iterators

Prefer prefix ++operator for iterators, move one iterator declaration into
the for-loop header, since the iterator is only used within the loop.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosdc/Filer.h: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 10:10:45 +0000 (11:10 +0100)]
osdc/Filer.h: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosdc/Filer.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 10:10:18 +0000 (11:10 +0100)]
osdc/Filer.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosd/osd_types.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 10:09:34 +0000 (11:09 +0100)]
osd/osd_types.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosd/SnapMapper.cc: use empty() instead of size() == 0
Danny Al-Gaaf [Fri, 15 Mar 2013 09:58:29 +0000 (10:58 +0100)]
osd/SnapMapper.cc: use empty() instead of size() == 0

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosd/ReplicatedPG.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:55:13 +0000 (10:55 +0100)]
osd/ReplicatedPG.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosd/PG.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:49:06 +0000 (10:49 +0100)]
osd/PG.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosd/OSDMap.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:48:40 +0000 (10:48 +0100)]
osd/OSDMap.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoosd/OSD.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:31:15 +0000 (10:31 +0100)]
osd/OSD.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoos/LFNIndex.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:19:27 +0000 (10:19 +0100)]
os/LFNIndex.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/Migrator.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:16:40 +0000 (10:16 +0100)]
mds/Migrator.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoos/JournalingObjectStore.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:09:30 +0000 (10:09 +0100)]
os/JournalingObjectStore.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoos/FlatIndex.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:09:14 +0000 (10:09 +0100)]
os/FlatIndex.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoos/FileStore.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:08:50 +0000 (10:08 +0100)]
os/FileStore.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomsg/Pipe.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:08:24 +0000 (10:08 +0100)]
msg/Pipe.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomsg/Pipe.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:07:58 +0000 (10:07 +0100)]
msg/Pipe.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/OSDMonitor.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:07:27 +0000 (10:07 +0100)]
mon/OSDMonitor.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/journal.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 11:30:51 +0000 (12:30 +0100)]
mds/journal.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/events/EMetaBlob.h: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:06:24 +0000 (10:06 +0100)]
mds/events/EMetaBlob.h: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/SnapRealm.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:05:58 +0000 (10:05 +0100)]
mds/SnapRealm.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/Migrator.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:05:31 +0000 (10:05 +0100)]
mds/Migrator.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/MDCache.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:04:49 +0000 (10:04 +0100)]
mds/MDCache.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/CDir.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Fri, 15 Mar 2013 09:04:19 +0000 (10:04 +0100)]
mds/CDir.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agolibrados/librados.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 19:09:03 +0000 (20:09 +0100)]
librados/librados.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agokv_flat_btree_async.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 19:06:21 +0000 (20:06 +0100)]
kv_flat_btree_async.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agocommon/Finisher.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 19:03:46 +0000 (20:03 +0100)]
common/Finisher.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoMerge branch 'wip-rbd-import' into next
Josh Durgin [Sat, 16 Mar 2013 22:45:18 +0000 (15:45 -0700)]
Merge branch 'wip-rbd-import' into next

Reviewed-by: Sage Weil <sage.weil@inktank.com>
12 years agomds: Add config option for log segment size
Sam Lang [Wed, 6 Mar 2013 17:40:49 +0000 (11:40 -0600)]
mds: Add config option for log segment size

The mds log segment size is chosen from the
default layout object size (4MB).  Add a parameter
to the config to enable setting the log segment
size to an alternate value.

If the config option to set the journal log segment
size is specified, the log layout must be modified
both for the object size and the striping unit size.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agoqa/workunits/restart: Add test to check backtrace
Sam Lang [Thu, 21 Feb 2013 13:39:12 +0000 (07:39 -0600)]
qa/workunits/restart:  Add test to check backtrace

This script uses the python bindings to libcephfs and rados
to create files and check the correctness of the backtrace
written to the 'parent' xattr on the first object (if its
a file) or inode (if its a dir).  The script includes test cases
that kill the mds at specific kill points and restart it through
teuthology using the teuthology restart task.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agomds: Add kill points for backtrace testing
Sam Lang [Thu, 21 Feb 2013 14:07:35 +0000 (08:07 -0600)]
mds: Add kill points for backtrace testing

To test the mds journal and replay behavior, and the
functionality for storing backtraces on inodes, we
add kill points to the MDS in the openc, journal replay,
and journal expire paths.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agopybind/cephfs: Add initial py wrappers for cephfs.
Sam Lang [Thu, 21 Feb 2013 13:38:14 +0000 (07:38 -0600)]
pybind/cephfs:  Add initial py wrappers for cephfs.

Initial Support for python bindings to libcephfs for testing
MDS backtraces with a the python script test-backtraces.py.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agomds: Cleanup new segment conditionals
Sam Lang [Thu, 21 Feb 2013 13:35:14 +0000 (07:35 -0600)]
mds: Cleanup new segment conditionals

The second conditional for adding a new segment is always
true when the first conditional is true.  Clean this up
to simply create a new segment when we've reached the end of
the current segment.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agomds: Backtrace for create,rename,mkdir,setlayout
Sam Lang [Tue, 5 Mar 2013 15:18:35 +0000 (09:18 -0600)]
mds: Backtrace for create,rename,mkdir,setlayout

Design info:
http://www.spinics.net/lists/ceph-devel/msg11872.html

Adds a backtrace to the data pool for supporting lookup-by-ino,
storing the backtrace on the first object in the data pool
or the metadata pool for a directory, as the 'parent' xattr
on the object (named by inode) in that pool.  For create, rename,
mkdir, and setlayout operations, the backtrace is
queued (with the current log segment) after the journal is
committed and the safe reply is returned to the client, but the
the backtrace operation itself isn't started until the log segment is
expired.

For journal replay, we queue the backtrace so that it gets
written out on journal expire.  Inodes get added to the EMetaBlob
in the fullbits list, so we queue backtraces while iterating through
the fullbits during replay.

Using setlayout or setxattr('ceph.file.layout.pool'),
the data pool for a file can be changed after it is created
but before anything is written to the file.  A forwarding backtrace
is written to the old pool on a setlayout, to ensure we can always find
the latest backtrace.  We store a list of old pools with the backtrace
for cleaning up all forwarding pointers of an inode.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agomds: New backtrace handling
Sam Lang [Tue, 5 Mar 2013 14:48:29 +0000 (08:48 -0600)]
mds: New backtrace handling

Add unified backtrace handling for storing a backtrace on file objects
(the first data object) and dirs.  The backtrace store operation is
queued on the LogSegment (for performing the store on log segment
expire).  We encode the backtrace on queue to avoid keeping a reference
around to the CInode, which may get dropped from the cache by the time
the log segment is expired (and the backtrace is written out).
Fetching the backtrace is implemented on the CInode.

Also allow incrementing/decrementing the DIRTYPARENT pin ref as needed,
instead of using a state semaphore to keep track of whether itsset or
not.  This allows us to remove the STATE_DIRTYPARENT field on CInode.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agomessage/mds: Fix client reconnect decode
Sam Lang [Tue, 26 Feb 2013 14:48:40 +0000 (08:48 -0600)]
message/mds:  Fix client reconnect decode

Flip the conditional so that snap realms are
decoded, otherwise this results in an assertion
failure of the mds when a client attempts to
reconnect.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agoinclude/elist: Fix clear() to use pop_front()
Sam Lang [Tue, 26 Feb 2013 18:22:47 +0000 (12:22 -0600)]
include/elist: Fix clear() to use pop_front()

elist<T>::clear() is calling remove(), which isn't a
method defined on elist<T> (it was never defined according
to git).  Because elist is templated and no references
to clear() are ever made, the compiler matches remove(T) to the
remove(const char *) system call defined in stdio.h.

Once clear is invoked on an instance of elist<T>, we get the
compile error shown below.

The fix here is to use pop_front() instead of remove().

Compile error is:
In file included from ../../src/mds/CInode.h:22:0,
                 from ../../src/mds/CInode.cc:19:
../../src/include/elist.h: In instantiation of ‘void elist<T>::clear() [with T = cinode_backtrace_info_t*]’:
../../src/mds/CInode.cc:1129:20:   required from here
../../src/include/elist.h:101:7: error: no matching function for call to ‘remove(cinode_backtrace_info_t*)’
../../src/include/elist.h:101:7: note: candidates are:
In file included from ../../src/mds/CInode.cc:17:0:
/usr/include/stdio.h:179:12: note: int remove(const char*)
/usr/include/stdio.h:179:12: note:   no known conversion for argument 1 from ‘cinode_backtrace_info_t*’ to ‘const char*’
In file included from /usr/include/c++/4.7/algorithm:63:0,
                 from /usr/include/c++/4.7/backward/hashtable.h:65,
                 from /usr/include/c++/4.7/ext/hash_map:65,
                 from ../../src/include/encoding.h:292,
                 from ../../src/common/entity_name.h:22,
                 from ../../src/common/config.h:26,
                 from ../../src/mds/CInode.h:20,
                 from ../../src/mds/CInode.cc:19:
/usr/include/c++/4.7/bits/stl_algo.h:1117:5: note: template<class _FIter, class _Tp> _FIter std::remove(_FIter, _FIter, const _Tp&)
/usr/include/c++/4.7/bits/stl_algo.h:1117:5: note:   template argument deduction/substitution failed:
In file included from ../../src/mds/CInode.h:22:0,
                 from ../../src/mds/CInode.cc:19:
../../src/include/elist.h:101:7: note:   candidate expects 3 arguments, 1 provided

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agodencoder: Add inode_backtrace_t to types
Sam Lang [Tue, 19 Feb 2013 16:48:46 +0000 (10:48 -0600)]
dencoder:  Add inode_backtrace_t to types

To test the backtrace attributes on objects, we need
to be able to decode the backtrace using ceph-dencoder.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agomds: Use map for CInode pinrefs
Sam Lang [Tue, 5 Mar 2013 14:28:47 +0000 (08:28 -0600)]
mds: Use map for CInode pinrefs

Implements pin refs on the inode as a map instead of
a multiset, allowing individual ref counts to act as
real references with values that can be >1.
The pin refs are only used for debugging, but allowing
them to be >1 avoids the need for a separate state field
for things like DIRTYPARENT.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agoclient: Ensure inode/dentries are ref counted
Sam Lang [Tue, 26 Feb 2013 00:51:19 +0000 (18:51 -0600)]
client: Ensure inode/dentries are ref counted

The MetaRequest holds onto inodes and dentries
for retrying unsafe requests, but those objects
might be removed from the cache (unlink for example)
causing the inode/dentry to be freed.  Ensure that
the inode/dentry is never freed while the MetaRequest
holds onto it by putting/getting the refs using
set/get interfaces.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agoOSD: split temp collection as well
Samuel Just [Fri, 15 Mar 2013 22:13:46 +0000 (15:13 -0700)]
OSD: split temp collection as well

Otherwise, when we eventually remove the temp collection, there might be
objects in the temp collection which were independently pulled into the child
pg collection.  Thus, removing the old stale parent link from its temp
collection also blasts the omap entries and snap mappings for the real child
object.

Backport: bobtail
Fixes: #4452
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agohobject: fix snprintf args for 32 bit
Samuel Just [Fri, 15 Mar 2013 21:59:39 +0000 (14:59 -0700)]
hobject: fix snprintf args for 32 bit

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>