| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Mykola Golub <mgolub@suse.com>
|
|
|
|
| |
Signed-off-by: Mykola Golub <mgolub@suse.com>
|
|
|
|
| |
Signed-off-by: Mykola Golub <mgolub@suse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
we have following pains when it comes to ceph release related
programming:
* we use int, uint8_t, uint32_t, unsigned int for representing the ceph
release, i.e., jewel, luminous, nautilus, in different places in our
source tree.
* we always need to add a comment aside of `uint8_t release` to help
the folks to understand that it is CEPH_RELEASE_*.
* also we keep forgetting that "os << release" actually prints the
release as an ASCII.
* and it's painful to remember that we have to translate the release
number using `ceph_release_name()` before print it out in the human
readable format.
* we replicate the n+2 upgrade policy in multiple places
in this change, `ceph_release_t` and some helper functions are
intruduced to alleviate the pains above.
* add a scoped enum for representing ceph releases, so the release
is typed . which means that we can attach different function to
it. and in future, we can even replace `ceph_release_t` with
a class if we need to support more fancy features which cannot be
implemented using free functions.
* add `ostream<<()` operator for `ceph_release_t`, so we can simply
send it to `ostream`
* add `can_upgrade_from()` so we don't need to repeat ourselves.
* move ceph_release_from_name() to ceph_release.{h,cc}, as currently,
ceph_release.cc uses `ceph_release_name()` for implementing
`ostream<<()`, and after this change, `ceph_release_from_name()`
will return `ceph_release_t`, so if we keep `ceph_release_from_name()`
where it was, these two headers will be included by each other,
which is a no-go.
* reimplement `ceph_release_from_name()` using a loop. before this
change, `ceph_release_from_name()` was implemented using a manually
unrolled if-else structure, which is more performant, but the
downside is that, it replicates mapping between release number
and its name. so after this change, a loop is used instead.
as this function is not used in the critical path, so this change
should not have visible impact on the performance.
* always use ceph_release_t::unknown as the default value of the
"release" member variables. before this change, sometimes, we use
"0" and sometimes we use "1", after inspecting the code, i found that
"0" is good enough to cover all the use cases. and since "0" is a
magic number in this context, it is replaced using
`ceph_release_t::unknown`. to facilidate the checking against
`ceph_release_t::unknown`, `operator!()` is added.
* ceph::to_string() and ceph::to_integer<>() are added to help
to remove the asssumption of the underlying type of `ceph_release_t`,
ideally, users of `ceph_release_t` should not use `static_cast<>` to
cast it into integer types, instead, they should use
`ceph::to_integer<>()` to do this job. if, in future, we want to
use a `class` to represent `ceph_release_t`, we can get this done
with minimum change, if `ceph::to_string()` and `ceph::to_string()`
are used. we can not specialize them in `std` naming space. as
it's claimed that it's undefined behavior to do so. see
https://en.cppreference.com/w/cpp/language/extending_std .
Signed-off-by: Kefu Chai <kchai@redhat.com>
|
|
|
|
| |
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
|
|
|
|
| |
Signed-off-by: Mykola Golub <mgolub@suse.com>
|
|
|
|
| |
Signed-off-by: Myoungwon Oh <omwmw@sk.com>
|
|
|
|
|
|
|
| |
This can be utilized to determine when it's safe to enable new
cls features.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
|
|
|
|
| |
Signed-off-by: Myoungwon Oh <omwmw@sk.com>
|
|
|
|
|
|
|
|
| |
cas class is introduced(cas class includes a write_or_get op)
This operation increase the reference count
if the chunk is already stored.
Signed-off-by: Myoungwon Oh <omwmw@sk.com>
|
|
|
|
| |
Signed-off-by: Mykola Golub <mgolub@suse.com>
|
|
|
|
| |
Signed-off-by: Kefu Chai <kchai@redhat.com>
|
|
|
|
|
|
|
| |
the __cls_init() function should be visible. otherwise we cannot call it
to register the cls methods
Signed-off-by: Kefu Chai <kchai@redhat.com>
|
|
|
|
| |
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
|
|
|
|
|
|
|
| |
This is a portion of Part 1 of the namespace project: using ADL
properly in encode and decode so we can use namespaces easily in Ceph.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
cls_log_add() relies on cls_cxx_subop_version() to generate unique keys
for log entries with the same timestamp. because cls calls back into
do_osd_ops(), resetting current_osd_subop_num means that cls_log_add()
will keep seeing the same subop version and generating the same keys.
this causes the following failure in ceph_test_cls_log:
[ RUN ] cls_rgw.test_log_add_same_time
/home/cbodley/ceph/src/test/cls_log/test_cls_log.cc:144: Failure
Expected: 10
To be equal to: (int)entries.size()
Which is: 1
[ FAILED ] cls_rgw.test_log_add_same_time (1180 ms)
Fixes: http://tracker.ceph.com/issues/21964
Signed-off-by: Casey Bodley <cbodley@redhat.com>
|
|
|
|
| |
Signed-off-by: Casey Bodley <cbodley@redhat.com>
|
|
|
|
| |
Signed-off-by: Sage Weil <sage@redhat.com>
|
|\
| |
| |
| |
| |
| | |
osdc, class_api: kill implicit string conversions
Reviewed-by: Gregory Farnum <gfarnum@redhat.com>
|
| |
| |
| |
| |
| |
| | |
This gets rid of implicit c-string to std::string conversions, as
they are expensive and unnecessary anyway.
Signed-off-by: Piotr Dałek <piotr.dalek@corp.ovh.com>
|
|/
|
|
| |
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
|
|
|
|
|
|
|
|
| |
Creates an installable version of "src/include/rados/objclass.h" that allows
object classes to be built outside of the Ceph tree. cls_sdk is an example
of such an object class.
Signed-off-by: Neha Ojha <nojha@redhat.com>
|
|
|
|
| |
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
|
|
|
|
|
|
| |
So begins the ruthless annihilation of g_ceph_context.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
|
|
|
|
|
|
|
| |
As a transition for g_ceph_context removal, make all dout macros depends
on a local macro.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
|
|
|
|
|
|
|
|
| |
It's been confusing for a long time that EC pools are implemented by
ReplicatedPG. What PG/ReplicatedPG really implement is the concept
of a PG where consistency is managed by the primary via a log.
Signed-off-by: Samuel Just <sjust@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RADOS classes can now be statically compiled and added to
the embedded cephd library.
The RADOS ClassHandler now has an option to skip calling dlclose
just like PluginRegistry.
All RADOS classes where changed to use a CLS_INIT macro that
will either use __cls_init or classname_cls_init. this enables
the static compiling of all RADOS classes in a single library. Also
global method definitions where moved to inside cls_init.
Also added a few aconfig defines including WITH_EMBEDDED, WITH_CEPHFS,
WITH_RBD, and WITH_KVS. Note that WITH_RBD was not defined before
and the ceph-dencoder was broken when it was turned on.
Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
|
|
|
|
| |
Signed-off-by: Sage Weil <sage@redhat.com>
|
|
|
|
|
|
| |
remove the unused bufferlist variables
Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
|
|
|
|
|
|
| |
Expose cls methods to the current OSDMap features set.
Signed-off-by: Sage Weil <sage@redhat.com>
|
|\
| |
| |
| |
| | |
objclass: honour do_osd_ops() results before going any further
Reviewed-by: Sage Weil <sage@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is because:
1. all the other methods are doing the same.
2. the origin results of do_osd_ops() may get overwritten by -ENOMEM,
which is misleading.
3. if the class methods return negative results, normally it's not
the responsibility for the caller being in charge of freeing out
buffers. Therefore this change saves our some efforts and avoids
potential memory leaks(Though I doubt this shall happen).
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
|
|/
|
|
| |
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
|
|
|
|
|
|
| |
These new methods support passing op flags (e.g. cache hints).
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
|
|
|
|
|
|
| |
allows retrieving high definition mtime
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Class methods that use the cls_get_request_origin should not be
proxied to a base tier -- otherwise the origin will reflect the
cache tier instead of the client.
Fixes: #13380
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
|
|
|
|
|
|
|
|
| |
...so that implementations can readily handle
decode errors in client args and return an
error code.
Signed-off-by: John Spray <john.spray@redhat.com>
|
|
|
|
| |
Signed-off-by: John Spray <john.spray@redhat.com>
|
|
|
|
| |
Signed-off-by: John Spray <john.spray@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix for:
CID 1297864 (#1 of 1): Out-of-bounds access (OVERRUN)
overrun-buffer-arg: Overrunning array buf of 25 bytes by passing
it to a function which accesses it at byte offset 25 using
argument 25.
cls_gen_rand_base64(): index_parm: Pointer dest is directly
accessed by indexing it with size.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
|
|
|
|
|
|
|
| |
EC pools won't support SYNC reads. This means that TMAP and friends
along with reads from an object class will not be supported.
Signed-off-by: Samuel Just <sam.just@inktank.com>
|
|
|
|
| |
Signed-off-by: Greg Farnum <greg@inktank.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Following the changes to when we set or increase the user_version, we
want to continue to return the best lower bound we can on the version
of any newly-created object. For ENOENT replies that means returning
info.last_user_version instead of the (potentially-zero) ctx->user_at_version.
Similarly, for cls_current_version we want to return the last version on
the PG rather than the last update to the object in order to provide
sensible version ordering across object deletes and creates.
Update the versions doc so it continues to be precise.
Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Set this up with the existing at_version member, but only increase
it for user_modify ops. Use this when logging the PG's user_version. In
order to maintain compatibility with old clients on classic pools, we
force user_version to follow at_version whenever it's updated.
Now that we have and are maintaining this PG user version, use it
for the user version on ops that get ENOENT back, when short-circuiting
replies as part of reply_op_error()[1], or when replying to repops
in eval_repop; further use it for the cls_current_version() function. This
is a small semantic change for that function, as previously it would
generally return the same value as the user would get sent back via
MOSDOpReply -- but I don't think it was something you could count on.
We now define it as being the user version of the PG at the start of the
op, and as a bonus it is defined even for read ops (the at_version is
only filled in on write operations).
[1]: We tweak PGLog to make it easier to retrieve both user and PG versions.
Signed-off-by: Greg Farnum <greg@inktank.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not sure why but this seems to resolve a linking problem when loading
classes:
2013-08-17 13:28:19.015776 7fb2bcffa700 0 _load_class could not open class /usr/lib/rados-classes/libcls_hello.so (dlopen failed): /usr/lib/rados-classes/libcls_hello.so: undefined symbol: cls_log
2013-08-17 13:28:19.015786 7fb2bcffa700 -1 osd.4 12 class hello open got (5) Input/output error
In any case, it's simpler.
Signed-off-by: Sage Weil <sage@inktank.com>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/Makefile.am
src/include/rados/librados.hpp
src/rgw/rgw_admin.cc
src/rgw/rgw_bucket.cc
src/rgw/rgw_common.cc
src/rgw/rgw_common.h
src/rgw/rgw_json_enc.cc
src/rgw/rgw_main.cc
src/rgw/rgw_op.h
src/rgw/rgw_rados.cc
src/rgw/rgw_tools.cc
src/rgw/rgw_user.cc
src/rgw/rgw_user.h
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
|
| |
| |
| |
| | |
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We need to be able to generate a unique identifier for
each subop. This can be useful e.g., if we want to keep multiple
omap data entries indexed by the same key. The unique id
is being generated by the current object id and the current
osd subop count. For write operations it's unique.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
|
|/
|
|
|
|
| |
New objclass to track and modify objects versions.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
|
|
|
|
|
|
|
|
|
|
|
| |
cls_log needed __attribute__((format(printf..)) to allow the compiler
to crosscheck format strings and arguments. After adding that, there
needed to be a bunch of fixups for %ll, and a few changes for missing
arguments, etc. uncovered by the checking.
Fixes: #3970
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
|