]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agov0.55.1 v0.55.1
Gary Lowell [Thu, 13 Dec 2012 00:24:34 +0000 (16:24 -0800)]
v0.55.1

12 years agoinit-ceph: =, not ==
Sage Weil [Sat, 8 Dec 2012 17:10:31 +0000 (09:10 -0800)]
init-ceph: =, not ==

Reported-by: v@alan.lt
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodebian: add ceph.postinst to remove /etc/init/ceph.conf on update
Dan Mick [Sat, 8 Dec 2012 00:54:27 +0000 (16:54 -0800)]
debian: add ceph.postinst to remove /etc/init/ceph.conf on update

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoPG: remove last_epoch_started asserts in proc_primary_info
Samuel Just [Tue, 4 Dec 2012 19:36:58 +0000 (11:36 -0800)]
PG: remove last_epoch_started asserts in proc_primary_info

These asserts are valid for a uniform cluster, but they won't hold
for a replica running a version without the info.last_epoch_started
patch.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit 0756052cff542ab02d653b40c37a645b395f31b3)

12 years agoauth: set default auth_client_required
Yehuda Sadeh [Fri, 7 Dec 2012 01:47:02 +0000 (17:47 -0800)]
auth: set default auth_client_required

Fixes: #3578
Set auth_client_required to default to "cephx, none".

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoauth: changed order of test for legacy and new authentication
Peter Reiher [Sat, 8 Dec 2012 00:32:31 +0000 (16:32 -0800)]
auth: changed order of test for legacy and new authentication

Changed order of test for legacy and new configuration options
in several places.

Signed-off-by: Peter Reiher <reiher@inktank.com>
12 years agoauth: improve logging
Yehuda Sadeh [Fri, 7 Dec 2012 02:12:51 +0000 (18:12 -0800)]
auth: improve logging

Add some logging around failure cases.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agomkcephfs: fix fs_type assignment typo
Sage Weil [Thu, 6 Dec 2012 13:27:41 +0000 (05:27 -0800)]
mkcephfs: fix fs_type assignment typo

Reported-by: Matthew Via <via@matthewvia.info>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoupstart: fix radosgw upstart job
Sage Weil [Thu, 6 Dec 2012 13:26:11 +0000 (05:26 -0800)]
upstart: fix radosgw upstart job

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoupstart: rename ceph -> ceph-all
Sage Weil [Thu, 6 Dec 2012 13:26:01 +0000 (05:26 -0800)]
upstart: rename ceph -> ceph-all

This avoids a conflict with the sysvinit job.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: update manpage for import/export
Dan Mick [Thu, 6 Dec 2012 02:17:35 +0000 (18:17 -0800)]
rbd: update manpage for import/export

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agolibrbd: hold AioCompletion lock while modifying global state
Dan Mick [Tue, 4 Dec 2012 04:59:17 +0000 (20:59 -0800)]
librbd: hold AioCompletion lock while modifying global state

C_AioRead::finish needs to add in each chunk of a partial read
request to the 'partial' map in the AioCompletion's state
(in destriper, of type StripedReadResult).  That map is global
and must be protected from simultaneous access.  Use the
AioCompletion lock; could create a separate lock if contention is an
issue.

Fixes: #3567
Signed-off-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit a55700cc0aea0ff79e55c6bf78e9757b81fe9425)

12 years agolibrbd: handle parent change while async I/Os are in flight
Dan Mick [Sat, 1 Dec 2012 02:11:09 +0000 (18:11 -0800)]
librbd: handle parent change while async I/Os are in flight

During a test_librbd_fsx run including flatten, ImageCtx->parent
was being dereferenced while null.  Between the time the parent
overlap is calculated and the time the guard+write completes
with ENOENT and submits the copyup+write, the parent image
could have changed (by resize) or been made irrelevant (by
child flatten) such that the parent overlap is now incorrect.

Handle "no parent" by just sending the copyup+write; the copyup
part will be a no-op.  Move to WRITE_FLAT state in this case
because there's no more child to deal with.

Handle "overlap changed" by recalculating overlap before
reading parent data; if none is left, don't read, but rather
just clear m_object_image_extents, in which case the copyup
will again be a no-op because it will be of zero length.
However we still have a parent, so stay in WRITE_COPYUP state
and come back through as usual.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Fixes: #3524
(cherry picked from commit 41e16a3b40efb80a5ed7a5587438569ca86c85a3)

12 years agoStriper: use local variable inside if() that tested it
Dan Mick [Sat, 1 Dec 2012 01:21:24 +0000 (17:21 -0800)]
Striper: use local variable inside if() that tested it

Signed-off-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit 917a6f296323164f9d79df94916932722e66fc0a)

12 years agov0.55 v0.55
Gary Lowell [Tue, 4 Dec 2012 03:08:35 +0000 (19:08 -0800)]
v0.55

12 years agoceph.spec.in: Add SLES and remove Fedora from debug package list.
Gary Lowell [Tue, 4 Dec 2012 03:06:42 +0000 (19:06 -0800)]
ceph.spec.in:  Add SLES and remove Fedora from debug package list.

12 years agotest_rados_api_misc: fix dup rmmkey test
Sage Weil [Mon, 3 Dec 2012 23:29:56 +0000 (15:29 -0800)]
test_rados_api_misc: fix dup rmmkey test

We now expect ENONET as of 9961640f76a950c674c0e7cc2453931088c63fd7
again.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: EINVAL on unknown TMAP op code
Sage Weil [Wed, 28 Nov 2012 04:04:34 +0000 (20:04 -0800)]
osd: EINVAL on unknown TMAP op code

The old/slow implementation did this, but the optimized version did
not.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: use TMAP_RMSLOPPY op when removing dentries
Sage Weil [Wed, 28 Nov 2012 04:43:38 +0000 (20:43 -0800)]
mds: use TMAP_RMSLOPPY op when removing dentries

After replay, we don't know if the dentry removal has already been
committed.  Use a sloppy removal so that we succeed even if we are
repeating the operation.

Conveniently, the previous implementation (pre v0.55) silently ignored
tmap op codes it did not understand, which means this new RMSLOPPY will
be interpreted the same as an actual RMSLOPPY.  That means an v0.55
mds can run against an older osd (say, argonaut) without problems.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: add TMAP_RMSLOPPY op
Sage Weil [Wed, 28 Nov 2012 04:00:19 +0000 (20:00 -0800)]
osd: add TMAP_RMSLOPPY op

Remove a key, but succeed if key already does not exist.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: ENOENT on TMAP_RM on non-existent key
Sage Weil [Wed, 28 Nov 2012 04:02:54 +0000 (20:02 -0800)]
osd: ENOENT on TMAP_RM on non-existent key

This reverts 29fae494d0b1459c8bb934d42446e0ada7355402 and fixes the
alternate implmentation added by 8e91d00b52808aa1a4e3a838deda34a439.
librbd relies the ENOENT return value.

Reported-by: Dan Mick <dan.mick@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: fix RepModify when past last_peering_reset
Sage Weil [Sun, 2 Dec 2012 03:15:18 +0000 (19:15 -0800)]
osd: fix RepModify when past last_peering_reset

If we apply or commit a RepModify from a prevous perring interval, we need
to free it.

This fixes 'slow request' messages when in fact clients requests are not
delayed, and plugs the related memory leak.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph-osd: put g_ceph_context before exit
Samuel Just [Sat, 1 Dec 2012 01:57:35 +0000 (17:57 -0800)]
ceph-osd: put g_ceph_context before exit

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoReplicatedPG: only increment active_scrub on primary for final push
Samuel Just [Fri, 30 Nov 2012 22:04:53 +0000 (14:04 -0800)]
ReplicatedPG: only increment active_scrub on primary for final push

We only queue the _applied_recovered_object callback on the primary for the
final push.  It is this callback which decrements active_pushes.  It's ok to
not increment active_pushes for the intermediate pushes since these only affact
a temp file.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agomon: PaxosService: cancel proposal timer after election
Joao Eduardo Luis [Fri, 30 Nov 2012 17:16:35 +0000 (17:16 +0000)]
mon: PaxosService: cancel proposal timer after election

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agologrotate: fix rotation
David Zafman [Fri, 30 Nov 2012 02:07:20 +0000 (18:07 -0800)]
logrotate: fix rotation

Fixes: #3554
Always reload with Upstart because in some configs the init.d script doesn't work

Signed-off-by: David Zafman <david.zafman@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip_next_bugs' into next
Sage Weil [Thu, 29 Nov 2012 23:47:26 +0000 (15:47 -0800)]
Merge remote-tracking branch 'gh/wip_next_bugs' into next

12 years agoMerge remote-tracking branch 'gh/wip-mon-osd-create-fix' into next
Sage Weil [Thu, 29 Nov 2012 23:34:32 +0000 (15:34 -0800)]
Merge remote-tracking branch 'gh/wip-mon-osd-create-fix' into next

12 years agoradosgw-admin: close storage before exit
Yehuda Sadeh [Thu, 29 Nov 2012 23:30:17 +0000 (15:30 -0800)]
radosgw-admin: close storage before exit

Fixes: #3560
This will remove watches off notification objects.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoclient: Fix for #3490 and config option to test
Sam Lang [Thu, 29 Nov 2012 18:19:51 +0000 (12:19 -0600)]
client:  Fix for #3490 and config option to test

If the mds revokes our cache cap, and we follow
the _read_sync() path, on a zero-byte file the
osd returns ENOENT.  We need to replace ENOENT
with a return of 0 in this case.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agotest/libcephfs: Test reading an empty file
Sam Lang [Thu, 29 Nov 2012 18:14:19 +0000 (12:14 -0600)]
test/libcephfs:  Test reading an empty file

This tests a bug (#3490) in the Client::_read_sync
codepath, and should be run with conf->client_read_sync_always
set to true.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoPG: scrubber.end should be exactly a boundary
Samuel Just [Wed, 28 Nov 2012 23:10:43 +0000 (15:10 -0800)]
PG: scrubber.end should be exactly a boundary

Let scrubber.end be (foo, HEAD, 10) where the oid is foo , HEAD is the
snap, and 10 is the hash and scrubber.begin similarly be (bar, 5, 1).

After choosing to scan [(bar, 5, 1), (foo, HEAD, 10)), we block writes
on that interval.

1) A write might then come in for foo (which isn't blocked) which
creates a new snap (foo, 400, 10) which happens to fall in the interval.
This will result in a crash in _scrub() when it attempts to compare
clones since it will get (foo, 400, 10) but not the head object
(foo, HEAD, 10).

2) Alternately, the write from 1) has already happened.  When we scan
the log, we find 34'10 and 34'11 are the clone operation creating
(foo, 400, 10) and the modify on (foo, HEAD, 10) respectively.  Both
primary and replica will wait for last_update_applied to be 34'10
before scanning, but last_update_applied will in fact skip to 34'11
since 34'10 and 34'11 happened in the same transaction.  This can
result in IO hanging on the scrubber interval.

Instead, we ensure that scrubber.end is exactly a hash boundary
(min hobject_t a with the specified hash).  No such object can
exist since we don't create objects with empty oids, so no writes
can occur on that object.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoReplicatedPG: remove from snap_collections even without objects to trim
Samuel Just [Thu, 15 Nov 2012 21:35:47 +0000 (13:35 -0800)]
ReplicatedPG: remove from snap_collections even without objects to trim

Also, make sure to write_info after updating snap_collections.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoOSD: get_or_create_pg return null if pool is gone
Samuel Just [Thu, 29 Nov 2012 19:28:25 +0000 (11:28 -0800)]
OSD: get_or_create_pg return null if pool is gone

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoOSD: history.last_epoch_started should start at 0
Samuel Just [Wed, 28 Nov 2012 00:00:03 +0000 (16:00 -0800)]
OSD: history.last_epoch_started should start at 0

history.last_epoch_started marks a lower bound on the last epoch at
which the pg went active.  As with info.last_epoch_started, it should be
0 prior to the first activation.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoPG: maintain osd local last_epoch_started for find_best_info
Samuel Just [Wed, 21 Nov 2012 21:59:22 +0000 (13:59 -0800)]
PG: maintain osd local last_epoch_started for find_best_info

In order to proceed with peering, we need an osd with a log including
the last commit sent to a client.  This translates to the oldest
last_update from the infos of the most recent acting set to go active.
history.last_epoch_started gives us a lower bound on the last time the
entire acting set persisted authoratative logs/infos.  However, it
doesn't indicate anything about the info/log on the osd which sent it.
Thus, we will maintain an osd local info.last_epoch_started to determine
which osds were actually active (and thus have the required log
entries).  The max info.last_epoch_started in the prior set gives us an
upper bound on the last interval during which writes occurred.  The min
last_update among the infos with that last_epoch_started must therefore
be an upper bound on the oldest operation which clients consider
committed.  Any osd with an info.last_updated past that version must be
sufficient.

The observed bug was there was an empty pg info with a
last_epoch_started at the most recent interval which pushed
min_last_update_acceptable to eversion_t().  There were two down osds,
but peering proceeded since the backfill peer did survive.  However,
its info was later disregarded due to incomplete.  An empty osd was
then chosen as the best_info since it's last_update was equal to
min_last_update_acceptable.  This caused the contents of the pg to be
lost.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agohobject_t: make max private
Samuel Just [Thu, 29 Nov 2012 21:51:41 +0000 (13:51 -0800)]
hobject_t: make max private

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoMerge branch 'wip-mon-store-errorcheck' into next
Greg Farnum [Thu, 29 Nov 2012 21:23:02 +0000 (13:23 -0800)]
Merge branch 'wip-mon-store-errorcheck' into next

Reviewed-by: Joao Luis <joao.luis@inktank.com>
12 years agoMerge remote-tracking branch 'origin/wip-rgw-leak' into next
Yehuda Sadeh [Thu, 29 Nov 2012 21:07:09 +0000 (13:07 -0800)]
Merge remote-tracking branch 'origin/wip-rgw-leak' into next

Conflicts:
src/rgw/rgw_main.cc

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agomon: Monitor: don't allow '+' or '-' prefixed values on parse_pos_long()
Joao Eduardo Luis [Thu, 29 Nov 2012 21:03:05 +0000 (21:03 +0000)]
mon: Monitor: don't allow '+' or '-' prefixed values on parse_pos_long()

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon: OSDMonitor: return -EINVAL on not-a-uuid during 'osd create'
Joao Eduardo Luis [Thu, 29 Nov 2012 16:42:16 +0000 (16:42 +0000)]
mon: OSDMonitor: return -EINVAL on not-a-uuid during 'osd create'

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon: add WARN_UNUSED_RESULT to the MonitorStore functions that return error codes
Greg Farnum [Thu, 29 Nov 2012 00:26:54 +0000 (16:26 -0800)]
mon: add WARN_UNUSED_RESULT to the MonitorStore functions that return error codes

Signed-off-by: Greg Farnum <greg@inktank.com>
12 years agomon: remove the silly write_bl_ss write_bl_ss_impl distinction
Greg Farnum [Thu, 29 Nov 2012 00:17:24 +0000 (16:17 -0800)]
mon: remove the silly write_bl_ss write_bl_ss_impl distinction

It was introduced at the same time as all these unchecked return codes,
but I can't tell why.

Signed-off-by: Greg Farnum <greg@inktank.com>
12 years agomon: convert store users with unchecked return codes to just assert on issues
Greg Farnum [Thu, 29 Nov 2012 00:16:15 +0000 (16:16 -0800)]
mon: convert store users with unchecked return codes to just assert on issues

This will make them much more noticeable and reduce the odds of something
writing data which assumes the previous op succeeded.

Signed-off-by: Greg Farnum <greg@inktank.com>
12 years agomon: update Paxos::read()'s successful read check
Greg Farnum [Wed, 28 Nov 2012 22:35:20 +0000 (14:35 -0800)]
mon: update Paxos::read()'s successful read check

It was returning success if it got back an error code; don't do that!

Signed-off-by: Greg Farnum <greg@inktank.com>
12 years agomon: add new get_bl_[sn|ss]_safe functions
Greg Farnum [Wed, 28 Nov 2012 22:27:10 +0000 (14:27 -0800)]
mon: add new get_bl_[sn|ss]_safe functions

These functions are like the non-safe versions, but assert that
there were no disk errors and have void return types. Change a
bunch of callers who weren't checking the return code to use
these variants instead.
(Unfortunately we can't make them default safe because several of
the callers depend on getting back the length, and are perfectly happy
with ENOENT producing a 0 return value.)

Signed-off-by: Greg Farnum <greg@inktank.com>
12 years agomon: In MonitorStore, wrap all uses of ::close and assert success
Greg Farnum [Wed, 28 Nov 2012 20:35:25 +0000 (12:35 -0800)]
mon: In MonitorStore, wrap all uses of ::close and assert success

Signed-off-by: Greg Farnum <greg@inktank.com>
12 years agocreate qa/workunits/rbd/map-unmap.sh
Alex Elder [Wed, 28 Nov 2012 23:07:43 +0000 (17:07 -0600)]
create qa/workunits/rbd/map-unmap.sh

This adds a bash script that creates an rbd image, then repeatedly
maps and unmaps it for a specified duration (5 minutes by default).

Signed-off-by: Alex Elder <elder@inktank.com>
12 years agolog: 10,000 recent log entries
Sage Weil [Wed, 28 Nov 2012 21:00:36 +0000 (13:00 -0800)]
log: 10,000 recent log entries

This is what we were (wrongly) doing before, so there are no memory
utilization surprises.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolog: fix log_max_recent config
Sage Weil [Wed, 28 Nov 2012 20:59:43 +0000 (12:59 -0800)]
log: fix log_max_recent config

<facepalm>

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: check all uses of fsync in the MonitorStore for errors
Greg Farnum [Wed, 28 Nov 2012 20:35:11 +0000 (12:35 -0800)]
mon: check all uses of fsync in the MonitorStore for errors

This can sometimes return errors since it's a storage access, and
we're pretty sure ignoring it is the cause of a broken store we've seen.

Signed-off-by: Greg Farnum <greg@inktank.com>
12 years agorbd: fix import from stdin, add test
Dan Mick [Wed, 28 Nov 2012 00:54:43 +0000 (16:54 -0800)]
rbd: fix import from stdin, add test

Make import work; do I/O in image native block size.
Note: creating sparse images is not currently attempted; could
scan for runs of zeros and write discontiguous chunks to image.

Fixes: #3503
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit c99d9c3ae782597984f0c67dd1488fb95bd2ce54)

12 years agorbd: allow export to stdout, add tests
Dan Mick [Wed, 28 Nov 2012 01:06:43 +0000 (17:06 -0800)]
rbd: allow export to stdout, add tests

Fixes: #3502
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit a738f44bc4e23c8ad18f24a835fe253d5b27b9d9)

12 years agomon: fix compiler warning
Sage Weil [Wed, 28 Nov 2012 19:11:53 +0000 (11:11 -0800)]
mon: fix compiler warning

signed/unsigned comparison

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: do not crash on invalid 'mon tell N ...' target
Sage Weil [Wed, 28 Nov 2012 04:47:31 +0000 (20:47 -0800)]
mon: do not crash on invalid 'mon tell N ...' target

Fixes: #3545
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoconfig: make $pid a metavariable
Sage Weil [Tue, 27 Nov 2012 01:46:14 +0000 (17:46 -0800)]
config: make $pid a metavariable

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agotest_rados_api_misc: fix TMAPPUT sorting test
Sage Weil [Wed, 28 Nov 2012 00:52:30 +0000 (16:52 -0800)]
test_rados_api_misc: fix TMAPPUT sorting test

Several things wrong here.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoREADME: add the libboost-thread-dev dep to the list
Sam Lang [Tue, 27 Nov 2012 23:21:40 +0000 (17:21 -0600)]
README: add the libboost-thread-dev dep to the list

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoMerge branch 'wip-mds-next' into next
Sage Weil [Tue, 27 Nov 2012 22:13:09 +0000 (14:13 -0800)]
Merge branch 'wip-mds-next' into next

OSD bits Reviewed-by: Sam Just <sam.just@inktank.com>
MDS bits Reviewed-by: Sage Weil <sage@inktank.com>

12 years agoosd: detect (some) misordered ondisk tmaps
Sage Weil [Mon, 26 Nov 2012 21:17:30 +0000 (13:17 -0800)]
osd: detect (some) misordered ondisk tmaps

Detect a misordered ondisk tmap... if we are already decoding it.  We still
leave the trailing bits unchecked.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: verify TMAPPUT data is sorted
Sage Weil [Mon, 26 Nov 2012 16:25:20 +0000 (08:25 -0800)]
osd: verify TMAPPUT data is sorted

The MDS may try to write unsorted data; make sure it is sorted before
we write it.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: do not ENOENT on missing key on remove
Sage Weil [Sun, 25 Nov 2012 22:27:23 +0000 (14:27 -0800)]
osd: do not ENOENT on missing key on remove

The MDS may include RM ops in a tmap update for items that were already
removed: after restarting and replaying the journal, it doesn't know
which dentries were previously committed and which were not.

No other (known) users care about the error code.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: tolerate misordered TMAP updates
Sage Weil [Sun, 25 Nov 2012 22:24:08 +0000 (14:24 -0800)]
osd: tolerate misordered TMAP updates

The previous tmap implementation requires that the update stream be
sorted or else it will behave erratically (by placing new keys in the
map out of order).  This can cause very strange failures: reads may
appear to return the correct result initially, but once intervening
keys are remove they will not... depending on how read is implemented
on the client side.

Fix this by doing the optimized updates initially, but falling back to
a slow implementation if an unsorted update is detected.  It is slow,
but such updates are rare.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: move tmapup into a helper
Sage Weil [Sun, 25 Nov 2012 21:54:08 +0000 (13:54 -0800)]
osd: move tmapup into a helper

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd workunit: Add tests for clones across pools
Dan Mick [Tue, 27 Nov 2012 05:29:53 +0000 (21:29 -0800)]
rbd workunit: Add tests for clones across pools

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit ece11b0ed97ac6207980b412e3b2afe869065fff)

12 years agorbd workunit: Make "remove_images" silent
Dan Mick [Tue, 27 Nov 2012 05:29:37 +0000 (21:29 -0800)]
rbd workunit: Make "remove_images" silent

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 0be9b15b7972252505cbd838fd9d45e0e04404bf)

12 years agorbd workunit: Add tests for cross-pool rename
Dan Mick [Tue, 27 Nov 2012 04:42:05 +0000 (20:42 -0800)]
rbd workunit: Add tests for cross-pool rename

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit a96ede944f1a227960877dee715b1f96895b4228)

12 years agorbd: tests for copy with explicit/implicit pool names
Dan Mick [Fri, 16 Nov 2012 06:49:16 +0000 (22:49 -0800)]
rbd: tests for copy with explicit/implicit pool names

Validate change to not assume dest pool == src pool

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 39180430b9be14a94502b7e5bef30dd582ce3ad8)

12 years agorbd: fix import pool assumptions
Dan Mick [Fri, 16 Nov 2012 06:41:36 +0000 (22:41 -0800)]
rbd: fix import pool assumptions

import allows specifying one image, implicitly or explicitly the
"source" image, even though it's really the destination.  Fix up
the reassignment of 'source' to 'dest', and check for and complain
about specifying two different pools or images for import.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit c219698149c2fe4d2539f0bc1e2009b937aa4250)

12 years agorbd: change destpool assumptions.
Dan Mick [Thu, 15 Nov 2012 23:55:10 +0000 (15:55 -0800)]
rbd: change destpool assumptions.

Don't default destpool to srcpool; it's surprising, and
not useful/helpful enough to violate the convention that
"default pool is rbd"

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 3b0c36052806a4574ede6a9f0594dc83f7997bcc)

12 years agorbd: --size fixes
Dan Mick [Thu, 15 Nov 2012 22:52:39 +0000 (14:52 -0800)]
rbd: --size fixes

* require --size/-s for both create *and* resize
* explicitly permit create with size 0.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 08f47a42b5dcf77c40e3c1472739554452993412)

12 years agorbd: allow parsing image@snap even if --pool given
Dan Mick [Thu, 15 Nov 2012 22:41:46 +0000 (14:41 -0800)]
rbd: allow parsing image@snap even if --pool given

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit e452df6dadd443d135527b49784a47ad21429cc1)

12 years agoMerge remote-tracking branch 'gh/wip-mon-workloadgen' into next
Sage Weil [Tue, 27 Nov 2012 20:54:40 +0000 (12:54 -0800)]
Merge remote-tracking branch 'gh/wip-mon-workloadgen' into next

12 years agotest: mon: run_test.sh: helper script for the mon's workloadgen
Joao Eduardo Luis [Tue, 30 Oct 2012 21:47:33 +0000 (21:47 +0000)]
test: mon: run_test.sh: helper script for the mon's workloadgen

Takes advantage of qa/workunits/mon/workloadgen.sh to avoid duplicating
code.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agoqa: workunits: mon: add workloadgen's workunit
Joao Eduardo Luis [Sun, 4 Nov 2012 17:40:19 +0000 (17:40 +0000)]
qa: workunits: mon: add workloadgen's workunit

Uses test/mon/test_osd_workloadgen to generate a bunch of map
changes

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agotest: mon: workload generator
Joao Eduardo Luis [Fri, 26 Oct 2012 21:59:00 +0000 (22:59 +0100)]
test: mon: workload generator

User-space tool that interacts with the monitor, with the objective of
generating a workload mimicking a set of OSDs and clients.

As it is, the tool will mimic any number of OSDs, by keeping in-memory
stubs that will act as independent OSDs, generating random operations
that will induce map updates; the client stub, on the other hand,
performs no operations besides connecting to the monitor and whatever
happens between the Objecter class and the monitor (mainly keeping
updated with map updates).

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomessages: MLog: make ctor's uuid argument a const
Joao Eduardo Luis [Sun, 4 Nov 2012 17:38:28 +0000 (17:38 +0000)]
messages: MLog: make ctor's uuid argument a const

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon: Monitor: use existing strict_strtol() on parse_pos_long()
Joao Eduardo Luis [Tue, 30 Oct 2012 22:46:24 +0000 (22:46 +0000)]
mon: Monitor: use existing strict_strtol() on parse_pos_long()

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agocrush: relax the order by which rules and buckets must be defined
Joao Eduardo Luis [Tue, 30 Oct 2012 21:37:47 +0000 (21:37 +0000)]
crush: relax the order by which rules and buckets must be defined

Before we only allowed buckets (say, 'root') to be defined *before*
rules.

With this patch, we allow buckets and rules to be defined by any order,
although some care should be taken when creating the plain-text crush
map, or the crushtool will error out when a rule uses a bucket only
defined later on in the file.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agocrushtool: rework how verbosity works
Joao Eduardo Luis [Tue, 30 Oct 2012 21:27:15 +0000 (21:27 +0000)]
crushtool: rework how verbosity works

'verbose' was a bool that would either be passed as one or zero to class
CrushCompile. However, most messages would only be outputted with a
verbose level > 1.

This patch makes it so that multiple '-v' increase the verbosity level;
i.e., -v mean verbose = 1; -v -v means verbose = 2; and so forth.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-perf' into next
Sage Weil [Tue, 27 Nov 2012 17:29:03 +0000 (09:29 -0800)]
Merge remote-tracking branch 'gh/wip-perf' into next

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-crush' into next
Sage Weil [Tue, 27 Nov 2012 17:28:18 +0000 (09:28 -0800)]
Merge remote-tracking branch 'gh/wip-crush' into next

12 years agofix syncfs handling in error case
Danny Al-Gaaf [Tue, 27 Nov 2012 15:54:40 +0000 (16:54 +0100)]
fix syncfs handling in error case

If the call to syncfs() fails, don't try to call syncfs again via
syscall(). If HAVE_SYS_SYNCFS is defined, don't fall through to try
syscall() with SYS_syncfs or __NR_syncfs.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds: don't add not issued caps when confirming cap receipt
Yan, Zheng [Mon, 19 Nov 2012 02:43:35 +0000 (10:43 +0800)]
mds: don't add not issued caps when confirming cap receipt

There is message ordering race in cephfs kernel client. We compose
cap messages when i_ceph_lock is hold. But when adding messages
to the output queue, the kernel releases i_ceph_lock and acquires
a mutex. So it is possible that cap messages are send out of order.
If the kernel client send a cap update, then send a cap release,
but the two messages reach MDS out of order. The update message
will re-add the released caps. This patch adds code to check if
caps were actually issued when confirming cap receipt.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: check parent inode's versionlock when propagating rstats
Yan, Zheng [Mon, 19 Nov 2012 02:43:41 +0000 (10:43 +0800)]
mds: check parent inode's versionlock when propagating rstats

To propagate rstats to one level up, we need lock both parent
inode's nestlock and versionlock.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: fix anchor table update
Yan, Zheng [Mon, 19 Nov 2012 02:43:34 +0000 (10:43 +0800)]
mds: fix anchor table update

The reference count of an anchor table entry that corresponds to
directory is number of anchored inodes under the directory. But
when updating anchor trace for an directory inode, the code only
increases/decreases its new/old ancestor anchor table entries'
reference counts by one.

This patch probably resolves BUG #1850.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: don't expire log segment before it's fully flushed
Yan, Zheng [Mon, 19 Nov 2012 02:43:33 +0000 (10:43 +0800)]
mds: don't expire log segment before it's fully flushed

Expiring log segment before it's fully flushed may cause various
issues during log replay.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agoosdc/ObjectCacher: remove unused waitfor_{rd,wr}
Sage Weil [Tue, 27 Nov 2012 05:11:13 +0000 (21:11 -0800)]
osdc/ObjectCacher: remove unused waitfor_{rd,wr}

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: *do* pin object during write
Sage Weil [Tue, 27 Nov 2012 05:13:32 +0000 (21:13 -0800)]
osdc/ObjectCacher: *do* pin object during write

This hopefully resolves #3431.

We originally did this in 46897fd4ffc2fe2fc2cc0c39b5d4c510df1e6c25, and
then reverted in caed0e917f8044d389d01de5ee5ecbf0d16ff349.

The current conundrum:
 - commit_set() will issue a write and queue a waiter on a tid
 - discard will discard all BufferHeads and unpin the object
 - trim will try to close and fail assert(ob->can_close())

But:
 - we can't wake the waiter on discard because we don't know what range(s)
   it is waiting for; discard needn't be the whole object.

So: pin the object so it doesn't get trimmed, and unpin when we write.

Adjust can_close() so that it is based on the lru pin status, and assert
that pinned implies the previous conditions are all true.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Sam Lang <sam.lang@inktank.com>
12 years agomon, osd: adjust msgr requires for CRUSH_TUNABLES2 feature
Sage Weil [Mon, 26 Nov 2012 00:52:25 +0000 (16:52 -0800)]
mon, osd: adjust msgr requires for CRUSH_TUNABLES2 feature

Make this code a bit manageable for multiple features.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocrush: introduce CRUSH_TUNABLES2 feature
Sage Weil [Mon, 26 Nov 2012 00:51:57 +0000 (16:51 -0800)]
crush: introduce CRUSH_TUNABLES2 feature

For the chooseleaf_descend_once flag.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocrush: for chooseleaf rules, retry CRUSH map descent from root if leaf is failed
Jim Schutt [Mon, 10 Sep 2012 21:43:19 +0000 (15:43 -0600)]
crush: for chooseleaf rules, retry CRUSH map descent from root if leaf is failed

Consider the CRUSH rule
  step chooseleaf firstn 0 type <node_type>

This rule means that <n> replicas will be chosen in a manner such that
each chosen leaf's branch will contain a unique instance of <node_type>.

When an object is re-replicated after a leaf failure, if the CRUSH map uses
a chooseleaf rule the remapped replica ends up under the <node_type> bucket
that held the failed leaf.  This causes uneven data distribution across the
storage cluster, to the point that when all the leaves but one fail under a
particular <node_type> bucket, that remaining leaf holds all the data from
its failed peers.

This behavior also limits the number of peers that can participate in the
re-replication of the data held by the failed leaf, which increases the
time required to re-replicate after a failure.

For a chooseleaf CRUSH rule, the tree descent has two steps: call them the
inner and outer descents.

If the tree descent down to <node_type> is the outer descent, and the descent
from <node_type> down to a leaf is the inner descent, the issue is that a
down leaf is detected on the inner descent, so only the inner descent is
retried.

In order to disperse re-replicated data as widely as possible across a
storage cluster after a failure, we want to retry the outer descent. So,
fix up crush_choose() to allow the inner descent to return immediately on
choosing a failed leaf.  Wire this up as a new CRUSH tunable.

Note that after this change, for a chooseleaf rule, if the primary OSD
in a placement group has failed, choosing a replacement may result in
one of the other OSDs in the PG colliding with the new primary.  This
requires that OSD's data for that PG to need moving as well.  This
seems unavoidable but should be relatively rare.

Signed-off-by: Jim Schutt <jaschut@sandia.gov>
12 years agorgw: document ops logging setup
Yehuda Sadeh [Mon, 26 Nov 2012 23:54:06 +0000 (15:54 -0800)]
rgw: document ops logging setup

Fixes: #3530
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: usage REST api handles cateogories
Yehuda Sadeh [Mon, 26 Nov 2012 22:56:18 +0000 (14:56 -0800)]
rgw: usage REST api handles cateogories

Fixes: #3528
The usage REST api was missing the categories filter.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoperfcounters: fl -> time, use u64 nsec instead of double
Sage Weil [Mon, 26 Nov 2012 22:34:44 +0000 (14:34 -0800)]
perfcounters: fl -> time, use u64 nsec instead of double

(Almost) all current float users are actually time values, so switch to
a utime_t-based interface and internally using nsec in a u64.  This avoids
using floating point in librbd, which is problematic for windows VMs that
leave the FPU in an unfriendly state.

There are two non-time users in the mds and osd that log the CPU load.
Just multiply those values by 100 and report as ints instead.

Fixes: #3521
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoperfcounters: add 'perf' option to disable perf counters
Sage Weil [Sat, 24 Nov 2012 17:30:07 +0000 (09:30 -0800)]
perfcounters: add 'perf' option to disable perf counters

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agologrotate on systems without invoke-rc.d
Alexandre Oliva [Mon, 26 Nov 2012 21:13:46 +0000 (13:13 -0800)]
logrotate on systems without invoke-rc.d

The which command doesn't output anything to stdout when it can't find
the given program name, and then [ -x ] passes.  Use the exit status
of which to tell whether the command exists, before testing whether
it's executable, to fix it.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
12 years agoSearch for srcdir/.git in check_version
Alexandre Oliva [Mon, 26 Nov 2012 21:13:45 +0000 (13:13 -0800)]
Search for srcdir/.git in check_version

Support srcdir != . looking for .git in srcdir when computing the ceph
release and git tag.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
12 years agorgw: POST requests not default to init multipart upload
Yehuda Sadeh [Mon, 26 Nov 2012 18:15:32 +0000 (10:15 -0800)]
rgw: POST requests not default to init multipart upload

Fixes: #3516
We don't default to init multipart upload request when
getting S3 POST. This way when the request is not really
init multipart upload we'd end up sending a 405 response
instead of 500. Also, it's cleaner this way.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agojava: add ceph_open_layout interface
Noah Watkins [Tue, 20 Nov 2012 21:07:00 +0000 (13:07 -0800)]
java: add ceph_open_layout interface

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>