Bug #71044
closedradosgw basename wrong, breaks log rotation
0%
Description
Since radosgw 18.2.5 the basename of the radosgw process is set to notif-worker0 instead of radosgw:
root@bs-radosgw-02-tcn-a:~# systemctl status [email protected]
● [email protected] - Ceph rados gateway
Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: active (running) since Wed 2025-04-23 13:17:09 CEST; 9h ago
Main PID: 4129077 (notif-worker0)
Tasks: 616
Memory: 559.1M
CGroup: /system.slice/system-ceph\x2dradosgw.slice/[email protected]
└─4129077 /usr/bin/radosgw -f --cluster ceph --name client.rgw.bs-radosgw-02-tcn-a --setuser ceph --setgroup ceph
root@bs-radosgw-02-tcn-a:~# cat /proc/4129077/comm
notif-worker0
root@bs-radosgw-02-tcn-a:~# pgrep radosgw
root@bs-radosgw-02-tcn-a:~# pgrep notif-worker0
4129077
This breaks the logrotate configuration from ceph-common, which relies on the basename begin set to radosgw:
cat /etc/logrotate.d/ceph-common
/var/log/ceph/*.log {
rotate 7
daily
compress
sharedscripts
postrotate
killall -q -1 ceph-mon ceph-mgr ceph-mds ceph-osd ceph-fuse radosgw rbd-mirror cephfs-mirror || pkill -1 -x "ceph-mon|ceph-mgr|ceph-mds|ceph-osd|ceph-fuse|radosgw|rbd-mirror|cephfs-mirror" || true
endscript
missingok
notifempty
su root ceph
}
This results in the log file being rotated to ceph-rgw-bs-radosgw-01-tcn-a.log.1, but being held open by the notif-worker0 (aka radosgw) process and growing indefinitely. This could easily result in downtime of a radosgw server if not detected in time.
This happens for us on multiple servers running Ubuntu 22.04 and radosgw installed through apt from download.ceph.com.
AV Updated by Arthur van Kleef over 1 year ago
To clarify: what happens is that the rotated log file <rgw-name>.log.1 is kept open by the notif-worker0 process:
root@bs-radosgw-02-tcn-a:/var/log/ceph# lsof -p 4129077 | grep log
notif-wor 4129077 ceph 3w REG 253,0 800364218 654897 /var/log/ceph/ceph-rgw-bs-radosgw-01-tcn-a.log.1 (deleted)
The process keeps writing logs to a file that is no longer visible in the file system.
JI Updated by J. Eric Ivancich over 1 year ago
- Assignee set to Mark Kogan
MK Updated by Mark Kogan over 1 year ago
A.I per @Casey Bodley suggestion will bisect changes in the 'driver/rados/rgw_notify.cc'
CB Updated by Casey Bodley over 1 year ago
possibly related to https://github.com/ceph/ceph/pull/60728? commented there
MK Updated by Mark Kogan over 1 year ago
Casey Bodley wrote in #note-4:
possibly related to https://github.com/ceph/ceph/pull/60728? commented there
git bisected to commit:
e53c2311fde common: cache pthread names
the git besect flow:
git log --oneline --decorate
...
3765b1d922e Merge pull request #60672 from zdover23/wip-doc-2024-11-08-backport-56771-to-reef
67972caf076 rgw: link only radosgw with ALLOC_LIBS
vvvvvvvvvvv 198572a 2024-11-26 10:08 +0530 Milind Changire Merge pull request #60728 from mchangir/wip-68651-reef
4d6eed0bb3c test/common: keeping build happy
9bf583ded04 mds: add or update MDS thread names
4bc44fbd8e3 log: cache recent threads up to a day
e53c2311fde common: cache pthread names
^^^^^^^^^^^ Bisected cause commmit, flow below
1771755b392 mgr/dashboard: add cephfs rename REST API
f47183dea42 log: concatenate thread names and print once per thread
1f5a55e58ab log: thread name save/fetch infra
^^^^^^^^^^^
321d9d66bff Merge pull request #60709 from zdover23/wip-doc-2024-11-12-backport-60704-to-reef
18a02634f39 doc/start: fix "are are" typo
...
❯ git reset --hard 4d6eed0bb3c
^^^^^^^^^^^ - REPRO : notif-worker0
❯ pstree -paT 1 | grep -E --color=always 'radosgw\.8000'
|-notif-worker0,1323661 --nolockdep -c ./ceph.conf --log-file=./out/radosgw.8000.log --admin-socket=./out/radosgw.8000.asok..
~~~~~~~~~~~~~
❯ git reset --hard 321d9d66bff
^^^^^^^^^^^^ - OK : radosgw
❯ pstree -paT 1 | grep -E --color=always 'radosgw\.8000'
|-radosgw,1416620 --nolockdep -c ./ceph.conf --log-file=./out/radosgw.8000.log --admin-socket=./out/radosgw.8000.asok...
~~~~~~~~~~~~~~~
❯ git bisect start
❯ git bisect good
status: waiting for bad commit, 1 good commit known
❯ git bisect bad 4d6eed0bb3c
Bisecting: 2 revisions left to test after this (roughly 2 steps)
[e53c2311fdebdfb830b771c608ecb0c10ebf886e] common: cache pthread name
❯ pstree -paT 1 | grep -E --color=always 'radosgw\.8000'
|-notif-worker0,1515559 --nolockdep -c ./ceph.conf --log-file=./out/radosgw.8000.log --admin-socket=./out/radosgw.8000.asok...
❯ git bisect bad
Bisecting: 0 revisions left to test after this (roughly 1 step)
[f47183dea42ca90c7425f96c811403762d3559fd] log: concatenate thread names and print once per thread
❯ pstree -paT 1 | grep -E --color=always 'radosgw\.8000'
|-radosgw,1560179 --nolockdep -c ./ceph.conf --log-file=./out/radosgw.8000.log --admin-socket=./out/radosgw.8000.asok...
❯ git bisect good
e53c2311fdebdfb830b771c608ecb0c10ebf886e is the first bad commit
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
commit e53c2311fdebdfb830b771c608ecb0c10ebf886e
Author: Patrick Donnelly <[email protected]>
Date: Wed Oct 23 23:16:03 2024 -0400
common: cache pthread names
This provides common ceph entrypoints for the pthread_[gs]name functions which
will also cache a thread_local copy. This also removes the pthread_t parameter
which precipitated the bug i50743.
Obviously, the overall goal here is to avoid system calls.
Conflicts:
src/ceph_nvmeof_monitor_client.cc (not available in reef)
src/common/ceph_timer.h
src/include/compat.h
src/mds/Beacon.cc
src/rgw/driver/rados/rgw_notify.cc
src/rgw/rgw_lua_background.cc (not available in reef)
See-also: https://tracker.ceph.com/issues/50743
Fixes: 0be8d01c9ddde0d7d24edd34dc75f6cfc861b5ba
Fixes: https://tracker.ceph.com/issues/68691
Signed-off-by: Patrick Donnelly <[email protected]>
(cherry picked from commit 7de5af59c2741b4203cc17f619ca53096c97b8ff)
Signed-off-by: Milind Changire <[email protected]>
JI Updated by J. Eric Ivancich over 1 year ago
- Is duplicate of Backport #71156: reef: regression in thread name dump mechanism during mds restart added
JI Updated by J. Eric Ivancich over 1 year ago
- Status changed from New to Duplicate
JI Updated by J. Eric Ivancich over 1 year ago
- Backport set to squid tentacle
DV Updated by Dan van der Ster about 1 year ago
Workaround is to send the signal to notif-worker0, e.g. pkill -1 -x notif-worker0.
The logrotate file can be patched like this:
postrotate
killall -q -1 ceph-mon ceph-mgr ceph-mds ceph-osd ceph-fuse radosgw rbd-mirror cephfs-mirror notif-worker0 || pkill -1 -x "ceph-mon|ceph-mgr|ceph-mds|ceph-osd|ceph-fuse|radosgw|rbd-mirror|cephfs-mirror|notif-worker0" || true