We don't support balanced reads on ec pools. Additionally, the yaml
actually specifies 'balanced_reads' rather than 'balance_reads' and
therefore has no actual effect.
Samuel Just [Sat, 30 Mar 2024 23:49:34 +0000 (16:49 -0700)]
osd/ECBackend: simplfy pg_committed_to handling
See comment for details. Modifies ECBackend::submit_transaction to
use the passed pg_committed_to unconditionally, adds a comment to
explain, and adds a comment to RMWPipeline::pg_committed_to to
clarify that it may lag PeeringState::pg_committed_to.
Samuel Just [Thu, 28 Mar 2024 02:05:16 +0000 (19:05 -0700)]
osd,crimson/osd: use pg_committed_to rather than mlcod for submit_transaction
This commit actually changes the bound we're propagating. This solves
two bugs:
- Using min_last_complete_ondisk caused replicas to be two update rounds
behind rather than one
- Replicas don't actually have enough information to set
min_last_complete_ondisk on activation, so we couldn't serve replica
reads until the first write. pg_committed_to, on the other hand, is
fine as the activation last_update cannot become divergent.
Moreover, last_complete won't advance past missing objects causing
min_last_complete_ondisk to be blocked by any replica missing object.
Note that the replica read pathway seperately checks whether the target
is missing locally, so that property was not needed.
Fixes: https://tracker.ceph.com/issues/65086 Fixes: https://tracker.ceph.com/issues/65085 Signed-off-by: Samuel Just <sjust@redhat.com>
Samuel Just [Sat, 30 Mar 2024 23:23:01 +0000 (16:23 -0700)]
osd,crimson/osd: maintain pg_committed_to on replica rather than min_last_complete_ondisk
This commit updates the bulk of the interface pathways in crimson and
classic to refer to pg_committed_to rather than min_last_complete_ondisk
and changes the replica side to maintain pg_committed_to instead.
This commit shouldn't actually cause any behavior change -- we're still
passing min_last_complete_ondisk (which is a valid lower bound for
pg_committed_to!).
Samuel Just [Fri, 29 Mar 2024 21:45:39 +0000 (14:45 -0700)]
osd: roll_forward_to->pg_committed_to in EC*
The purpose of this rename is merely to clarify that the necessary
condition on ec roll-forward is that the pg has committed up to that
point. Along with subsequent commits, this will clarify that both ec
and replicated pools propagate pg_committed_to for related if not
identical reasons. Because EC::submit_transaction already did
Avoid maintaining pg_committed_to if pg is not active. We can't
guarantee that last_update won't become divergent, so it doesn't
provide useful information.
Samuel Just [Thu, 28 Mar 2024 00:41:47 +0000 (17:41 -0700)]
osd/PeeringState: rename last_update_ondisk to pg_committed_to
The name last_update_ondisk is misleading as it suggests a local
property like last_update_applied rather than a pg-global
property. Clarify the name and add a much more specific comment.
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>
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.