Zac Dover [Mon, 12 Jun 2023 11:32:14 +0000 (21:32 +1000)]
doc/rados: add math markup to placement-groups.rst
Add some math markup to some of the mathematical expressions in
doc/rados/operations/placement-groups.rst.
This change has advantages as well as disadvantages. On the one hand,
the mathematical expressions look nicer and are easier to read. On the
other hand, the rendered mathematical expressions are not searchable as
a part of the text, which makes CTRL+F searches useless in finding them.
This PR is offered as an RFC on the matter of whether mathematical
expressions should be rendered with the :math: extension.
Xiubo Li [Tue, 23 May 2023 11:08:15 +0000 (19:08 +0800)]
xfstests_dev: install extra packages from powertools repo for xfsprogs
Centos Stream 8 has removed the 'device-mapper-devel', 'libedit-devel'
and 'userspace-rcu-devel' packages from the mirrors and we need to
install it from powertools repo.
Fixes: https://tracker.ceph.com/issues/59683 Signed-off-by: Xiubo Li <xiubli@redhat.com>
Luis Domingues [Thu, 8 Jun 2023 08:09:06 +0000 (10:09 +0200)]
doc: Add missing custom container_image
While testing cephadm in order to migrate to it in the near
futur, I needed to use some custom images for haproxy
and keepalived. I needed to see into the code to see what
existed. So I put what I found on the code into documentation.
Signed-off-by: Luis Domingues <domingues.luis@protonmail.ch>
Nizamudeen A [Wed, 7 Jun 2023 08:17:56 +0000 (13:47 +0530)]
mgr/dashboard: add popover to cluster status card
Previous dashboard has a popover for the status when there are some
warnings in the Cluster Health. Introducing the same behaviour on the
new landing page
Fixes: https://tracker.ceph.com/issues/61611 Signed-off-by: Nizamudeen A <nia@redhat.com>
John Mulligan [Tue, 6 Jun 2023 17:24:37 +0000 (13:24 -0400)]
cephadm: use 0o600 as the default mode for write_new
Add a constant DEFAULT_MODE of `0o600`, and make it the default of
the perms argument to write_new. This reduces a lot of code since
0o600 is the majority of the permissions used. Other cases can continue
to pass None to indicate no particular permissions are desired.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 6 Jun 2023 17:16:29 +0000 (13:16 -0400)]
cephadm: convert SNMPGateway create_daemon_conf to use write_new
While it is not entirely clear why this pattern of using os.open and
posix open flags instead of `open` directly was used I determined (using
strace) that the only major difference between these open flags and
those used by `open` was the lack of O_TRUNC. Unlike some other cases
this function does not use an intermediate temporary file. This means
that if the file being written already exists and the data being written
is smaller then the remaining data will not be over-written.
I looked over the context that this function is used in and decided that
this behavior must not be intentional. Thus it should be safe
to convert this function to `write_new`.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 6 Jun 2023 16:37:14 +0000 (12:37 -0400)]
cephadm: convert more temporary file writes to use write_new
Some functions are using the pattern:
```
with open(os.open(name + '.new, os.O_CREAT | os.O_WRONLY, 0o600), 'w') as f:
f.write(...)
os.rename(name + '.new', name)
```
While it is not entirely clear why this pattern was first used,
it accomplishes the same goal as `write_new` only directly calling
the posix open call. I analyzed the open flags for `write_new` and
these calls using `strace` and noted that the only significant
difference was the lack of O_TRUNC in these cases. Since the ".new"
files should not exist the lack of O_TRUC ought not make any difference.
With this decided we can convert these instances to `write_new`.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 6 Jun 2023 16:25:34 +0000 (12:25 -0400)]
cephadm: convert _write_custom_conf_files to use write_new
We double checked the meaning of "w+" and it will open the file
read-write. Since the file is never read there's no real reason
to keep it that way so its OK to convert to `write_new`.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 6 Jun 2023 00:12:59 +0000 (20:12 -0400)]
cephadm: convert some functions to use write_new
Convert a lot of the basic uses of the pattern:
with open(...) as f:
f.write(...)
os.fchown(f, ...) # sometimes
os.fchmod(f, ...) # sometimes
os.rename(...) # sometimes
These are the most obvious cases to convert to `write_new`
and should largely be uncontroversial.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 6 Jun 2023 00:08:49 +0000 (20:08 -0400)]
cephadm: create functional mock for fchown
The pyfakefs library apparently doesn't have its own mock for os.fchown.
This means that code using fchown currently calls into a mock with
no affect on the fake fs. For some reason I don't fully understand,
existing test cases work because they don't always follow the pattern
of open-write-rename. Switching to `write_new`, which always does a
rename, breaks some of the assertions performed in the tests on the fake
fs. Add a mock fchown that updates the state of the fake fs so
that converting call sites to use `write_new` will continue to work.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 6 Jun 2023 00:12:10 +0000 (20:12 -0400)]
cephadm: add write_new function for robust file writes
The cephadm code has a very common pattern made of at least one of
the three following steps:
* call fchown on the open file to set ownership
* call fchmod on the open file to set permissions
* rename the file from a temp name to final name
Add the write_new function to encapsulate these common actions.
If owner is not None then fchown will be called.
If perms is not None then fchmod will be called.
An optional encoding value may be passed.
It always uses a temporary file as a temporary file ensures that
there can never be a partially written file even in the event of
a power outage or system crash.
Encapsulating this all into a function also allows us to make
changes to this approach in the future without touching every
call site using `open(..., "w")` etc.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Mark Nelson [Wed, 27 Apr 2022 15:06:22 +0000 (15:06 +0000)]
crimson: Enable tcmalloc when using seastar
classic-osds have always caused significant memory fragmentation
when using the libc memory allocator due to the way that Ceph
tends to utilize memory. In recent testing, crimson-osd was found
to use 25-27GB of RAM with the stock 3GB bluestore cache settings
(osd_memory_target is only used when tcmalloc is available). Upon
further testing, it was found that the classic OSD is even worse,
using between 32-33GB of RAM after a 5 minute 4K sequential
write test when using libc malloc.
The good news is that it appears that crimson-osd is able to use
tcmalloc for alienstore without significant modification. Better
still, it drastically reduces memory usage. In the same test that
resulted in 25GB RSS memory usage for crimson-osd with libc malloc,
a tcmalloc linked version took around 9GB (with an 8GB
osd_memory_target). Since we do not yet (afaik) expose classic OSD
debugging in crimson it is tough to tell why we are still a little
over, but it's clear that for alienstore we are going to need to
use tcmalloc as we do in classic.
Zac Dover [Mon, 5 Jun 2023 02:13:28 +0000 (12:13 +1000)]
doc/rados: edit pools.rst (2 of x)
Edit doc/operations/rados/pools.rst.
There remains confusion in this part of the document regarding pg_num
and pgp_num. pg_num and pgp_num are not explained with sufficient
clarity. A future commit will clear up this confusion. There is also
some potential confusion between on the one hand the strings "pg-num"
and "pgp-num" and on the other hand "pg_num" and "pgp_num". The strings
with the hyphens are used in dummy commands, and the strings with the
underscores are used as key names. I think it possible that this could
confuse a reader, but I am open to discussion on the matter.
https://tracker.ceph.com/issues/58485
Co-authored-by: Anthony D'Atri <anthony.datri@gmail.com> Signed-off-by: Zac Dover <zac.dover@proton.me>