Patrick Donnelly [Tue, 22 Oct 2024 00:57:15 +0000 (20:57 -0400)]
Merge PR #60174 into main
* refs/pull/60174/head:
common/Finisher: pass name as std::string_view to ctor
common/Finisher: add method get_thread_name()
mgr/ActivePyModule: build thread name with fmt
mgr/ActivePyModule: return std::string_view instead of std::string copy
common/Finisher: use fmt to build strings
common/Finisher: un-inline ctor and dtor
common/Finisher: add `const` to several fields
common/Finisher: merge duplicate field initializers
common/Finisher: call notify_one() instead of notify_all()
common/Finisher: wake up after pushing to the queue
common/Finisher: do not wake up the thread if already running
common/Finisher: call logger without holding the lock
common/Finisher: use `std::lock_guard` instead of `std::unique_lock`
common/Finisher: merge all queue() container methods into one template
Patrick Donnelly [Tue, 22 Oct 2024 00:56:01 +0000 (20:56 -0400)]
Merge PR #60214 into main
* refs/pull/60214/head:
mds/MDCache: use `auto`
mds/CDir: use the erase() return value
mds/MDCache: remove unnecessary empty() check
mds/MDCache: use the erase() return value
mds/MDCache: pass iterator by value
Patrick Donnelly [Tue, 22 Oct 2024 00:54:15 +0000 (20:54 -0400)]
Merge PR #60216 into main
* refs/pull/60216/head:
common/options: pass name as rvalue reference
common/config: use libfmt to build strings
common/config: use emplace_back() instead of push_back()
common/HeartbeatMap: pass name as rvalue reference
common/config_obs_mgr: use the erase() return value
common/SloppyCRCMap: use the erase() return value
common: disable `boost::intrusive::constant_time_size`
Patrick Donnelly [Tue, 22 Oct 2024 00:53:44 +0000 (20:53 -0400)]
Merge PR #60220 into main
* refs/pull/60220/head:
msg/async/AsyncConnection: move the writeCallback instead of copying it
msg/async/AsyncConnection: do not wrap writeCallback in `std::optional`
msg/async/frames_v2: use zero-initialization instead of memset()
msg/async/Event: use zero-initialization instead of memset()
msg/Message: use zero-initialization instead of memset()
msg/async/ProtocolV2: eliminate redundant std::map lookups
msg/async/ProtocolV[12]: reverse the std::map sort order
msg/async/ProtocolV[12]: use `auto`
msg/async/ProtocolV[12]: use range-based `for`
msg/async/ProtocolV1: use zero-initialization instead of memset()
Add multi-cluster support (showMultiCluster=True) to alerts
Following PR https://github.com/ceph/ceph/pull/55495 fixing the
dashboard in regards to multiple clusters storing their metrics
in a single Prometheus instance, this PR addresses the issues
for alerts.
Fixes: https://tracker.ceph.com/issues/64321 Signed-off-by: Christian Rohmann <christian.rohmann@inovex.de>
Patrick Donnelly [Tue, 15 Oct 2024 21:12:28 +0000 (17:12 -0400)]
doc/dev: add walkthrough for CephFS kernel development
Specifically, an opinionated walkthrough of how to setup an environment for a
built kernel, networking a VM to sepia, and mounting a remote Ceph cluster.
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
This introduces a new `ceph orch device replace` command in order to
improve the user experience when it comes to replacing the underlying
device of an OSD.
```
ceph_volume/util/disk.py:1374: error: Incompatible types in assignment (expression has type "Optional[str]", variable has type "str") [assignment]
```
Adam Kupczyk [Tue, 15 Oct 2024 12:41:22 +0000 (12:41 +0000)]
os/bluestore: Fix repair of multilabel when collides with BlueFS
The problem was that BDEV_FIRST_LABEL_POSITION was removed from
bdev_label_valid_locations set.
Now, if label at BDEV_FIRST_LABEL_POSITION is valid, it is in the set.
Fixes: https://tracker.ceph.com/issues/68528 Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
Afreen Misbah [Fri, 11 Oct 2024 15:28:56 +0000 (20:58 +0530)]
mgr/dashboard: Adapt gateway group changes in nvmeof UI
- Added gateway group param in namespace request - GET, POST, PATCH, DELETE
- Added gateway group param in Listeners request - GET
- Added gateway group param in Initiators - GET, POST, DELETE
Max Kellermann [Tue, 15 Oct 2024 15:52:45 +0000 (17:52 +0200)]
CodingStyle: allow C++ forward declarations
The Google coding guide opposes to forward declarations, but I
disagree with that opinion. In my opinion, forward declarations are
useful. Ceph build times are miserable due to header dependency bloat
and template bloat, both of which can be reduced using forward
declarations.
All cons listed in https://google.github.io/styleguide/cppguide.html
> Forward declarations can hide a dependency, allowing user code to
> skip necessary recompilation when headers change.
That is a pro, not a con. Skipping (unnecessary) recompilation is a
good thing, it's the goal of forward declarations.
> A forward declaration as opposed to an #include statement makes it
> difficult for automatic tooling to discover the module defining the
> symbol.
That certainly depends on the tools one uses, but I cannot imagine
today's IDEs are limited to one compilation unit.
> A forward declaration may be broken by subsequent changes to the
> library.
True, and that will lead to a compiler error.
> Forward declarations of functions and templates can prevent the
> header owners from making otherwise-compatible changes to their
> APIs, such as widening a parameter type, adding a template parameter
> with a default value, or migrating to a new namespace.
Forward declarations do not prevent any of that. But if you change
the "real" declaration, all incompatible forward declarations will
cause a compiler error.
Sad, but true. But that is not an argument against forward
declarations for Ceph's own types.
> It can be difficult to determine whether a forward declaration or a
> full #include is needed.
If it compiles without the `#include`, then the forward declaration is
fine. (Or the primary header happened to be already included by
somebody else.)
> Replacing an #include with a forward declaration can silently change
> the meaning of code: [...] If the #include was replaced with forward
> decls for B and D, test() would call f(void*).
True, but this is a contrived example, and is bad coding style because
it is error prone. Casts to `void*` can and should be avoided. There
are rare examples where such casts are necessary (boundary to C APIs),
and then it's very unusual to pass derived incomplete types.
> Forward declaring multiple symbols from a header can be more verbose
> than simply #includeing the header.
True, but that misses the point of forward declarations.
> Structuring code to enable forward declarations (e.g., using pointer
> members instead of object members) can make the code slower and more
> complex.
True, but that is not a property of forward declarations. I don't
suggest doing such a thing.
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
test/osd: Add interactive mode to ceph_test_rados_io_sequence
Reorganisers the main function to be more modular, moving functionality into a TestRunner object and anonymous namespaces.
Adds a new "interactive" test mode that allows you to direct the order of operations rather than using the preset sequences. This allows complete precise control of the tool when you want to test specific IOs.
Signed-off-by: Jon Bailey <jonathan.bailey1@ibm.com>
Redouane Kachach [Tue, 15 Oct 2024 11:34:32 +0000 (13:34 +0200)]
mgr/cephadm: disabling nginx buffering for grafana location
Disabling Nginx buffering for Grafana, as it may lead to errors or
delays while loading the main Grafana page, particularly when
receiving JavaScript files.
* pthread name is saved in a thread_local storage
* the thread_local name is copied into Entry object's ctor
* Log::dump_recent() reads the thread name from the Entry
object's data member when dumping logs
Anoop C S [Tue, 27 Aug 2024 10:20:44 +0000 (15:50 +0530)]
client: Resolve symlink from dirfd for empty pathname
man readlinkat(2)[1] points at a special case for readlinkat() syscall
as follows:
. . .
Since Linux 2.6.39, pathname can be an empty string, in which case the
call operates on the symbolic link referred to by dirfd (which should
have been obtained using open(2) with the O_PATH and O_NOFOLLOW flags).
. . .
man open(2)[2] further explains the need for such a special case when
a symlink is opened with O_PATH and O_NOFOLLOW:
. . .
If pathname is a symbolic link and the O_NOFOLLOW flag is also
specified, then the call returns a file descriptor referring to the
symbolic link. This file descriptor can be used as the dirfd argument
in calls to fchownat(2), fstatat(2), linkat(2), and readlinkat(2) with
an empty pathname to have the calls operate on the symbolic link.
. . .
Accordingly have a check to resolve symlinks out of dirfd when empty
pathnames are encountered within readlinkat(). In addition to that
match the standard file system behavior to return ENOENT instead of
EINVAL when the inode pointed to by dirfd is not a symbolic link with
empty pathnames.
Anoop C S [Thu, 29 Aug 2024 06:23:44 +0000 (11:53 +0530)]
client: Fix symlink open with O_PATH and O_NOFOLLOW
man open(2)[1] says the following for O_PATH:
. . .
If pathname is a symbolic link and the O_NOFOLLOW flag is also
specified, then the call returns a file descriptor referring to the
symbolic link. This file descriptor can be used as the dirfd argument
in calls to fchownat(2), fstatat(2), linkat(2), and readlinkat(2) with
an empty pathname to have the calls operate on the symbolic link.
. . .
symlink check within may_open() failed to consider the O_PATH flag
resulting in a ELOOP error to the client. In order to return a valid
file descriptor we introduce a check for the presence of O_PATH in
the client provided flags.
These are intended to replace do_osd_ops*. The implementation
is simpler and does not involve passing success and failure
callbacks. It also moves responsibility for dealing with
the MOSDOpReply and client related error handling over to
ClientRequest.
do_osd_op* will be removed once users are switched over.