without specifying -Og, -O0 is used. as per
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
> -O0
> Reduce compilation time and make debugging produce the expected
> results. This is the default.
and
> -Og
> Optimize debugging experience. -Og should be the optimization level of
> choice for the standard edit-compile-debug cycle, offering a reasonable
> level of optimization while maintaining fast compilation and a good
> debugging experience. It is a better choice than -O0 for producing
> debuggable code because some compiler passes that collect debug
> information are disabled at -O0.
and Debug is the default built type if .git directory is found under
the root source directory, so by adding "-Og -g" to CMAKE_C_FLAGS_DEBUG,
developers can have better debugging experience when testing Ceph
built from a git repo. but the downside is that it might take longer
to build the tree.
this change should also enable us to link crimson on aarch64.
the same applies to Clang,
> -O0 Means “no optimization”: this level compiles the fastest and generates the most debuggable code.
> -O1 Somewhere between -O0 and -O2.
> -O2 Moderate level of optimization which enables most optimizations.
> -Og Like -O1. In future versions, this option might disable different optimizations in order to improve debuggability.
see
https://clang.llvm.org/docs/CommandGuide/clang.html#cmdoption-o0
see also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101448
per https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
> -Og
> Optimize debugging experience. -Og should be the optimization level of
> choice for the standard edit-compile-debug cycle, offering a reasonable
> level of optimization while maintaining fast compilation and a good
> debugging experience. It is a better choice than -O0 for producing
> debuggable code because some compiler passes that collect debug
> information are disabled at -O0.
so instead of using -O0, for better developer experience, -Og is
recommended.
cmake: use add_compile_options() to pass compile options
add_definitions() is for adding "-D" define flags, while "-include" does
not define flags, so let's be explicit and use add_compile_options()
instead.
this change partially reverts 5fb90bb79671b8e22f507728e4b4b948a591f98f.
back then, we were using ubuntu bionic for building windows packages.
but since we've switched to ubuntu focal, where cmake 3.16 is available,
there is no reason to stick with add_definitions() anymore.
since we dropped the support of bionic, we now have the luxury of using
newer CMake! and by using CMake 3.16, we now have access to
* add_compile_definitions(), which was introduced in cmake 3.12
also, drop the comment of
> remove cmake/modules/FindPython* once 3.12 is required
because we need to support python 3.10 in future, better off keeping
the FindPython files around, so we can backport cmake changes from
upstream when necessary.
we are allowed to bump up the CMake's required to 3.16, because:
- ubuntu focal ships with cmake 3.16.3
- RHEL/CentOS8's AppStream has cmake 3.18
do not rely on the uninitialized bits on stack for testing, otherwise
there is chance that we have following test failure:
64: ../src/test/test_ipaddr.cc:226: Failure
64: Expected equality of these values:
64: two.ifa_addr
64: Which is: 127.0.0.1:57677
64: result
64: Which is: 127.0.0.1:57677
the root cause is just that the "result" is actually `one.ifa_addr`,
which is marked UP as that's what the uninitialized bits on stack
indicate.
to initialize an alienstore with a reference of
seastar::alien::instance is but the internal of AlienStore, would be
better if we could avoid exposing it as a part of the interface of
crimson::osd::OSD().
so, in this change, instead of creating FuturizedStore in OSD(), we
create it in main() where the app is available, so we can just create
FuturizedStore without passing the alien instance all the way down to
OSD().
crimson/osd: use app.alien() to initialize AlienStore::alien
in e53ea0886fba9073904f59ea85fb73d854565921, the new alien::submit_to() API
is used in the place of the old one. but seastar::alien::instance::_qs
should be initialized before we are able to use the alien instance, just
creating an instance of alien::instance is not enough.
in this change, instead of creating an instance of alien::instance using
make_unique<>, the return value of app.alien() is used to initialize the
alien member variable of AlienStore. app.alien() is always properly
initialized by reactor.
test/crimson/test_alien_echo: msgr->stop() before shutdown
it is required to remove all registered dispatchers before shutting down a
messenger. otherwise assert(dispatchers.empty()) in SocketMessenger::shutdown() fails.
Sage Weil [Thu, 15 Jul 2021 20:17:23 +0000 (15:17 -0500)]
mon: allow a MON_DOWN grace period after cluster mkfs
During teuthology tests, the initial cluster bootstrap often starts up
the mon sbut doesn't include all mons in the initial quorum, due to
mon startup misalignment and random delays. Provide a short grace period
where we will not raise a MON_DOWN alert even though the quorum is not
complete.
Fixes: https://tracker.ceph.com/issues/43584 Signed-off-by: Sage Weil <sage@newdream.net>
Sage Weil [Thu, 15 Jul 2021 15:05:22 +0000 (11:05 -0400)]
Merge PR #42073 into master
* refs/pull/42073/head:
doc/mgr/nfs: fix 'export apply', pool name
PendingReleaseNotes: document workaround for NFS storage change
qa/tasks/mgr/test_orchestrator_cli: fix test
qa/suites/orch/cephadm/mgr-nfs-upgrade: add test for nfs migration
mgr/cephadm: migrate nfs grace file
mgr/nfs: migrate pre-pacific nfs.ganesha-foo clusters to nfs.foo
doc/cephfs/fs-nfs-exports: document new export apply capabilities
qa/tasks/cephfs/test_nfs: define NFS_POOL_NAME
mgr/nfs: use NFS_POOL_NAME in test_nfs.py
mgr/nfs: test export apply on JSON list
mgr/nfs: add test for ganesha conf apply/import
qa/tasks/cephfs/test_nfs: retry mount a few times
mgr/cephadm: migrate all legacy nfs exports to new .nfs pool
mgr/nfs: adjust cephfs export caps if necessary
python-common: don't accept pool/ns for NFSServiceSpec
mgr/orchestrator: drop rados_config_location ServiceDescription property
mgr/cephadm: move rados_config_location() out of NFSServiceSpec
mgr/nfs: change nfs pool to .nfs
mgr/nfs/export: accept a JSON or ganesha EXPORT config
mgr/nfs: allow 'nfs export apply' to take a list of exports
python-common: remove pool + namespace from NFSServiceSpec
mgr/nfs: used fixed pool + ns
mgr/rook: used fixed pool + ns
mgr/dashboard: use fixed pool + ns
mgr/cephadm: always use fixed pool and namespace
mgr/nfs: adjust test to match pool name
mgr/nfs: always create ganesha pool with well-defined name
cmake: add transitive dependency on legacy-option-headers
the legacy-option-headers target is only marked as a dependency of the
common-objs and common-common-objs. because those targets are OBJECT
libraries, their dependencies aren't inherited by the targets that link
common-objs or common-common-objs
this adds the dependencies manually, so that changes to the config
yaml files will cause legacy-option-headers to regenerate the headers
Sage Weil [Fri, 2 Jul 2021 19:53:15 +0000 (15:53 -0400)]
mgr/cephadm: migrate all legacy nfs exports to new .nfs pool
Migrate all past NFS pools, whether they were created by mgr/nfs or by
the dashboard, to the new mgr/nfs .nfs pool.
Since this migrations relies on RADOS being available, we have to be a bit
careful here: we only attempt the migration from serve(), not during
module init.
After the exports are re-imported, we destroy existing ganesha daemons so
that new ones will get recreated. This ensures the (new) daemons have
cephx keys to access the new pool.
Note that no attempt is made to clean up the old NFS pools. This is out
of paranoia: if something goes wrong, the old NFS configuration data will
still be there.
Sage Weil [Fri, 2 Jul 2021 16:39:29 +0000 (12:39 -0400)]
mgr/nfs: change nfs pool to .nfs
This is a new pool that we can migrate all past NFS configuration to,
simplifying the migration process (and also allowing us to pick a
.-prefixed name).
Sage Weil [Wed, 14 Jul 2021 18:38:59 +0000 (14:38 -0400)]
Merge PR #42041 into master
* refs/pull/42041/head:
mgr/restful: ignore min/max_size
test/crush: drop min/max_size refs
qa/workunits/mon/pool_ops: remove test for min/max_size check
qa: scrub a few remaining mentions of ruleset
qa/standalone/mon/osd-*: fix tests
PendingReleaseNotes: note min/max_size removal
mgr/dashboard: remove max/min_size and ruleset
mon/OSDMonitor: fix calls to CrushTester
crush: eliminate min_size and max_size
test/cli/crushtool: reunumber rulesets in test maps
crushtool: require min/max or num-rep for --test
crush: remove last traces of 'ruleset'
test/cli/crushtool: use 'id' instead of 'ruleset' in crush inputs
crushtool: take --min-rep and --max-rep explicitly
crush/CrushTester: drop --ruleset
doc: scrub 'ruleset' from docs
src/erasure-code: rule, not ruleset
mon/OSDMonitor: remove check_crush_rule() callers
mon/OSDMonitor: rule, not ruleset
crushtool: remove check for overlapped ruels
crush/CrushWrapper: get_osd_pool_default_crush_replicated_ruleset -> rule
crush: remove find_rule()
mon/OSDMonitor: use pool's crush rule directly
osd/OSDMap: drop checks for ruleset == ruleid
osd/OSDMap: use pool's crush rule_id directly
mon/PGMap: use pool's crush_rule directly
mon/OSDMonitor: remove crush ruleset->rule rewrite
Adam C. Emerson [Wed, 14 Jul 2021 14:57:02 +0000 (10:57 -0400)]
rgw: Rename REMOVE_OBJ to INVALIDATE_OBJ
Also rename ObjectCache::remove to ObjectCache::invalidate_remove
Since we're depending on these message types/functions having
invalidate semantics but NOT caching a negative result, rename and
leave a comment for clarity.
Fixes: https://tracker.ceph.com/issues/51674 Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
When the mgr dashboard module isn't enabled then the iSCSI service deletion
is stuck and the cluster state goes ERR.
The `ceph dashboard` commands aren't available when the mgr dashboard module
isnt' enabled.
Javier Cacheiro [Mon, 12 Jul 2021 14:03:27 +0000 (16:03 +0200)]
Fetch the actually running selinux status.
The HostFacts should return the **actual** selinux mode in which the
kernel is running.
The actual mode can be different from the one in the configuration
if the server has not been rebooted or if the mode was changed
after boot using setenforce.
Instead of reading _selinux_path_list we should look at the output of
sestatus or getenforce.
The _selinux_path_list attribute is no longer needed.
Fixes: https://tracker.ceph.com/issues/51632 Signed-off-by: Javier Cacheiro <javier.cacheiro.lopez@cesga.es>