crimson/common/tri_mutex: update the class comment
to explain the reason why we have tri_mutex, and how it is related to
pipelined read / write. and the mutual exclusion between read, write
and rmw operations.
crimson/osd: replace "ceph_abort_msg()" with assert()
these are programming errors, and are easy to detect. also assert() does
not return, so compiler won't complain at seeing a branch does not
return value in a function that returns value.
* add tri_mutex::abort() to pass given exception to all waiters
* add ObjectContext::interrupt() to abort all pending consumers
of current object context
before this change, a seastar::shared_mutex, a RWState and a
shared_promise are used for tracking the consumers of ObjectContext.
and all of the consumers are put into writers if the predicate function
evaluates to "false", and is awaken if the predicate function evaluates
to "true" afterwards in a polling loop waiting on the shared_promise,
which is in turn fulfilled once the last consumer of the given category
relinquishes the lock.
this approach has couple issues:
* it is heavy weighted. seastar::shared_mutex already tracks each of
the waiters' continuation using separate promise<>, and it does try
to reschedule them once a given consumer releases the last lock.
so it's like a design of a customized shared_mutex over a
shared_mutex.
* it is complicated. 3 variables for tracking the different
consumers of ObjectContext.
in this change,
* `tri_mutex` is introduced as a variant of the original
`seastar::shared_mutex` to track two different shared users in
addition to an exclusive user.
* replace `shared_mutex` with `tri_mutex` in `ObjectContext`, to
simplify the design.
* move recovery_read_marker into `ObjectContext`. assuming all
pending actions will be added as a waiter for the related
object context before they acquire the lock.
instead of reusing ObjectContext::get_recovery_read() for both
sync call and async call. just add a new method for the async call
for better readability
are basically the same thing. They're all called directly
before the deployment of a daemon. All of them should be
unified. This PR makes this refactorization simpler
By renaming `create` to `prepare_create`, we make `create`
no longer being the entrypoint to call
`create_daemon`. Thus all the functions above
return some data structures.
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
crimson/common: add comment to explain the partial specialization
it might be confusing why we don't use explicit specialization for
defining errorator::futurize::stored_to_future.
quote from item 16, § 17.7.3, n4659:
In an explicit specialization declaration for a member of a class
template or a member template that appears in namespace scope, the
member template and some of its enclosing class templates may remain
unspecialized, except that the declaration shall not explicitly
specialize a class member template if its enclosing class templates are
not explicitly specialized as well.
crimson/common: add specialization for futurize::invoke(Func, monostate)
this is a leftover of 260a702ba983f1bca29d4c8d1e28f3eef46c6699. where we
bumped up the Seastar API level to 5, in which seastar::internal::monostate
is used to represent the stored state of a future instead of a tuple<>.
instead of converting string constant to char*, construct string_views
from string constants
to silence GCC warnings like:
src/rgw/services/svc_sys_obj_cache.cc:512:7: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
512 | { "cache list name=filter,type=CephString,req=false",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Since the v1.4.0 release there have been a few improvements to Zstandard
including improved compression ratios, faster compression, and faster
decompression.
RGWRadosStore::create_bucket() only returns EEXIST errors when a
conflict is detected and the recreation should fail. in other cases,
return success and use the 'bool *existed' flag to notify the caller of
its prior existence
Sebastian Wagner [Fri, 11 Sep 2020 19:10:37 +0000 (21:10 +0200)]
Merge pull request #35543 from sebastian-philipp/qa-cephadm-iscsi
qa/cephadm: Add iSCSI
Reviewed-by: Adam King <adking@redhat.com> Reviewed-by: Georgios Kyratsas <gkyratsas@suse.com> Reviewed-by: Matthew Oliver <moliver@suse.com> Reviewed-by: Michael Fritch <mfritch@suse.com>
Jason Dillaman [Fri, 11 Sep 2020 16:41:44 +0000 (12:41 -0400)]
librbd: ensure local site is included in mirror image global status
Ensure we always return local status for a mirrored image. The Python
bindings expect it to be included for backwards compatibility. Previously
the local status was not included if at least one remote site was reporting
status.
Fixes: https://tracker.ceph.com/issues/47390 Signed-off-by: Jason Dillaman <dillaman@redhat.com>
the data read from stdin is used as the input parameter for calls like
`cluster.osd_command(...)` and `cluster.mon_command`. all of them
expect a bytes `inbuf`. in Python2, this sys.stdin.read() returns a str,
and we don't differentiate str from byte back then. but we need enforce
the type now for better readablity and type correctness.
WARNING: Cannot resolve forward reference in type annotations of "rados.Rados.conf_get": name 'unicode' is not defined
because cython < 3.0 with language_level = "3", translates "str" to "unicode"
to be python2 compatible, but we've migrated to python3. and the specified
"language_level" is "3'. see also
https://github.com/cython/cython/issues/1370
There was a window between issuing quiesce_complete and checking
the quiesce variable unset by the unqiesce callback, when the lock
was not holding. If during that window the unquiesce following the
next quiesce callbacks were called we would miss unquiesce event.
Rishabh Dave [Mon, 24 Aug 2020 18:34:40 +0000 (00:04 +0530)]
qa/cephfs: backup mount object before running tests
Right now, only client IDs are stashed and restored but with the recent
changes (addition of more attributes to mount objects, specifically),
this is not enough. Saving and restoring these details before and after
tests respectively ensures that mount commands rus smoothly. Not doing
this typically leads to mount command failure for the second test in the
testsuite under execution since the client IDs are saved and restored in
CephFSTestCase.setUp and CephFSTestCase.tearDown respectively but the
rest of the details are not.
in future, string_view can be used almost every where string can be
used. in this change, `const char*` is instead passed to the constructor
of system_error, as we can ensure that the string_view instances are
always constructed from a `const char*` ended with `\0`.
we need this change for two reasons:
* better performance
* prefer for the world where string_view rules.
common/buffer: use homebrew BUF_OFFSETOF to replace offsetof()
because buffer::raw is not a standard layout type. so `offsetof()`
does not always work. let's use a homebrew macro to calculate the
address of `bptr_storage`.
this change silences the warning like:
src/common/buffer.cc:2156:15: warning: ‘offsetof’ within non-standard-layout type ‘ceph::buffer::v15_2_0::raw’ is conditionally-supported [-Winvalid-offsetof]
2156 | offsetof(buffer::raw, bptr_storage));