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>
Afreen Misbah [Fri, 11 Oct 2024 08:57:24 +0000 (14:27 +0530)]
mgr/dashboard: Fix listener deletion
Listener deletion is broken due to passing wrong gateway address.
Including `traddr` in DELETE API of listener to choose correct gateway address for deletion.
Aashish Sharma [Wed, 9 Oct 2024 14:02:49 +0000 (19:32 +0530)]
mgr/cephadm: RGW service deployment defaults to 'default' realm/zonegroup/zone despite non-default spec in service
When we create an RGW service using the ceph orch apply command, the service is always deployed in the default realm, zonegroup, and zone, even if we specify a different realm, zonegroup, or zone in the service spec. This happens because certain configuration values, like rgw_realm, rgw_zonegroup, and rgw_zone, need to be set for the RGW instances before the daemons are deployed. Currently, these configurations are being applied after the RGW daemons are deployed, which requires a service restart to reflect the correct realm, zonegroup, and zone. Ideally, these configurations should be applied before the RGW daemons are deployed, so they are correctly placed in the desired realm, zonegroup, and zone from the start.
Ronen Friedman [Tue, 8 Oct 2024 13:25:56 +0000 (08:25 -0500)]
qa/standalone/scrub: remove TEST_recovery_scrub_2
That test does no longer match the actual requirements and
implementation of scrubbing.
It was already deactivated in
https://github.com/ceph/ceph/pull/59590. Here - it is
fully removed, mainly for the sake of backporting.
Ronen Friedman [Sat, 5 Oct 2024 12:33:49 +0000 (07:33 -0500)]
osd/scrub: modify ScrubStore contents retrieval
A separate commit added a simple test to verify the new
store implementation (creating both shallow & deep errors),
scrubbing (step 1), deep scrubbing (step 2), then shallow
scrubbing again (step 3). The test verifies that
the results after step 2 include all shallow errors data (*),
and that the results after step 3 include all deep errors
data.
The test highlighted the need to correctly partition and
retrieve the "shards inconsistencies" and the "selected
shard" data, which was not fully implemented in the
previous commit. Thus, this commit adds the following:
- add_object_error() no longer filters out data saved during
deep scrubbing; it also filters less of the shallow scrubs
"shards inconsistencies" data;
- merge_encoded_error_wrappers() now merges the "shards
inconsistencies" data correctly, handling the multiple
scenarios possible.
(*) note the special case of not being able to read the
object's version during deep scrubbing (due to a read
error). In this case - the data collected during the
shallow scrub will not be reported.
common/scrub,osd/scrub: minor cleanups to ScrubStore
Including:
- introducing 'no out param' encode() for the inconsistent wrappers;
- renaming the ambiguous 'empty()' to 'is_empty()';
- removing unused code;
- a few other minor cleanups.
osd/scrub: add dout() capability to the ScrubStore
now that the ScrubSTore object is directly created by the
scrubber, (and has a lifetime that does not extend beyond
the scrubber object), we can add the same dout()
mechanism used by the other scrubber sub-objects.
Note: that mechanism will be changed shortly, so that the
sub-objects would use one prefix() creator supplied by
the Scrubber object.
osd/scrub: directly create or reinit the ScrubStore
The ScrubStore is now directly created or reinitialized by the
Scrubber. Note that the store object is not identical to the
errors DB: the errors DB is an entity in the OSD store (a
collection of OMap entries in a uniquely-named object(s)),
while the ScrubSTore object is a cacher and accessor for
that entity. That one can be recreated or disposed of at
will.
We now do not recreate the ScrubStore object for every scrub.
Naman Munet [Mon, 7 Oct 2024 05:11:29 +0000 (10:41 +0530)]
mgr/dashboard: unable to edit pipe config for bucket level policy of a bucket
Fixes: https://tracker.ceph.com/issues/68387
Fixes Includes:
1) Passing additional parameter for 'user' and 'mode' as the user can be either system/dashboard or other values while creating pipe.
2) Previously while removing the src/dest bucket field, we were getting same old values on editing pipe, but now it will become '*' if empty value passed from frontend.
Signed-off-by: Naman Munet <namanmunet@li-ff83bccc-26af-11b2-a85c-a4b04bfb1003.ibm.com>
Lee Sanders [Fri, 4 Oct 2024 14:13:57 +0000 (15:13 +0100)]
qa/suites/tasks/cbt.py: Deprecating cosbench from Teuthology in preparation for deletion of cosbench support
from CBT. The code being deleting is infrastructure code, no qa test suite uses this function. Therefore it can
be safely deleted.
Vallari Agrawal [Wed, 9 Oct 2024 07:27:32 +0000 (12:57 +0530)]
qa/workunits/nvmeof/setup_subsystem.sh: use --no-group-append
In newer version of nvmeof cli, "subsystem add" needs
this tag to ensure subsystem name is value of --subsystem.
Otherwise, in newer cli version, the gateway group is appended
at the end of the subsystem name.
This fixes the teuthology nvmeof suite (currently all jobs fails
because of this).
Anoop C S [Thu, 10 Oct 2024 05:30:03 +0000 (11:00 +0530)]
cephadm/smb: Add NET_RAW capability to deploy ctdbd
CTDB heavily depends on raw sockets to send gratuitous ARPs[1](see the
second point from the list of reasons to use gratuitous ARPs). As per
the current design it is also inevitable while sending tickle ACKs[2]
in the event of an IP failover. man capabilities(7)[3] further mandates
CAP_NET_RAW to use raw sockets. Therefore append NET_RAW to the list of
capabilties while deploying ctdbd containers.
Avan Thakkar [Wed, 9 Oct 2024 13:01:11 +0000 (18:31 +0530)]
qa/cephfs: update earmark values to valid ones in test_volumes.py
smb.test is an invalid earmark now it should be either smb or
smb.cluster.<cluster_id>. Update the test_volumes.py to set
valid earmarks wherever used.
JonBailey1993 [Wed, 9 Oct 2024 10:28:42 +0000 (11:28 +0100)]
common/io_exerciser: Modify is_locked_by_me call in ceph_test_rados_io_sequence
is_locked_by_me() is a function of ceph::mutex which is only used in debug builds. By using the ceph_mutex_is_locked_by_me macro, we can neatly make sure we only run this function in debug mode, allowing compilation to no longer be affected when running in release mode.
Signed-off-by: Jon Bailey <jonathan.bailey1@ibm.com>
* refs/pull/60037/head:
test/common: add death test for double !recursive lock
common/test: do not test exception raised from recursive lock
test/common: fix invalid vim mode
common,osdc: remove obsolete ceph::mutex_debugging
common: assert debug mutex lock is not held if !recursive