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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>