]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
11 years agolibrados: implement ObjectIterator copying and assignment 1294/head
Josh Durgin [Fri, 21 Feb 2014 01:28:11 +0000 (17:28 -0800)]
librados: implement ObjectIterator copying and assignment

Copied iterators should be independent of each other, and not
rely on the same underlying ListContext or ObjListCtx.

Add some tests for this to make sure they work in various
circumstances.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agolibrados: don't destroy ObjListCtx when iterator reaches the end
Josh Durgin [Fri, 21 Feb 2014 23:52:59 +0000 (15:52 -0800)]
librados: don't destroy ObjListCtx when iterator reaches the end

There's no need to destroy it when we've used it once. It'll get destroyed
by the destructor anyway. Now that there's a seek method, we might want seek
and iterate again anyway, which is not possible if the ObjListCtx is gone.

Change get_next() to check the underlying ObjListCtx for the end of iteration
instead of deleting ObjListCtx, and modify the equality operator to count
the end marker (with ctx == NULL) as equal to having a ObjListCtx at the
end of its list.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agolibrados: remove extra advance from objects_begin(position)
Josh Durgin [Fri, 21 Feb 2014 01:30:54 +0000 (17:30 -0800)]
librados: remove extra advance from objects_begin(position)

ObjectIterator::seek() already calls get_next() to update the
iterator's state. Calling it again goes one past where it should be.

When the iterator reached the end of the list, it deleted the ListCtx,
causing a segfault on further accesses.

Fixes: #7491
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoMerge remote-tracking branch 'origin/port/updates' into firefly
Josh Durgin [Fri, 21 Feb 2014 22:46:27 +0000 (14:46 -0800)]
Merge remote-tracking branch 'origin/port/updates' into firefly

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoMerge remote-tracking branch 'origin/wip-6936' into firefly
Josh Durgin [Fri, 21 Feb 2014 21:10:47 +0000 (13:10 -0800)]
Merge remote-tracking branch 'origin/wip-6936' into firefly

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoMerge remote-tracking branch 'origin/wip-7099' into firefly
Josh Durgin [Fri, 21 Feb 2014 21:09:52 +0000 (13:09 -0800)]
Merge remote-tracking branch 'origin/wip-7099' into firefly

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoMerge remote-tracking branch 'origin/wip-6830' into firefly
Josh Durgin [Fri, 21 Feb 2014 21:08:21 +0000 (13:08 -0800)]
Merge remote-tracking branch 'origin/wip-6830' into firefly

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoMerge remote-tracking branch 'origin/wip-6951' into firefly
Josh Durgin [Fri, 21 Feb 2014 21:07:34 +0000 (13:07 -0800)]
Merge remote-tracking branch 'origin/wip-6951' into firefly

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoMerge remote-tracking branch 'origin/wip-7064' into firefly
Josh Durgin [Fri, 21 Feb 2014 21:06:37 +0000 (13:06 -0800)]
Merge remote-tracking branch 'origin/wip-7064' into firefly

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoMerge remote-tracking branch 'origin/wip-7271' into firefly
Josh Durgin [Fri, 21 Feb 2014 21:05:49 +0000 (13:05 -0800)]
Merge remote-tracking branch 'origin/wip-7271' into firefly

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agodencoder: check for radosgw build option 1288/head
Noah Watkins [Fri, 21 Feb 2014 21:00:29 +0000 (13:00 -0800)]
dencoder: check for radosgw build option

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
11 years agoosd: use ceph scoped shared_ptr
Noah Watkins [Fri, 21 Feb 2014 21:00:09 +0000 (13:00 -0800)]
osd: use ceph scoped shared_ptr

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
11 years agoMerge remote-tracking branch 'upstream/next'
Samuel Just [Fri, 21 Feb 2014 01:04:14 +0000 (17:04 -0800)]
Merge remote-tracking branch 'upstream/next'

11 years agoMerge remote-tracking branch 'upstream/wip-copyget' into next
Samuel Just [Fri, 21 Feb 2014 01:02:17 +0000 (17:02 -0800)]
Merge remote-tracking branch 'upstream/wip-copyget' into next

Fixes: #7471
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoPG::build_might_have_unfound: skip CRUSH_ITEM_NONE 1278/head
Samuel Just [Fri, 21 Feb 2014 00:00:52 +0000 (16:00 -0800)]
PG::build_might_have_unfound: skip CRUSH_ITEM_NONE

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoECBackend: deal with temp collection details in handle_sub_write
Samuel Just [Thu, 20 Feb 2014 23:01:07 +0000 (15:01 -0800)]
ECBackend: deal with temp collection details in handle_sub_write

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoReplicatedPG::on_global_recover: requeue degraded, then unreadable
Samuel Just [Thu, 20 Feb 2014 21:15:51 +0000 (13:15 -0800)]
ReplicatedPG::on_global_recover: requeue degraded, then unreadable

We need to requeue in reverse order since we are requeueing at the
front.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agorgw: minor cleanup
Yehuda Sadeh [Thu, 20 Feb 2014 17:01:21 +0000 (09:01 -0800)]
rgw: minor cleanup

Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agoFix generate keystone token from credentials
Mouad Benchchaoui [Thu, 20 Feb 2014 16:06:33 +0000 (17:06 +0100)]
Fix generate keystone token from credentials

Request to v2.0/tokens must be a POST request and the request
should specify JSON in the content-type header and fix request
body JSON generation to have the right JSON format.

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Signed-off-by: Mouad Benchchaoui <m.benchchaoui@x-ion.de>
11 years agoMerge branch 'next'
Ken Dreyer [Thu, 20 Feb 2014 03:05:51 +0000 (03:05 +0000)]
Merge branch 'next'

Conflicts:
src/test/admin_socket.cc

Signed-off-by: Ken Dreyer <ken.dreyer@inktank.com>
11 years agoRadosModel: copyfrom should result in a dirty object
Samuel Just [Thu, 20 Feb 2014 02:41:19 +0000 (18:41 -0800)]
RadosModel: copyfrom should result in a dirty object

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoPG: fix scrub feature check
Samuel Just [Thu, 20 Feb 2014 02:22:34 +0000 (18:22 -0800)]
PG: fix scrub feature check

acting[0] isn't necessarily the primary.  Start at
0 and explicitely skip the primary.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoReplicatedPG: assert no omap for ec pool in _write_copy_chunk and skip
Samuel Just [Thu, 20 Feb 2014 00:17:17 +0000 (16:17 -0800)]
ReplicatedPG: assert no omap for ec pool in _write_copy_chunk and skip

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoECBackend: handle short reads
Samuel Just [Wed, 19 Feb 2014 23:50:16 +0000 (15:50 -0800)]
ECBackend: handle short reads

async reads may have a length past the end of the object.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoReplicatedPG: ensure that ec appends are aligned
Samuel Just [Wed, 19 Feb 2014 22:26:51 +0000 (14:26 -0800)]
ReplicatedPG: ensure that ec appends are aligned

When not writing out the last chunk, _write_copy_chunk
will trim the chunk to a stripe boundary for ec pools
and adjust cursor.data_offset to compensate.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoReplicatedPG::fill_in_copy_get, use getattr_maybe_cache
Samuel Just [Wed, 19 Feb 2014 21:54:02 +0000 (13:54 -0800)]
ReplicatedPG::fill_in_copy_get, use getattr_maybe_cache

Also, add user_only flag to getattr_maybe_cache and cleanup
the other user.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoReplicatedPG: fix stat uses to use the correct shard
Samuel Just [Wed, 19 Feb 2014 21:49:20 +0000 (13:49 -0800)]
ReplicatedPG: fix stat uses to use the correct shard

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoOSDMap::_apply_primary_affinity: skip CRUSH_ITEM_NONE in non-default check
Samuel Just [Wed, 19 Feb 2014 23:19:03 +0000 (15:19 -0800)]
OSDMap::_apply_primary_affinity: skip CRUSH_ITEM_NONE in non-default check

Fixes: #7482
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
11 years agodoc/release-notes: v0.77
Sage Weil [Thu, 20 Feb 2014 00:57:25 +0000 (16:57 -0800)]
doc/release-notes: v0.77

Also pending notes for v0.78

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agodoc/release-notes: v0.67.7
Sage Weil [Thu, 20 Feb 2014 00:20:35 +0000 (16:20 -0800)]
doc/release-notes: v0.67.7

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agov0.77 v0.77
Ken Dreyer [Wed, 19 Feb 2014 22:54:44 +0000 (22:54 +0000)]
v0.77

11 years agoosd/,mon/: add (up|acting)_primary to pg_stat_t
Samuel Just [Wed, 19 Feb 2014 20:16:46 +0000 (12:16 -0800)]
osd/,mon/: add (up|acting)_primary to pg_stat_t

We use pg_stat_t information to determine pg create targeting.

Fixes: #7481
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoMerge pull request #1256 from ceph/wip-librados-ops-and-rvals
Josh Durgin [Wed, 19 Feb 2014 19:18:57 +0000 (11:18 -0800)]
Merge pull request #1256 from ceph/wip-librados-ops-and-rvals

librados c api for object operations and a few bug fixes

Reviewed-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Loic Dachary <loic@dachary.org>
Reviewed-by: Sage Weil <sage.weil@inktank.com>
11 years agorgw: fix swift range response 1274/head
Yehuda Sadeh [Wed, 19 Feb 2014 16:59:07 +0000 (08:59 -0800)]
rgw: fix swift range response

Fixes: #7099
Backport: dumpling
The range response header was broken in swift.

Reported-by: Julien Calvet <julien.calvet@neurea.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agorgw: fix etag in multipart complete 1273/head
Yehuda Sadeh [Wed, 19 Feb 2014 16:30:51 +0000 (08:30 -0800)]
rgw: fix etag in multipart complete

Fixes: #6830
The etag member variable was not set correctly.

Reported-by: Benjamin Gilbert <bgilbert@backtick.net>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agorgw: reset objv tracker on bucket recreation 1272/head
Yehuda Sadeh [Wed, 19 Feb 2014 16:11:56 +0000 (08:11 -0800)]
rgw: reset objv tracker on bucket recreation

Fixes: #6951
If we cannot create a new bucket (as it already existed), we need to
read the old bucket's info. However, this was failing as we were holding
the objv tracker that we created for the bucket creation. We need to
clear it, as subsequent read using it will fail.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agoradosgw-admin: don't generate access key if user exists 1271/head 1275/head
Yehuda Sadeh [Wed, 19 Feb 2014 18:27:14 +0000 (10:27 -0800)]
radosgw-admin: don't generate access key if user exists

Fixes: #6936
We want the user creation operation to be idempotent, so if user already
exists don't generate a new access key.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agoPG: insert into stray set if !us_up() && !is_acting()
Samuel Just [Wed, 19 Feb 2014 00:08:12 +0000 (16:08 -0800)]
PG: insert into stray set if !us_up() && !is_acting()

This is simpler than checking actingbackfill
since it may not yet be filled in.

Fixes: #7470
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoMerge pull request #1257 from ceph/wip-agent
Sage Weil [Wed, 19 Feb 2014 05:10:04 +0000 (21:10 -0800)]
Merge pull request #1257 from ceph/wip-agent

osd: a few agent fixes

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoosd/ReplicatedPG: EOPNOTSUPP on hit_set_get on non-replicated pools 1257/head
Sage Weil [Wed, 19 Feb 2014 05:02:43 +0000 (21:02 -0800)]
osd/ReplicatedPG: EOPNOTSUPP on hit_set_get on non-replicated pools

We need to use the async read stuff for this to work.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd/ReplicatedPG: load older HitSets into memory
Sage Weil [Wed, 19 Feb 2014 05:02:15 +0000 (21:02 -0800)]
osd/ReplicatedPG: load older HitSets into memory

If our evict_mode is non-idle, load older HitSets into memory in the agent
work thread.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd/ReplicatedPG: strengthen agent_work assertions
Sage Weil [Mon, 17 Feb 2014 22:46:55 +0000 (14:46 -0800)]
osd/ReplicatedPG: strengthen agent_work assertions

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoOSD: consider up/acting primary for new intervals
Samuel Just [Tue, 18 Feb 2014 23:25:33 +0000 (15:25 -0800)]
OSD: consider up/acting primary for new intervals

Both acting_up_affected and start_peering_interval need
to consider primary changes as well as acting/up changes.

Fixes: #7469
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agorgw: don't try to read bucket's policy if it doesn't exist 1266/head
Yehuda Sadeh [Wed, 19 Feb 2014 02:14:40 +0000 (18:14 -0800)]
rgw: don't try to read bucket's policy if it doesn't exist

It's going to fail anyway, just build a default policy.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agorgw: return error if accessing object in non-existent bucket
Yehuda Sadeh [Wed, 19 Feb 2014 00:43:48 +0000 (16:43 -0800)]
rgw: return error if accessing object in non-existent bucket

Fixes: #7064
Instead of trying to access the object, which is impossible as we don't
even have a proper bucket info. Up until now we ended up creating an
empty pool and eventually returning ENOENT, this fix catches the issue
earlier in the process.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agoMerge pull request #1259 from ceph/wip-6677
Josh Durgin [Tue, 18 Feb 2014 23:38:34 +0000 (15:38 -0800)]
Merge pull request #1259 from ceph/wip-6677

rgw: add compatibility for MultipartUpload

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoMerge pull request #1258 from ceph/wip-rgw-gc
Josh Durgin [Tue, 18 Feb 2014 23:37:58 +0000 (15:37 -0800)]
Merge pull request #1258 from ceph/wip-rgw-gc

radosgw-admin: gc list --include-all

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoradosgw-admin: gc list --include-all 1258/head
Yehuda Sadeh [Tue, 18 Feb 2014 19:45:15 +0000 (11:45 -0800)]
radosgw-admin: gc list --include-all

A new option to the radosgw-admin gc list command that dumps *all* gc
entries, and not just the expired ones. This is useful for debugging.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agoMerge pull request #1261 from ceph/wip-7463
Josh Durgin [Tue, 18 Feb 2014 21:41:35 +0000 (13:41 -0800)]
Merge pull request #1261 from ceph/wip-7463

ceph_rest_api.py: don't fail if no up OSDs found on startup

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoThrow a Timeout exception on timeout.
Mike Lundy [Tue, 11 Feb 2014 23:58:06 +0000 (15:58 -0800)]
Throw a Timeout exception on timeout.

Signed-off-by: Mike Lundy <mike@fluffypenguin.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoMerge pull request #1214 from ceph/wip-rgw-manifest-2
Josh Durgin [Tue, 18 Feb 2014 21:07:53 +0000 (13:07 -0800)]
Merge pull request #1214 from ceph/wip-rgw-manifest-2

Wip rgw manifest 2
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agodencoder: fix for new rgw manifest code 1214/head
Yehuda Sadeh [Sat, 8 Feb 2014 01:00:07 +0000 (17:00 -0800)]
dencoder: fix for new rgw manifest code

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agocls/rgw: fix debug output
Yehuda Sadeh [Sat, 8 Feb 2014 00:34:52 +0000 (16:34 -0800)]
cls/rgw: fix debug output

print the correct error value

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agotest/rgw: manifest unitest
Yehuda Sadeh [Mon, 3 Feb 2014 22:58:00 +0000 (14:58 -0800)]
test/rgw: manifest unitest

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agorgw: scalable manifest object
Yehuda Sadeh [Fri, 31 Jan 2014 00:05:42 +0000 (16:05 -0800)]
rgw: scalable manifest object

Define a new manifest structure. The idea is that the manifest defines a
set of rules for structuring the object parts. There are a few terms to
note:
 - head: the head part of the object, which is the part that contains
   the first chunk of data. An object might not have a head (as in the
   case of multipart-part objects.
 - stripe: data portion of a single rgw object that resides on a single
   rados object.
 - part: a collection of stripes that make a contiguous part of an
   object. A regular object will only have one part (although might have
   many stripes), a multipart object might have many parts. Each part
   has a fixed stripe size, although the last stripe of a part might
   be smaller than that. Consecutive parts may be merged if their stripe
   value is the same.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agoceph_rest_api.py: don't fail if no up OSDs found on startup 1260/head 1261/head
Dan Mick [Tue, 18 Feb 2014 21:07:32 +0000 (13:07 -0800)]
ceph_rest_api.py: don't fail if no up OSDs found on startup

allow find_up_osd() to return None, and have caller check for it

Fixes: #7463
Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agotest/librados: remove unused lines and fix return code for cmp guards 1256/head
Josh Durgin [Tue, 18 Feb 2014 01:09:26 +0000 (17:09 -0800)]
test/librados: remove unused lines and fix return code for cmp guards

Now that return values are actually set by the osd and client, fix up
the tests that were checking the old behavior.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoReplicatedPG: fix successful write condition
Josh Durgin [Tue, 18 Feb 2014 06:42:13 +0000 (22:42 -0800)]
ReplicatedPG: fix successful write condition

ctx->modify no longer implies that the operation is a write,
if it ever did. These days op->may_write() is checked reliably
on the OSD, so just use that instead.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoReplicatedPG: clear osd op reply output for writes
Josh Durgin [Tue, 18 Feb 2014 06:35:13 +0000 (22:35 -0800)]
ReplicatedPG: clear osd op reply output for writes

Since the vector of OSDOps used by the reply is the same
as the one processed by do_osd_ops() now, any output data
needs to be cleared for writes. To be compatible with current behavior,
allow writes that aren't applying anything or have failed to return data
still.

Add a new parameter to the MOSDOpReply constructor to determine
whether the output data should be cleared. Clear it for successful
writes, and remove a redundant result < 0 -> result > 0 check in the
process.  This was caught by ceph_test_cls_hello and its
writes_dont_return_data method.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoReplicatedPG: set individual osd op rvals
Josh Durgin [Fri, 7 Feb 2014 02:20:06 +0000 (18:20 -0800)]
ReplicatedPG: set individual osd op rvals

This takes care of things that can fail before transaction is
executed, like omap comparison. Getting individual rvals from a
transaction requires more refactoring, so I'm leaving it for a later
cleanup.

Fixes: #6483
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoReplicatedPG: don't copy the ops vector into OpContext
Josh Durgin [Fri, 7 Feb 2014 02:17:06 +0000 (18:17 -0800)]
ReplicatedPG: don't copy the ops vector into OpContext

There's no need to copy it, and if we refer to the same vector from
the original MOSDOp, we can modify rvals for individual ops, since the
MOSDOp ops vector is copied to the MOSDOpReply when it is constructed.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoReplicatedPG: avoid undefined behavior in xattr comparison
Josh Durgin [Fri, 7 Feb 2014 02:50:50 +0000 (18:50 -0800)]
ReplicatedPG: avoid undefined behavior in xattr comparison

Reading past the end of a pointer returned by string.data() in c++98
is undefined. While we're fixing this, also allow comparison of xattrs
containing null bytes.

Fixes: #7250
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoqa: add librados c object operations tests to librados test script
Josh Durgin [Fri, 7 Feb 2014 02:12:54 +0000 (18:12 -0800)]
qa: add librados c object operations tests to librados test script

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agopackaging: add test programs for librados c object operations
Josh Durgin [Fri, 7 Feb 2014 02:12:33 +0000 (18:12 -0800)]
packaging: add test programs for librados c object operations

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agolibrados: bump version number
Josh Durgin [Fri, 7 Feb 2014 04:11:10 +0000 (20:11 -0800)]
librados: bump version number

This covers the many recent changes leading up to the firefly release,
including the c object operations api.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agolibrados: add omap object operations to the c api
Josh Durgin [Fri, 7 Feb 2014 04:10:15 +0000 (20:10 -0800)]
librados: add omap object operations to the c api

Create an iterator type similar to XattrIter for returning results.
It just wraps the std::map to preserve sorting.

When getting omap keys or values, use an extra callback to set up the
iterator, and default optional parameters to the empty string.

Since it's hard to test read or write omap ops in isolation, combine
them all in the c read ops test case.

One difference between this and the c++ api is that omap_cmp only
allows one assertion per sub-op, for simplicity of the
interface. Multiple omap_cmp operations can still be added to the same
op to get the same effect.

Fixes: #7194
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agolibrados: add read xattr functions for c object operations
Josh Durgin [Fri, 7 Feb 2014 04:03:20 +0000 (20:03 -0800)]
librados: add read xattr functions for c object operations

Only implement string xattr comparison by since integer xattr
comparison assumes ceph-encoded integers in little-endian 64 bit
format, which should not be exposed to librados users.

Add an extra callback for getxattr so that we can initialize the
iterator.

Fixes: #7193
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoObjecter: add a way to chain callbacks
Josh Durgin [Fri, 7 Feb 2014 03:55:30 +0000 (19:55 -0800)]
Objecter: add a way to chain callbacks

The librados C api needs to do extra things like converting c++ data
structures or setting lengths, but some objecter operations already
have out_handlers that librados shouldn't override.

Add a method that chains contexts together by using a new context that
calls both the original and the newly added one.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agolibrados: add exec to the c object operations api
Josh Durgin [Fri, 7 Feb 2014 03:51:59 +0000 (19:51 -0800)]
librados: add exec to the c object operations api

Add two versions: one that allocates a buffer of the appropriate
length for the user, but relies on the user to free it, and one that
uses a user-supplied buffer but may fail if it is too short.

Reuse the bufferlist -> buffer conversion context added for reads into
the user supplied buffer.

The librados-allocated buffer can be handled just like librados
allocated buffers used by the various command functions, so just reuse
do_out_buffer() for them.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agolibrados: add read to c object operation api
Josh Durgin [Fri, 7 Feb 2014 03:45:53 +0000 (19:45 -0800)]
librados: add read to c object operation api

Do the usual bufferlist to buffer conversion in a callback from the
objecter before the librados user gets called.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoObjecter: add a context argument to ObjectOperation::read()
Josh Durgin [Fri, 7 Feb 2014 03:40:11 +0000 (19:40 -0800)]
Objecter: add a context argument to ObjectOperation::read()

The c api will need this to be able to set the output buffer length
and potentially copy from bufferlist to buffer.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agolibrados: add simple atomic read operations to c api
Josh Durgin [Fri, 7 Feb 2014 03:37:41 +0000 (19:37 -0800)]
librados: add simple atomic read operations to c api

stat, assert_exists, and set_flags are simple and need no extra
infrastrucutre.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agolibrados: add exec to the c write operations api
Josh Durgin [Fri, 7 Feb 2014 03:25:31 +0000 (19:25 -0800)]
librados: add exec to the c write operations api

Nothing special needed here, just copying the input buffer and passing
things through. Don't allow output data since it's not usually
available for writes and unreliable when it is.

Fixes: #7195
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agolibrados: add individual op flags for c write operations
Josh Durgin [Fri, 7 Feb 2014 03:19:51 +0000 (19:19 -0800)]
librados: add individual op flags for c write operations

Move flag validation to a static function so it can be shared with the
c++ api. Refer to the new C constants from the c++ api so that it's
easy to keep them in sync.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agolibrados: add global op flags to the c api
Josh Durgin [Fri, 7 Feb 2014 03:12:58 +0000 (19:12 -0800)]
librados: add global op flags to the c api

The c++ api did not include these in the sync versions of the calls,
so add a flags argument to the IoCtxImpl functions for those, with
default arguments to avoid changing the many many callers.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agolibrados: remove constant for CMPXATTR_NOP
Josh Durgin [Fri, 7 Feb 2014 03:03:56 +0000 (19:03 -0800)]
librados: remove constant for CMPXATTR_NOP

This constant was just added in the public header to match the
operations in rados.h, and was not included in a stable release yet.
NOP is misleading, since it's actually uninterpreted anywhere, and
using it would always return EIO from the OSD. It's not particularly
useful, so just remove it. Adding a cmpxattr with FAIL_OK is
equivalent.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agolibrados: add some comments about constants in librados.h
Josh Durgin [Fri, 7 Feb 2014 02:58:26 +0000 (18:58 -0800)]
librados: add some comments about constants in librados.h

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agolibrados: add section docs for object operations
Josh Durgin [Mon, 3 Feb 2014 19:46:59 +0000 (11:46 -0800)]
librados: add section docs for object operations

The doxygen end section of watch notify was accidentally moved when
these were added, so fix that at the same time.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agotest/librados: add ObjectReadOperation tests
Josh Durgin [Fri, 7 Feb 2014 00:32:21 +0000 (16:32 -0800)]
test/librados: add ObjectReadOperation tests

These will help prevent regressions and demonstrate what should be
expected by the c api.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agotest/librados: refactor setup/teardown in tiering tests
Josh Durgin [Mon, 3 Feb 2014 09:00:49 +0000 (01:00 -0800)]
test/librados: refactor setup/teardown in tiering tests

These tests can either use the standard RadosTest, with one pool, or a
new test case with two pools.

The new test case has to copy a couple lines in static methods
(working around lack of virtual static methods is more complex than
it's worth here), but the rest is straight forward. Rename
base_pool_name and base_ioctx to pool_name and ioctx to match the
member variables of the parent class RadosTest.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agotest/librados: use standard rados test case for snapshot tests
Josh Durgin [Mon, 3 Feb 2014 08:56:27 +0000 (00:56 -0800)]
test/librados: use standard rados test case for snapshot tests

Split these into two categories, self-managed and pool snapshots,
since they are mutually exclusive for a single pool. Remove snapshots
and objects at the end of tests, regardless of pass/fail, so the same
pool can be reused.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agotest/librados: use a test case instead of duplicating code everywhere
Josh Durgin [Mon, 3 Feb 2014 08:54:21 +0000 (00:54 -0800)]
test/librados: use a test case instead of duplicating code everywhere

These tests don't have any special requirements on their ioctx and
pools, so they can also run much faster by using different namespaces
per test instead of new pools. For the few tests that do depend on
namespace, reset the ioctx to the default namespace.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agotest/librados/cmd: remove unnecessary pool creation
Josh Durgin [Sun, 2 Feb 2014 17:45:31 +0000 (09:45 -0800)]
test/librados/cmd: remove unnecessary pool creation

Several tests here don't use the pool at all.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agotest/librados: use connect_cluster_pp() instead of duplicating it
Josh Durgin [Sun, 2 Feb 2014 22:33:31 +0000 (14:33 -0800)]
test/librados: use connect_cluster_pp() instead of duplicating it

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agotest/librados: add a connect_cluster() helper
Josh Durgin [Sun, 2 Feb 2014 22:32:13 +0000 (14:32 -0800)]
test/librados: add a connect_cluster() helper

This mirrors the c++ version, connect_cluster_pp(), and removes the
same code from create_one_pool().

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agotest/librados: create general test case classes
Josh Durgin [Mon, 3 Feb 2014 17:01:20 +0000 (09:01 -0800)]
test/librados: create general test case classes

Using a test case allows us to remove a boatload of boilerplate code
in all the tests, and focus them more on what they're actually
testing.

Create one for C tests, and one for C++ tests, with the same
functionality:

- create a pool when the test case starts
- between individual tests, create an ioctx and set its namespace uniquely
- delete objects from the default namespace during individual test teardown
- delete the pool only when the whole test case is finished

In gtest, a test case is the whole set of tests declared as part of
the same class using TEST_F(). Many tests create and delete individual
pools, but this is unnecessary for independent operation in most
cases, since we can use namespaces for that now. Since pool creation
and deletion dominates test run time, using these test cases makes
running many of the tests much faster.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agotest/librados: move test.cc into its own library
Josh Durgin [Thu, 6 Feb 2014 23:09:57 +0000 (15:09 -0800)]
test/librados: move test.cc into its own library

This way it doesn't have to be compiled many times, and it's easier
to add new general functionality to new files without adding those
.cc files to every test program.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoObjecter: keep ObjectOperation rval pointers for writes
Josh Durgin [Thu, 30 Jan 2014 14:55:29 +0000 (06:55 -0800)]
Objecter: keep ObjectOperation rval pointers for writes

Just before sending an op, prepare_mutate_op() is called, creating a
new Op. prepare_read_op() already copied over all the out-params
correctly, but for write operations the individual op return value
pointers were not copied, so they would not be filled in. With this
fixed, librados users can get the per-op return codes again.

Partially fixes: #6483
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
11 years agoMerge pull request #1227 from ceph/wip-7394
Gregory Farnum [Tue, 18 Feb 2014 20:34:29 +0000 (12:34 -0800)]
Merge pull request #1227 from ceph/wip-7394

Improve the OSD and generic monitor timeout mechanisms

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge remote-tracking branch 'upstream/wip-ecbackend-for-review'
Samuel Just [Tue, 18 Feb 2014 18:56:02 +0000 (10:56 -0800)]
Merge remote-tracking branch 'upstream/wip-ecbackend-for-review'

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1255 from ceph/wip-cache-perf
Sage Weil [Tue, 18 Feb 2014 16:22:17 +0000 (08:22 -0800)]
Merge pull request #1255 from ceph/wip-cache-perf

osd: add perfcounters for new cache and agent events

Reviewed-by: Haomai Wang <haomaiwang@gmail.com>
11 years agoosd/ReplicatedPG: clean up agent skip debug output 1255/head
Sage Weil [Mon, 17 Feb 2014 21:05:58 +0000 (13:05 -0800)]
osd/ReplicatedPG: clean up agent skip debug output

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd: l_osd_agent_{wake,skip,flush,evict}
Sage Weil [Mon, 17 Feb 2014 20:23:44 +0000 (12:23 -0800)]
osd: l_osd_agent_{wake,skip,flush,evict}

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd: l_osd_tier_[dirty|clean]
Sage Weil [Mon, 17 Feb 2014 20:20:28 +0000 (12:20 -0800)]
osd: l_osd_tier_[dirty|clean]

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd: l_osd_tier_whiteout
Sage Weil [Mon, 17 Feb 2014 20:19:36 +0000 (12:19 -0800)]
osd: l_osd_tier_whiteout

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd: l_osd_tier_evict
Sage Weil [Mon, 17 Feb 2014 20:18:49 +0000 (12:18 -0800)]
osd: l_osd_tier_evict

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd: l_osd_tier_[try_]flush[_fail]
Sage Weil [Mon, 17 Feb 2014 18:55:54 +0000 (10:55 -0800)]
osd: l_osd_tier_[try_]flush[_fail]

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd: l_osd_copyfrom
Sage Weil [Mon, 17 Feb 2014 18:52:36 +0000 (10:52 -0800)]
osd: l_osd_copyfrom

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoRadosModel: only output if missing header is actually a problem 1228/head
Samuel Just [Sun, 16 Feb 2014 01:33:39 +0000 (17:33 -0800)]
RadosModel: only output if missing header is actually a problem

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoObjecter: track primary explicitly to detect changing primaries
Samuel Just [Sun, 16 Feb 2014 01:33:07 +0000 (17:33 -0800)]
Objecter: track primary explicitly to detect changing primaries

Signed-off-by: Samuel Just <sam.just@inktank.com>