Commit Graph

139213 Commits

Author SHA1 Message Date
Lucian Petrut
4b43afd509 common: skip boost shared_mutex with mingw-llvm
Because of winpthreads issues, we had to use Boost's shared_mutex
implementation.

When using mingw-llvm, we can safely use libc++'s shared mutex
implementation.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-30 12:59:00 +00:00
Lucian Petrut
c8d09aeb88 common: avoid <1ms waits on Windows
std::condition_variable::wait_for uses SleepConditionVariableSRW
on Windows, which has millisecond precision.

In order to avoid busy loops, we won't wait for less than one
millisecond on Windows.

Note that this situation is quite common since on Windows,
"wait_for" often returns ~1ms before the specified timeout.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-30 12:59:00 +00:00
Lucian Petrut
a17a82c6f4 common: use signedspan for monotonic ceph clocks
The monotonic clocks are commonly used for measuring time deltas,
which can be negative.

ceph::mono_clock and ceph::coarse_mono_clock currently use
unsigned duration types [1]. The difference operators are overloaded
in order to ensure that the result is signed [2][3].

However, we still have issues when unsigned timespans are compared.
For example, std::condition::wait_for can hang indefinitely due
to underflows [4][5]. It ends up using our unsigned type for a
negative timespan, which is then compared to
std::chrono::duration<Rep,Period>::zero.

In order to avoid such problems, we'll simply use a signed type
for monotonic clock durations.

With signed timespans, we can no longer assume that time_point::zero()
is equal to time_point::min(), so we're updating it accodingly.

[1] 4040f12347/src/common/ceph_time.h (L285)
[2] 4040f12347/src/common/ceph_time.h (L345-L380)
[3] 4040f12347/src/common/ceph_time.h (L466-L487)
[4] 91cff8a718/libcxx/include/__condition_variable/condition_variable.h (L178)
[5] 91cff8a718/libcxx/include/__condition_variable/condition_variable.h (L193)

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-30 12:59:00 +00:00
Lucian Petrut
09a8cb0a6a test: add timer loop tests
We've been experiencing timer hangs with mingw-llvm.
std::condition_variable::wait_for was returning a few microseconds
before the requested time and then hanging when called with a
small interval (e.g. microseconds).

This was affecting the OSD periodic tick, which would hang after
a while (20m up to 2h).

The issue can be reproduced with a timer loop and a small interval
(e.g. 40us), in which case the timer is likely to hang after about
10s.

We're adding some tests, while the actual mingw-llvm issue will
be mitigated in a separate commit.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-30 12:59:00 +00:00
Lucian Petrut
3ce1e4a5c6 win32_build.sh: mingw-llvm support
winpthreads is a library that emulates the pthreads API using
Windows primitives. It's also used by the mingw/gcc libstdc++
for std::thread.

The issue is that winpthreads isn't well maintained. There
have been numerous bugs that haven't been addressed in years.
Specifically, we've been hitting deadlocks because of the
winpthreads rw lock implementation.

This change will allow building Ceph for Windows using mingw/llvm,
which uses libc++ and doesn't rely on winpthreads.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-30 12:59:00 +00:00
Lucian Petrut
82ef35db70 test/dokan: avoid runtime dependent assertion
We're checking a permission denied exception message that's
runtime specific:

  /mnt/data/workspace/ceph_mingw_clang/src/test/dokan/dokan.cc:252: Failure
  Expected equality of these values:
    e.what()
      Which is: "filesystem error: in remove: Permission denied
      [\"Z:\\ro_success_b76223c4-c590-45e0-ab78-4d281ac512b5\"]"
    exception_msg.c_str()
      Which is: "filesystem error: cannot remove: No such device
      [Z:\\ro_success_b76223c4-c590-45e0-ab78-4d281ac512b5]"

In order to support libc++, we'll drop the exception message
assertion and rely on the exception type.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-30 12:59:00 +00:00
Lucian Petrut
0a5641d196 test: link timer test against libceph-common
This test currently failes to build for Windows using llvm
due to unresolved symbols.

We'll address the issue by explicitly specifying the ceph-common
dependency.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-30 12:59:00 +00:00
Lucian Petrut
129fa17caa common: avoid using pthread native handle if not available
Especially when targeting Windows, llvm may not necessarily
use pthreads for std::thread. In this case, we must not use the
"native" thread handle with the pthreads API.

We'll update the ceph_pthread_getname and ceph_pthread_setname
wrappers, adding a new one: ceph_pthread_kill.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-30 12:59:00 +00:00
Lucian Petrut
4a0dceec99 cmake: avoid -Bsymbolic on Windows
The "-Bsymbolic" and "-Bsymbolic-functions" flags only apply to ELF
binaries.

llvm errors out when targeting Windows, which is why we'll need
to skip those flags for Windows builds.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-30 12:59:00 +00:00
Lucian Petrut
1df7de2aa4 src/common/win32: add missing casts
clang errors out because of a few type mismatches that gcc
ignored through "-fpermissive".

We'll need to cast a few void pointers to the appropriate type.
There's also a function that doesn't have an explicit return type,
which was omitted by mistake.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-30 12:59:00 +00:00
Lucian Petrut
936252524e cmake: avoid duplicate symbols
Some symbols from the crc32, arch and fmt libs
are re-exported by libceph-common:

  FAILED: bin/unittest_time.exe
  ld.lld: error: fmt::v9::format_error::~format_error() was replaced

llvm throws errors because of the duplicate symbols.
One workaround is to use objects instead of static libs
for the libs. For libfmt we'll use the header-only version.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-30 12:59:00 +00:00
Lucian Petrut
a09b70dfd8 cmake: honor WITH_FMT_HEADER_ONLY with vendored fmt lib
We're using the vendored fmt lib when there is no system library
available. However, there is an inconsistency: the
WITH_FMT_HEADER_ONLY setting is ignored by the vendored library.

In order to address this, we'll use the fmt-header-only alias
if WITH_FMT_HEADER_ONLY is set.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-21 06:39:26 +00:00
Lucian Petrut
d40edd3ac0 rbd-wnbd: fix llvm issues
We're fixing a few rbd-wnbd issues that are currently ignored
by mingw-gcc but not by llvm:

* checking if an uint is smaller than 0
* qualified method names must be used when passing the address
* duplicate symbol "shutdown_lock"
* add missing const cast when passing WNBD interface

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-17 13:31:51 +00:00
Lucian Petrut
ba3c6d76a7 test: avoid converting addresses to "long"
On Windows x64 hosts, "long" (4B) is not large enough to hold
an address.

For this reason, we're updating "test_json_formattable.cc"
to use "long long" instead.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-17 13:31:51 +00:00
Lucian Petrut
6f80c86d46 common,test: avoid deprecated result_of_t
std::result_of_t was deprecated in c++17 and removed in c++20.
gcc kept it around for backwards compatibility, however it was
removed in clang.

For this reason, we'll need to use std::invoke_result_ot instead,
which has a slightly different syntax.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-08-17 13:31:12 +00:00
Nizamudeen A
88170fe5dd
Merge pull request #52701 from rhcs-dashboard/flake8-fix
mgr: fix flake8 compliants

Reviewed-by: Adam King <adking@redhat.com>
Reviewed-by: phlogistonjohn <NOT@FOUND>
2023-08-01 11:06:50 +05:30
Casey Bodley
501ddc2b27
Merge pull request #52341 from mkogan1/wip-T52363-xrmeng8756
rgw: fix the Content-Length in response header of static website

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2023-07-31 18:15:05 -04:00
zdover23
f4a421f8ab
Merge pull request #52131 from cityofships/docs_radosgw
doc/radosgw: correct emphasis in rate limit section

Reviewed-by: Zac Dover <zac.dover@proton.me>
2023-08-01 06:31:41 +10:00
Piotr Parczewski
50bfbab6d9
doc/radosgw: correct emphasis in rate limit section
Signed-off-by: Piotr Parczewski <piotr@stackhpc.com>
2023-07-31 16:42:26 +02:00
Casey Bodley
e23241ee72
Merge pull request #52603 from cbodley/wip-62135
qa/rgw: pacific upgrade disables centos9

Reviewed-by: Adam C. Emerson <aemerson@redhat.com>
2023-07-31 10:25:06 -04:00
Adam King
ed852fecee
Merge pull request #51987 from rkachach/fix_issue_61628
mgr/cephadm: storing prometheus/alertmanager credentials in monstore

Reviewed-by: Adam King <adking@redhat.com>
2023-07-31 08:34:54 -04:00
Nizamudeen A
0ab7e2ca0e
Merge pull request #52622 from rhcs-dashboard/allow-put-cors
mgr/dashboard: allow PUT in CORS

Reviewed-by: Pere Diaz Bou <pdiazbou@redhat.com>
2023-07-31 14:54:49 +05:30
Nizamudeen A
d199782fb5 mgr: fix some flake8 complaints
Signed-off-by: Nizamudeen A <nia@redhat.com>
2023-07-31 14:50:57 +05:30
Aashish Sharma
d32b6c2751
Merge pull request #52317 from rhcs-dashboard/rgw-overview-dashboard
mgr/dashboard: add inventory card  and single stat cards to rgw overview dashboard


Reviewed-by: Nizamudeen A <nia@redhat.com>
2023-07-31 11:06:44 +05:30
Yuval Lifshitz
b111d8c6ba
Merge pull request #52435 from vedanshbhartia/coverity_invalid_typename
rgw: typecast long long to int when passing length to format string
2023-07-30 15:58:16 +03:00
Ilya Dryomov
e45272df04
Merge pull request #52688 from petrutlucian94/avoid_tzset
build: globally set FMT_USE_TZSET=0 for Windows

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2023-07-29 00:23:42 +02:00
Anthony D'Atri
8bb6cad041
Merge pull request #52668 from bluikko/patch-16
doc/radosgw: Add missing space to date option spec in admin.rst
2023-07-28 12:38:55 -04:00
Anthony D'Atri
cc6b9ae620
Merge pull request #52685 from bluikko/patch-17
doc/mgr/ceph_api: Promptify example commands in index.rst
2023-07-28 11:15:19 -04:00
Lucian Petrut
5fd67e1f88 build: globally set FMT_USE_TZSET=0 for Windows
We're currently setting FMT_USE_TZSET=0 when building libfmt
in order to avoid the _tzset function, which is unavailable
under Mingw:
aa5769ecf1

The issue is that it still gets used by fmt/chrono.h, which is
why we'll move this definition to the top level cmake file.

Note that the Windows build is currently failing as a result of
a recent change: https://github.com/ceph/ceph/pull/52590/files

  In file included from ceph/src/common/ceph_time.h:22,
                   from ceph/src/include/encoding.h:31,
                   from ceph/src/include/uuid.h:9,
                   from ceph/src/include/types.h:21,
                   from ceph/src/crush/CrushWrapper.h:14,
                   from ceph/src/crush/CrushCompiler.h:7,
                   from ceph/src/crush/CrushCompiler.cc:4:
  ceph/src/fmt/include/fmt/chrono.h: In lambda function:
  ceph/src/fmt/include/fmt/chrono.h:953:5: error: ‘_tzset’ was
  not declared in this scope; did you mean ‘tzset’?
    953 |     _tzset();
        |     ^~~~~~
        |     tzset

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2023-07-28 14:34:37 +00:00
Nizamudeen A
7b3a4f2b4e
Merge pull request #52191 from rhcs-dashboard/fix-daemon-labels-exporter
mgr/dashboard: empty grafana panels for performance of daemons 

Reviewed-by: Pegonzal <NOT@FOUND>
Reviewed-by: cloudbehl <NOT@FOUND>
Reviewed-by: Juan Miguel Olmo <jolmomar@redhat.com>
Reviewed-by: Pere Diaz Bou <pdiazbou@redhat.com>
2023-07-28 18:46:35 +05:30
Nizamudeen A
8da2a2c0e2 mgr/dashboard: allow PUT in CORS
Fixes: https://tracker.ceph.com/issues/62222
Signed-off-by: Nizamudeen A <nia@redhat.com>
2023-07-28 18:35:20 +05:30
avanthakkar
fa2d1f9f07 mgr/dashboard: empty grafana panels for performance of daemons
Fixes: https://tracker.ceph.com/issues/61792
Signed-off-by: avanthakkar <avanjohn@gmail.com>

Removing the `ceph-` prefix from ceph_daemon label to adopt it with the label
format used by queries in grafana dashboards. Also changing the
`instance_id` label for rgw to match the values coming from
exporter and prometheus module
2023-07-28 16:05:32 +05:30
Ville Ojamo
4f9bd62f37
doc/mgr/ceph_api: Promptify example commands in index.rst
Use the more modern prompt block instead of
using code blocks for example commands.

Signed-off-by: Ville Ojamo <14869000+bluikko@users.noreply.github.com>
2023-07-28 11:49:19 +07:00
Ville Ojamo
dd16ad9055 doc/radosgw: Add missing space to date option spec in admin.rst
The start time and end time CLI option specification is missing a space between the date and the optional time value. Also expand the text to talk about "optional time" after the date.

Signed-off-by: Ville Ojamo <14869000+bluikko@users.noreply.github.com>
2023-07-28 10:54:06 +07:00
Ilya Dryomov
23f9ebb115
Merge pull request #52549 from cbodley/wip-qa-distros-centos9-no-copr
qa/distros: disable ceph/el9 copr workaround for missing python deps

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2023-07-27 21:40:07 +02:00
zdover23
8e6c03fdda
Merge pull request #52671 from zdover23/wip-doc-2023-07-27-readmemd-2-of-x
doc: update README.md install procedure

Reviewed-by: Anthony D'Atri <anthony.datri@gmail.com>
2023-07-28 05:11:44 +10:00
Ronen Friedman
190be730ff
Merge pull request #52591 from ronen-fr/wip-rf-cephx-init
cephx: initializing two member variables in the ctors


Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Reviewed-by: Adam C. Emerson <aemerson@redhat.com>
2023-07-27 19:13:06 +03:00
Ronen Friedman
c14e94d0d1
Merge pull request #52590 from ronen-fr/wip-rf-res-type2
osd/scrub: fixing & improving ReservationTimeout handler messages

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2023-07-27 18:24:06 +03:00
Adam King
408c1cc056
Merge pull request #52084 from rhcs-dashboard/fix-exporter-addrs
exporter: ceph-exporter scrapes failing on multi-homed server

Reviewed-by: Adam King <adking@redhat.com>
Reviewed-by: Juan Miguel Olmo Martínez <jolmomar@ibm.com>
Reviewed-by: Redouane Kachach <rkachach@redhat.com>
2023-07-27 09:58:51 -04:00
Zac Dover
0b0009bf1f doc: update README.md install procedure
Add instructions directing the reader to install the "python3-routes"
package. This package is required in order to launch the dashboard after
the installation procedure has completed, but is not yet included in the
install-deps.sh script.

Signed-off-by: Zac Dover <zac.dover@proton.me>
2023-07-27 21:49:19 +10:00
Venky Shankar
67f334d047 Merge PR #52376 into main
* refs/pull/52376/head:
	mds: skip forwarding request if the session were removed

Reviewed-by: Dhairya Parmar <dparmar@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
2023-07-27 16:38:36 +05:30
Venky Shankar
bdde984397 Merge PR #52176 into main
* refs/pull/52176/head:
	mds: remove calculating caps after adding revokes back

Reviewed-by: Venky Shankar <vshankar@redhat.com>
2023-07-27 16:37:55 +05:30
Venky Shankar
d3f9d14022 Merge PR #51536 into main
* refs/pull/51536/head:
	mds: do not send split_realms for CEPH_SNAP_OP_UPDATE msg

Reviewed-by: Dhairya Parmar <dparmar@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Jos Collin <jcollin@redhat.com>
2023-07-27 13:38:54 +05:30
Venky Shankar
edd0eb1592 Merge PR #52275 into main
* refs/pull/52275/head:
	mds: update mdlog perf counters during replay

Reviewed-by: Venky Shankar <vshankar@redhat.com>
2023-07-27 13:37:29 +05:30
Aashish Sharma
6a21d60123 mgr/dashboard: Add inventory card and two single stat panels to rgw
overview dashboard

Signed-off-by: Aashish Sharma <aasharma@redhat.com>
2023-07-27 11:31:43 +05:30
Ilya Dryomov
a0d126376c
Merge pull request #52624 from idryomov/wip-61565
qa/workunits/rbd: use jammy version of qemu-iotests for centos 9

Reviewed-by: Ramana Raja <rraja@redhat.com>
2023-07-26 18:23:29 +02:00
Nizamudeen A
0033dcb2dd
Merge pull request #52546 from rhcs-dashboard/node-16-main
deps: increase the node version to 16

Reviewed-by: Aashish Sharma <aasharma@redhat.com>
Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Ken Dreyer <kdreyer@redhat.com>
2023-07-26 19:32:24 +05:30
Casey Bodley
47e8b1e518
Merge pull request #49810 from baergj/fix-create_time_event-header
async: Fix units in the create_time_event() declaration.

Reviewed-by: Casey Bodley <cbodley@redhat.com>
Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2023-07-26 08:24:55 -04:00
Aashish Sharma
d88b456512
Merge pull request #52644 from rhcs-dashboard/fix-62124-main
mgr/dashboard: add validations to zone access/secret key in zone creation/edit form


Reviewed-by: Pedro Gonzalez Gomez <pegonzal@redhat.com>
2023-07-26 17:16:10 +05:30
mengxiangrui
e0bb8313fd rgw: fix the Content-Length in response header is inconsistent with response body size when rgw returns default html error page in static website
The default html error page as response body should be built completely include three ending html symbols(/ul, /body and /html) before rgw computes Content-Length in response header. The Content-Length in response header will be consistent with response body size. Client can get complete page.

Fixes: https://tracker.ceph.com/issues/52363

(cherry picked from commit cbeaef9fbe)

Co-authored-by: aicun hu <huaicun@chinatelecom.cn>
Co-authored-by: yupeng chen <chenyupeng@chinatelecom.cn>
Signed-off-by: xiangrui meng <mengxr@chinatelecom.cn>
2023-07-26 11:41:09 +00:00