Kefu Chai [Sun, 18 Dec 2022 12:18:44 +0000 (20:18 +0800)]
pybind/mgr/tox.ini: add commas in "modules" variable
since tox v4.0.13, it parses the variables differently, so the newlines
in a variable are passed right to the command referencing it. so we now
have failure like:
```
flake8: commands[0] /home/jenkins-build/build/workspace/ceph-pull-requests/src/pybind/mgr> flake8 --config=tox.ini alerts
flake8: commands[1] /home/jenkins-build/build/workspace/ceph-pull-requests/src/pybind/mgr> balancer
flake8: exit 2 (0.00 seconds) /home/jenkins-build/build/workspace/ceph-pull-requests/src/pybind/mgr> balancer
flake8: FAIL ✖ in 3.33 seconds
```
so we have to add comma as line continuation separator to address
this problem.
Kefu Chai [Sun, 18 Dec 2022 12:16:02 +0000 (20:16 +0800)]
pybind/mgr: s/setup(self)/setup_method(self)/
avoid pytest warnings like:
4: pg_autoscaler/tests/test_cal_final_pg_target.py::TestPgAutoscaler::test_even_pools_one_meta_three_bulk
4: /home/kefu/dev/ceph/src/pybind/mgr/.tox/py3/lib/python3.10/site-packages/_pytest/fixtures.py:900: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
4: pg_autoscaler/tests/test_cal_final_pg_target.py::TestPgAutoscaler::test_even_pools_one_meta_three_bulk is using nose-specific method: `setup(self)`
4: To remove this warning, rename it to `setup_method(self)`
4: See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
4: fixture_result = next(generator)
Kefu Chai [Sun, 18 Dec 2022 12:15:06 +0000 (20:15 +0800)]
pybind/mgr/prometheus: avoid using distutils
to silence warnings like:
4: prometheus/module.py:35
4: /var/ssd/ceph/src/pybind/mgr/prometheus/module.py:35: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
4: v = StrictVersion(cherrypy.__version__)
so we need to use different function signatures for talking to different
fmtlib versions.
please see
https://fmt.dev/8.1.0/api.html#_CPPv4I0Dp0EN3fmt5printEvRNSt13basic_ostreamI4CharEERK1SDpRR4Args,
and
https://fmt.dev/9.0.0/api#_CPPv4IDpEN3fmt5printEvRNSt7ostreamE13format_stringIDp1TEDpRR1T
Kefu Chai [Thu, 15 Dec 2022 09:36:05 +0000 (17:36 +0800)]
test/crimson: trade operator<<() for fmt::format<>()
so we are able to format Payload using fmtlib v9. before fmtlib v9,
fmtlib is able to fall back to the operator<<() to format the the
types with the operator<<() defined. but after fmtlib v9, we need to
explicitly define them for accessing the specialized formatter.
now that we have specialized fmt::format<> for Payload, and the only
consumer of operator<<() is the fmtlib, we can safely drop the latter.
Kefu Chai [Thu, 15 Dec 2022 09:32:55 +0000 (17:32 +0800)]
test/crimson: specialize fmt::formater<> for types to be formatted
since fmt v9, fmt::formatter<> is not specialized for the types with
operator<<(ostream&, ...) anymore. so we need to specialize it manually.
in this change, fmt::formatter<> is specialized for some types to be
formatted with fmtlib, so the tree can compile with fmt v9.
Kamoltat [Wed, 14 Dec 2022 19:54:00 +0000 (19:54 +0000)]
mon/Monitor.cc: notify_new_monmap() skips removal of non-exist rank
Problem:
In RHCS the user can choose to manually remove a monitor rank
before shutting the monitor down. Causing inconsistency in monmap.
for example we remove mon.a from the monmap, there is a short period
where mon.a is still operational and will try to remove itself from
monmap but we will run into an assertion in
ConnectionTracker::notify_ranks_removed().
Solution:
In Monitor::notify_new_monmap() we prevent the func
from going into removing our own rank, or
ranks that doesn't exists in monmap.
FYI: this is an RHCS problem only, in ODF,
we never remove a monitor from monmap
before shutting it down.
Casey Bodley [Wed, 14 Dec 2022 19:59:58 +0000 (14:59 -0500)]
Merge pull request #49141 from cbodley/wip-58111
rgw: rgw_parse_url_bucket() rejects empty bucket names after 'tenant:'
Reviewed-by: Daniel Gryniewicz <dang@redhat.com> Reviewed-by: Adam C. Emerson <aemerson@redhat.com> Reviewed-by: Abhishek Lekshmanan <abhishek.lekshmanan@cern.ch>
When a physical volume isn't a member of any volume group,
the function `get_all_devices_vgs()` in `ceph_volume.api.lvm`
shouldn't try to return an `VolumeGroup()` object against this
device.
Kefu Chai [Wed, 14 Dec 2022 11:10:54 +0000 (19:10 +0800)]
crimson/osd: include fmt/ranges.h
so we are able to format ss.clone_snaps, which is a
std::map<snapid_t, std::vector<snapid_t>>. before fmtlib v9,
fmtlib is able to fall back to the operator<<() to format the the types
with the operator<<() defined. but after fmtlib v9, we need to
explicitly define them for accessing the specialized formatter.
in this change, fmt/ranges.h is included so we can access the formatter
for std::map and std::vector.
Kefu Chai [Wed, 14 Dec 2022 11:09:49 +0000 (19:09 +0800)]
crimson/os: specialize fmt::formater<> for lba_pin_list_t
since fmt v9, fmt::formatter<> is not specialized for the types with
operator<<(ostream&, ...) anymore. so we need to specialize it manually.
in this change, fmt::formatter<lba_pin_list_t> is defined so
the tree can compile with fmt v9.
Kefu Chai [Wed, 14 Dec 2022 07:17:33 +0000 (15:17 +0800)]
crimson/os: specialize fmt::formater<> for types
since fmt v9, fmt::formatter<> is not specialized for the types with
operator<<(ostream&, ...) anymore. so we need to specialize it manually.
in this change, fmt::formatter<> is specialized for tree_stats_t and
test_item_t so the tree can compile with fmt v9.
Kefu Chai [Wed, 14 Dec 2022 00:32:44 +0000 (08:32 +0800)]
seastar: bump up seastar submodule to recent master
to address the fmtlib v9 compatibility issues.
please note, the submodule is bump up to a commit which includes
* a revert commit on top of upstream master HEAD. the revert is to
work around the a recent change which adds a constraint on the parameter
type of handle_exception(). we are using errorator along with
handle_exception(), but errorator cannot fulfill the requirement of
seastar::Future(), so we need to drop the change before we have a
better solution.
* a commit which defines __NR_pidfd_open if it is not defined.
this should address the FTBFS on CentOS8 where glibc does not have
this macro defined.
Kefu Chai [Wed, 14 Dec 2022 00:27:13 +0000 (08:27 +0800)]
test/cls_fio: specialize fmt::formater<> for bpo::options_description
since fmt v9, fmt::formatter<> is not specialized for the types with
operator<<(ostream&, ...) anymore. so we need to specialize it manually.
in this change, fmt::formatter<bpo::options_description> is defined so
the tree can compile with fmt v9.
Kefu Chai [Wed, 14 Dec 2022 00:20:42 +0000 (08:20 +0800)]
cls/fifo: specialize fmt::formater<> for rados::cls::fifo::info
since fmt v9, fmt::formatter<> is not specialized for the types with
operator<<(ostream&, ...) anymore. so we need to specialize it manually.
in this change, fmt::formatter<rados::cls::fifo::info> is defined so
the tree can compile with fmt v9.
Marcus Watts [Wed, 30 Nov 2022 23:22:30 +0000 (18:22 -0500)]
rgw: added rgw-policy-check
rgw-policy-check - a program to do syntax checking on bucket policy.
This program just reads the policy into memory, so it is not
checking anything except syntax.
Signed-off-by: Marcus Watts <mwatts@redhat.com>
rgw: Fix return value of `rgw-policy-check`
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
rgw: Use ceph initialization in `rgw-policy-check`
Specifically so we can pull in the options from `ceph.conf` and similar.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Kefu Chai [Tue, 13 Dec 2022 10:23:43 +0000 (18:23 +0800)]
crimson/os: define device_spec_t as packed
per C++ standard 20, alignas cannot be applied to scoped enum. despite
that there is a resolution to address this, see
https://cplusplus.github.io/CWG/issues/2354.html, it's not included in
C++20. so we have to use a different way to address
> runtime error: reference binding to misaligned address 0x610000008395
> for type 'device_type_t', which requires 4 byte alignment
otherwise the code would fail to compile with Clang-15, like:
> <source>:3:13: error: 'alignas' attribute cannot be applied to an enumeration
Add inclusive behavior for both first and last in omap_list_config_t,
and optimize the usage.
Set first closed last open for range for omap range remove.