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.
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.
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.
Danny Al-Gaaf [Wed, 19 Feb 2014 17:17:54 +0000 (18:17 +0100)]
PG: use !empty() instead of size() > 0
[src/osd/PG.cc:543]: (performance) Possible inefficient checking
for 'actingbackfill' emptiness.
[src/osd/PG.cc:1480]: (performance) Possible inefficient checking
for 'actingbackfill' emptiness.
[src/osd/PG.cc:1774]: (performance) Possible inefficient checking
for 'actingbackfill' emptiness.
[src/osd/PG.cc:1810]: (performance) Possible inefficient checking
for 'actingbackfill' emptiness.
[src/osd/PG.cc:2229]: (performance) Possible inefficient checking
for 'actingbackfill' emptiness.
[src/osd/PG.cc:2599]: (performance) Possible inefficient checking
for 'actingbackfill' emptiness.
[src/osd/PG.cc:4345]: (performance) Possible inefficient checking
for 'actingbackfill' emptiness.
[src/osd/PG.cc:6067]: (performance) Possible inefficient checking
for 'actingbackfill' emptiness.
[src/osd/PG.cc:6264]: (performance) Possible inefficient checking
for 'actingbackfill' emptiness.
[src/osd/PG.cc:6807]: (performance) Possible inefficient checking
for 'actingbackfill' emptiness.
[src/osd/PG.cc:7014]: (performance) Possible inefficient checking
for 'actingbackfill' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Wed, 19 Feb 2014 15:10:54 +0000 (16:10 +0100)]
Client.cc: use !empty() instead of size()
[src/client/Client.cc:2275]: (performance) Possible inefficient
checking for 'cap_snaps' emptiness.
[src/client/Client.cc:2458]: (performance) Possible inefficient
checking for 'cap_snaps' emptiness.
[src/client/Client.cc:2986]: (performance) Possible inefficient
checking for 'caps' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.