Project

General

Profile

Actions

Bug #66100

closed
OO OO

period-update-commit causes rgw instances to hang while reloading the new realm

Bug #66100: period-update-commit causes rgw instances to hang while reloading the new realm

Added by Oguzhan Ozmen over 2 years ago. Updated 29 days ago.

Status:
Backporting
Priority:
Normal
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
squid tentacle
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v20.3.0-5091-g9be6024ee6
Released In:
v21.2.0~1338
Upkeep Timestamp:
2026-11-04T01:08:26+00:00

Description

We have been running " period update --commit " radosgw-admin command on several multisite clusters these days to enable certain zone and zonegroup features such as dynamic-resharding, notifications. In a couple of occasions, we have seen that some or all rgw instances hang/blocked during the reload of the new realm. As the workaround, the blocked gateways were restarted which resolved the issue.

In the latest incident, 2 " period update --commit "s were issued back-to-back ~4 minutes apart. The first commit seems to have successfully completed since all instances emitted the " Resuming frontends with new realm configuration" within 10 seconds. The second commit executed ~4 mins later caused the hang across all rgw instances.

Unfortunately, in none of these occasions, a core was obtained so it's hard to tell what thread caused the block. However, in my test setup, I could reproduce the issue by executing the commit multiple times back-to-back. But again, it's not possible to tell whether the reproduction has the same hang-signature as the ones we observed in our production systems due to lack of the cores.

Reproduction Results

Reproduced using a recent HEAD of upstream/main branch. A multisite setup both clusters having 3 rgw instances. Only 1 of the 3x2 instances hang. I can attach the core perhaps but below is the initial analysis:

reload hang during "closing the storage" - which is what we observe in production systems as well. the ones that hang emit "Frontends paused" event but not "driver/store closed".

(gdb) t 536
[Switching to thread 536 (Thread 0x7f6e96280700 (LWP 632560))]
#0  0x00007f6fce77d6cd in __pthread_timedjoin_ex () from /lib64/libpthread.so.0
(gdb) bt
#0  0x00007f6fce77d6cd in __pthread_timedjoin_ex () from /lib64/libpthread.so.0
#1  0x00007f6fd188ace0 in Thread::join (this=0x557ed7d60870, prval=prval@entry=0x0) at ../src/common/Thread.cc:176
#2  0x0000557ed56c5925 in RGWRadosThread::stop (this=0x557edf29a680) at ../src/rgw/driver/rados/rgw_rados.cc:321
#3  0x0000557ed5728b95 in RGWRados::finalize (this=0x557ee354e000) at ../src/rgw/driver/rados/rgw_rados.cc:1038
#4  0x0000557ed5768c9e in rgw::sal::RadosStore::finalize (this=<optimized out>) at ../src/rgw/driver/rados/rgw_sal_rados.cc:1950
#5  0x0000557ed55b5d10 in DriverManager::close_storage (driver=0x557edfbbe440) at ../src/rgw/rgw_sal.cc:344
#6  0x0000557ed51fecf3 in RGWRealmReloader::reload (this=0x557edce61040) at ../src/rgw/rgw_realm_reloader.cc:101
#7  0x0000557ed5200c2b in RGWRealmReloader::C_Reload::finish (this=<optimized out>, r=<optimized out>) at ../src/rgw/rgw_realm_reloader.cc:58
#8  0x0000557ed50bde93 in Context::complete (this=0x557edff83070, r=<optimized out>) at ../src/include/Context.h:99
#9  0x00007f6fd18959a5 in CommonSafeTimer<ceph::mutex_debug_detail::mutex_debug_impl<false> >::timer_thread (this=0x557edce61070) at ../src/common/Timer.cc:113
#10 0x00007f6fd1896a03 in CommonSafeTimerThread<ceph::mutex_debug_detail::mutex_debug_impl<false> >::entry (this=<optimized out>) at ../src/common/Timer.cc:33
#11 0x00007f6fd188aa57 in Thread::entry_wrapper (this=0x557edcd69540) at ../src/common/Thread.cc:87
#12 0x00007f6fd188aa6f in Thread::_entry_func (arg=<optimized out>) at ../src/common/Thread.cc:74
#13 0x00007f6fce77c1ca in start_thread () from /lib64/libpthread.so.0
#14 0x00007f6fcd516e73 in clone () from /lib64/libc.so.6

(gdb) f 2
#2  0x0000557ed56c5925 in RGWRadosThread::stop (this=0x557edf29a680) at ../src/rgw/driver/rados/rgw_rados.cc:321
321         worker->join();
(gdb) p worker
$15 = (RGWRadosThread::Worker *) 0x557ed7d60870

Looking at the worker thread that got stuck, it's the "data-sync" thread blocked due to throttling.

(gdb) t 566
[Switching to thread 566 (Thread 0x7f6ea44af700 (LWP 644597))]
#0  0x00007f6fce78245c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
(gdb) bt
#0  0x00007f6fce78245c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f6fcdef8860 in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /lib64/libstdc++.so.6
#2  0x00007f6fd188f1ed in std::condition_variable::wait<Throttle::_wait(int64_t, std::unique_lock<std::mutex>&)::<lambda()> > (__p=..., __lock=..., this=0x557edfc9f5d0) at /opt/rh/gcc-toolset-11/root/usr/include/c++/11/condition_variable:103
#3  Throttle::_wait (this=this@entry=0x557ee03173d0, c=c@entry=1, l=...) at ../src/common/Throttle.cc:108
#4  0x00007f6fd188fb8f in Throttle::get (this=this@entry=0x557ee03173d0, c=c@entry=1, m=m@entry=0) at ../src/common/Throttle.cc:172
#5  0x0000557ed5a420fc in RGWAsyncRadosProcessor::queue (this=0x557ee0317180, req=req@entry=0x557ee030c2c0) at ../src/rgw/driver/rados/rgw_cr_rados.cc:105
#6  0x0000557ed5a43baf in RGWSimpleRadosLockCR::send_request (this=0x557edf3c6300, dpp=<optimized out>) at ../src/rgw/driver/rados/rgw_cr_rados.cc:539
#7  0x0000557ed53f132d in RGWSimpleCoroutine::state_send_request (this=this@entry=0x557edf3c6300, dpp=dpp@entry=0x557ed7d608a8) at ../src/rgw/rgw_coroutine.cc:1115
#8  0x0000557ed53f8951 in RGWSimpleCoroutine::operate (this=0x557edf3c6300, dpp=0x557ed7d608a8) at ../src/rgw/rgw_coroutine.cc:1082
#9  0x0000557ed51ec102 in RGWCoroutine::operate_wrapper (this=<optimized out>, dpp=<optimized out>) at ../src/rgw/rgw_coroutine.h:273
#10 0x0000557ed53f4e6e in RGWCoroutinesStack::operate (this=0x557ee088b400, dpp=<optimized out>, _env=_env@entry=0x7f6ea44aa730) at ../src/rgw/rgw_coroutine.cc:252
#11 0x0000557ed53f66aa in RGWCoroutinesManager::run (this=this@entry=0x557edf29a730, dpp=<optimized out>, stacks=std::__cxx11::list = {...}) at ../src/rgw/rgw_coroutine.cc:653
#12 0x0000557ed53f8592 in RGWCoroutinesManager::run (this=this@entry=0x557edf29a730, dpp=<optimized out>, op=0x557edf5dc700) at ../src/rgw/rgw_coroutine.cc:792
#13 0x0000557ed5a8099c in RGWRemoteDataLog::run_sync (this=this@entry=0x557edf29a730, dpp=<optimized out>, dpp@entry=0x557ed7d608a8, num_shards=<optimized out>) at ../src/rgw/driver/rados/rgw_data_sync.cc:3256
#14 0x0000557ed572b53a in RGWDataSyncStatusManager::run (dpp=0x557ed7d608a8, this=0x557edf29a6d8) at ../src/rgw/driver/rados/rgw_data_sync.h:526
#15 RGWDataSyncProcessorThread::process (this=0x557edf29a680, dpp=0x557ed7d608a8) at ../src/rgw/driver/rados/rgw_rados.cc:536
#16 0x0000557ed56f0df9 in RGWRadosThread::Worker::entry (this=0x557ed7d60870) at ../src/rgw/driver/rados/rgw_rados.cc:333
#17 0x00007f6fd188aa57 in Thread::entry_wrapper (this=0x557ed7d60870) at ../src/common/Thread.cc:87
#18 0x00007f6fd188aa6f in Thread::_entry_func (arg=<optimized out>) at ../src/common/Thread.cc:74
#19 0x00007f6fce77c1ca in start_thread () from /lib64/libpthread.so.0
#20 0x00007f6fcd516e73 in clone () from /lib64/libc.so.6

(gdb) f 16
#16 0x0000557ed56f0df9 in RGWRadosThread::Worker::entry (this=0x557ed7d60870) at ../src/rgw/driver/rados/rgw_rados.cc:333
333         int r = processor->process(this);
(gdb) p this
$17 = (RGWRadosThread::Worker * const) 0x557ed7d60870

(gdb) f 5
#5  0x0000557ed5a420fc in RGWAsyncRadosProcessor::queue (this=0x557ee0317180, req=req@entry=0x557ee030c2c0) at ../src/rgw/driver/rados/rgw_cr_rados.cc:105
105       req_throttle.get(1);
(gdb) list
100       req->send_request(dpp);
101       req->put();
102     }
103
104     void RGWAsyncRadosProcessor::queue(RGWAsyncRadosRequest *req) {
105       req_throttle.get(1);
106       req_wq.queue(req);
107     }
108
109     int RGWAsyncGetSystemObj::_send_request(const DoutPrefixProvider *dpp)

(gdb) f 4
#4  0x00007f6fd188fb8f in Throttle::get (this=this@entry=0x557ee03173d0, c=c@entry=1, m=m@entry=0) at ../src/common/Throttle.cc:172
172         waited = _wait(c, l);
(gdb) list
167         std::unique_lock l(lock);
168         if (m) {
169           ceph_assert(m > 0);
170           _reset_max(m);
171         }
172         waited = _wait(c, l);
173         count += c;
174       }
175       if (logger) {
176         logger->inc(l_throttle_get);

(gdb) f 3
#3  Throttle::_wait (this=this@entry=0x557ee03173d0, c=c@entry=1, l=...) at ../src/common/Throttle.cc:108
108           cv->wait(l, [this, c, cv]() { return (!_should_wait(c) &&
(gdb) list
103           waited = true;
104           ldout(cct, 2) << "_wait waiting..." << dendl;
105           if (logger)
106             start = mono_clock::now();
107
108           cv->wait(l, [this, c, cv]() { return (!_should_wait(c) &&
109                                                 cv == conds.begin()); });
110           ldout(cct, 2) << "_wait finished waiting" << dendl;
111           if (logger) {
112             logger->tinc(l_throttle_wait, mono_clock::now() - start);
(gdb) p max
$23 = {<std::__atomic_base<long>> = {static _S_alignment = 8, _M_i = 64}, static is_always_lock_free = true}
(gdb) p count
$24 = {<std::__atomic_base<long>> = {static _S_alignment = 8, _M_i = 64}, static is_always_lock_free = true}
(gdb) p c
$25 = 1

Some other relevant issues just for reference

This last one is still an OPEN item which shows a stuck librados call can cause realm-reload to hang I believe since librados calls to the underlying rados cluster do not have a timeout. Looking at the PG stats for the latest production incident, I don't see any degraded or inactive PGs while 2 commits were issued. So, I believe this is not the issue we observed.

Question

Looks like rgw has a protection to avoid overlapping commits. Which is what we observe actually (both in test-reproduction and in production systems), we see "Resuming frontends with new realm configuration" events before the second commit triggers another realm-reload. However, is it possible that, although an rgw instance has emitted this event, the rgw-instance is still initializing certain components when the following commit triggered realm-reload: an un-intentional overlap of 2 commits?


Related issues 2 (1 open — 1 closed)

Copied to rgw - Backport #74737: tentacle: period-update-commit causes rgw instances to hang while reloading the new realmFix Under ReviewOguzhan Ozmen

Actions
Copied to rgw - Backport #74738: squid: period-update-commit causes rgw instances to hang while reloading the new realmResolvedOguzhan Ozmen

Actions

CB Updated by Casey Bodley about 2 years ago Actions #1

  • Status changed from New to Need More Info

i see that https://github.com/ceph/ceph/pull/57640 merged to immediately close client connections. is that enough to resolve this issue?

OO Updated by Oguzhan Ozmen about 2 years ago Actions #2

Yes, I believe we can close this resolved. From the comment in that PR (https://github.com/ceph/ceph/pull/57640#pullrequestreview-2094688372):

BBoozmen left a comment:
LGTM - our test which could reproduce https://tracker.ceph.com/issues/66100 (reloading new realm > getting stuck while closing the underlying store/driver) is now passing with these changes.

OO Updated by Oguzhan Ozmen about 2 years ago Actions #3

Can this one be backported to Squid?

OO Updated by Oguzhan Ozmen about 2 years ago Actions #4

  • Pull request ID set to 57640

OO Updated by Oguzhan Ozmen about 1 year ago Actions #5

  • Status changed from Need More Info to New

Re-opening the case

Unfortunately, this issue still happens in Squid and we can reproduce it in main branch as well using mstart.

Squid

We don't find ourselves running `radosgw-admin period update --commit` as much in our production systems (running Squid 19.2.1) but a recent attempt resulted in the same behaviour described in this tracker:
- realm reloader paused the frontends successfully: https://github.com/ceph/ceph/blob/4eb0fc979231d49b134b47b050f2c85a2d875844/src/rgw/rgw_realm_reloader.cc#L95
- but the procedure stalls at closing the driver; close_storage stalls indefinitely: https://github.com/ceph/ceph/blob/4eb0fc979231d49b134b47b050f2c85a2d875844/src/rgw/rgw_realm_reloader.cc#L101

Below is the backtrace from the production incident showing that RGWRealmReloader::reload stuck at DriverManager::close_storage(env.driver) when trying to stop the data-sync thread: https://github.com/ceph/ceph/blob/4eb0fc979231d49b134b47b050f2c85a2d875844/src/rgw/driver/rados/rgw_rados.cc#L1038. Our realm has 2 two zones only so it's a single thread of data-sync being stopped there.

Thread 9 (Thread 0x7fced54a7700 (LWP 11378)):
#0  0x00007fee4d10d6bd in __pthread_timedjoin_ex () from /lib64/libpthread.so.0
#1  0x00007fee4f7b9dc1 in Thread::join (this=0x55e69821e360, prval=prval@entry=0x0) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/common/Thread.cc:176
#2  0x000055e69494b885 in RGWRadosThread::stop (this=0x55e6983c4480) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/driver/rados/rgw_rados.cc:321
#3  0x000055e6949acc9a in RGWRados::finalize (this=0x55e69733f700) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/driver/rados/rgw_rados.cc:1038
#4  0x000055e6948717f6 in DriverManager::close_storage (driver=0x55e697e0df80) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/rgw_sal.cc:342
#5  0x000055e69451f755 in RGWRealmReloader::reload (this=0x55e698159340) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/rgw_realm_reloader.cc:101
#6  0x000055e69440c30d in Context::complete (this=0x55e6985cafd0, r=<optimized out>) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/include/Context.h:99
#7  0x00007fee4f7c6a0d in CommonSafeTimer<std::mutex>::timer_thread (this=0x55e698159370) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/common/Timer.cc:113
#8  0x00007fee4f7c7fe1 in CommonSafeTimerThread<std::mutex>::entry (this=<optimized out>) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/common/Timer.cc:33
#9  0x00007fee4d10c1ca in start_thread () from /lib64/libpthread.so.0
#10 0x00007fee4c1238d3 in clone () from /lib64/libc.so.6

Looking at the RGWDataSyncProcessorThread stalling the reload:

Thread 31 (Thread 0x7fcee04de700 (LWP 11333)):
#0  0x00007fee4d112371 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007fee4cb17870 in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /lib64/libstdc++.so.6
#2  0x00007fee4f7beaf5 in std::condition_variable::wait<Throttle::_wait(int64_t, std::unique_lock<std::mutex>&)::<lambda()> > (__p=..., __lock=..., this=<optimized out>) at /opt/rh/gcc-toolset-12/root/usr/include/c++/12/condition_variable:102
#3  Throttle::_wait (this=0x55e697f89108, c=1, l=...) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/common/Throttle.cc:108
#4  0x00007fee4f7bf4ff in Throttle::get (this=this@entry=0x55e697f89108, c=c@entry=1, m=m@entry=0) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/common/Throttle.cc:172
#5  0x000055e694c94dd1 in RGWAsyncRadosProcessor::queue (this=0x55e697f88f00, req=0x55e6a0d91600) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/driver/rados/rgw_cr_rados.cc:105
#6  0x000055e694d05e74 in RGWRemoveObjCR::send_request (this=0x55e6a46a0000, dpp=<optimized out>) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/driver/rados/rgw_cr_rados.h:1423
#7  0x000055e6946eaea3 in RGWSimpleCoroutine::state_send_request (this=0x55e6a46a0000, dpp=<optimized out>) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/rgw_coroutine.cc:1115
#8  0x000055e6946f1192 in RGWSimpleCoroutine::operate (this=0x55e6a46a0000, dpp=0x55e69821e378) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/rgw_coroutine.cc:1082
#9  0x000055e6946ee89b in RGWCoroutine::operate_wrapper (dpp=0x55e69821e378, this=0x55e6a46a0000) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/rgw_coroutine.h:273
#10 RGWCoroutinesStack::operate (this=0x55e69bf83a40, dpp=0x55e69821e378, _env=<optimized out>) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/rgw_coroutine.cc:252
#11 0x000055e6946ef8a9 in RGWCoroutinesManager::run (this=0x55e6983c4530, dpp=<optimized out>, stacks=...) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/rgw_coroutine.cc:653
#12 0x000055e6946f0685 in RGWCoroutinesManager::run (this=this@entry=0x55e6983c4530, dpp=dpp@entry=0x55e69821e378, op=0x55e69a9fa000) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/rgw_coroutine.cc:792
#13 0x000055e694cd4afb in RGWRemoteDataLog::run_sync (this=this@entry=0x55e6983c4530, dpp=0x55e69821e378, num_shards=<optimized out>) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/driver/rados/rgw_data_sync.cc:3255
#14 0x000055e6949af038 in RGWDataSyncStatusManager::run (dpp=<optimized out>, this=0x55e6983c44d8) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/driver/rados/rgw_data_sync.h:526
#15 RGWDataSyncProcessorThread::process (dpp=<optimized out>, this=0x55e6983c4480) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/driver/rados/rgw_rados.cc:536
#16 RGWDataSyncProcessorThread::process (this=0x55e6983c4480, dpp=<optimized out>) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/driver/rados/rgw_rados.cc:523
#17 0x000055e69495c9a1 in RGWRadosThread::Worker::entry (this=0x55e69821e360) at /usr/src/debug/ceph-19.2.1-19.bb.squid_release.el8.x86_64/src/rgw/driver/rados/rgw_rados.cc:333
#18 0x00007fee4d10c1ca in start_thread () from /lib64/libpthread.so.0
#19 0x00007fee4c1238d3 in clone () from /lib64/libc.so.6

The problem seems to be the fact that the sync-thread can still send/queue requests to RGWAsyncRadosProcessor even after it's going down.

In this respect, a related code change is [[https://github.com/ceph/ceph/pull/48021/files]](rgw: Drain async_processor request queue during shutdown #48021). This change is setting going_down flag and draining the async_rados_processor before attempting to stop the {data,meta} sync thread but as seen in the above backtraces sync-thread still seems to be enqueuing work to async_rados_processor even after it starts going down.

Plausible root-cause

The root-cause seems to be while async-processor is going down; {data,meta} sync threads and coroutine mgrs' going-down/stop flag is set at a later point opening up a time-window in which async-processor can get requests while going down?

Would a quick fix be changing the order of stopping? As there seems to be some circular dependency between the two. Not sure whether it'd open another can of worms, though. But then, this'd contradict the fix & comment added in [[https://github.com/ceph/ceph/pull/48021/files]](rgw: Drain async_processor request queue during shutdown #48021).

main branch and reproduction

- create an mstart cluster (1 rgw per zone)
- to increase the probability of hitting the issue you can add a minor artificial delay (e.g., ~1s) at https://github.com/ceph/ceph/blob/d8a62ea9256495c9867bc2bba57e48cce708c85a/src/rgw/driver/rados/rgw_rados.cc#L1075; between stopping async_processor and sync-threads at the zone pulling data from the other zone (i.e., at secondary zone).
- you can have a simple single threaded/sequential stream of PUT small objects on the other zone (i.e., master zone).
- on the secondary zone, issue `radosgw-admin period update --commit` back-to-back but wait for the current period-update-commit to fully complete first on ALL rgw instances before issuing the next one.
- If at least one of the instances cannot complete reload, that means we reproduced the issue.

On main branch, it takes running period-update-commit a couple of times before we hit the issue. We can reproduce the exact same issue in main; realm reloader stucks at stopping the data-sync thread at secondary site and data-sync thread (RGWDataSyncProcessorThread) has the same backtrace signature.

Proposed Fix

Added https://github.com/ceph/ceph/pull/66369 as a draft to discuss options further.
Given the reproducer above, with this proposed fix, realm reload works as expected -> no stalls. The idea is simple:

1] Signal stop to sync-processor-threads (do not join but give an early warning that the driver is shutting down) so that they won't try to send more requests to async-processor.
2] Also, have async-processor reject to queue any new requests when shutting down. Based on my testing, 1] by itself is not enough and we need this one, too; I believe due to timings of coroutine scheduler.

OO Updated by Oguzhan Ozmen about 1 year ago Actions #6

In addition to above backtrace which shows realm-reload stalls that stopping data-sync threads, I also see occasional crash during the period-update-commit:

Thread 592 (Thread 0x7faaf8385700 (LWP 152764)):
#0  0x00007fabfce2782f in raise () from /lib64/libpthread.so.0
#1  0x0000563434e90588 in reraise_fatal (signum=signum@entry=11) at /ceph-src/src/global/signal_handler.cc:93
#2  0x0000563434e91d19 in handle_oneshot_fatal_signal (signum=11) at /ceph-src/src/global/signal_handler.cc:372
#3  <signal handler called>
#4  0x00007fabfce1fa74 in pthread_mutex_lock () from /lib64/libpthread.so.0
#5  0x000056343454031f in __gthread_mutex_lock (__mutex=<optimized out>) at /opt/rh/gcc-toolset-12/root/usr/include/c++/12/x86_64-redhat-linux/bits/gthr-default.h:749
#6  std::mutex::lock (this=<optimized out>) at /opt/rh/gcc-toolset-12/root/usr/include/c++/12/bits/std_mutex.h:100
#7  0x000056343454f6bf in std::unique_lock<std::mutex>::lock (this=this@entry=0x563437b943c0) at /opt/rh/gcc-toolset-12/root/usr/include/c++/12/bits/unique_lock.h:131
#8  0x0000563434c6e355 in std::unique_lock<std::mutex>::unique_lock (__m=..., this=0x563437b943c0) at /opt/rh/gcc-toolset-12/root/usr/include/c++/12/bits/unique_lock.h:66
#9  DataLogBackends::head (this=0x0) at /ceph-src/src/rgw/driver/rados/rgw_datalog.h:222
#10 0x0000563434c5b36a in RGWDataChangesLog::add_entry (this=this@entry=0x563437151800, dpp=<optimized out>, bucket_info=..., gen=..., shard_id=10, y=...) at /opt/rh/gcc-toolset-12/root/usr/include/c++/12/bits/unique_ptr.h:461
#11 0x0000563434c5cd05 in operator() (__closure=__closure@entry=0x563437b95df8, y=...) at /build/boost/include/boost/asio/execution/any_executor.hpp:1521
...

Happening in the call RGWDataChangesLog::add_entry() at auto be = bes->head(); after "bes" (std::unique_ptr<DataLogBackends>) was reset as a part of shutdown:

(gdb) bt
#0  0x00007f0988b97a74 in pthread_mutex_lock () from /lib64/libpthread.so.0
#1  0x000056097ea2d31f in __gthread_mutex_lock (__mutex=<optimized out>)
    at /opt/rh/gcc-toolset-12/root/usr/include/c++/12/x86_64-redhat-linux/bits/gthr-default.h:749
#2  std::mutex::lock (this=<optimized out>) at /opt/rh/gcc-toolset-12/root/usr/include/c++/12/bits/std_mutex.h:100
#3  0x000056097ea3c6bf in std::unique_lock<std::mutex>::lock (this=this@entry=0x56098ce003c0)
    at /opt/rh/gcc-toolset-12/root/usr/include/c++/12/bits/unique_lock.h:131
#4  0x000056097f15b74b in std::unique_lock<std::mutex>::unique_lock (__m=..., this=0x56098ce003c0)
    at /opt/rh/gcc-toolset-12/root/usr/include/c++/12/bits/unique_lock.h:66
#5  DataLogBackends::head (this=0x0) at /ceph-src/src/rgw/driver/rados/rgw_datalog.h:222
#6  0x000056097f1485be in RGWDataChangesLog::add_entry (this=this@entry=0x5609893fe400, dpp=<optimized out>, bucket_info=..., gen=...,
    shard_id=0, y=...) at /opt/rh/gcc-toolset-12/root/usr/include/c++/12/bits/unique_ptr.h:461
#7  0x000056097f149fcf in operator() (__closure=__closure@entry=0x56098ce01df8, y=...)
    at /build/boost/include/boost/asio/execution/any_executor.hpp:1521
#8  0x000056097f14a066 in boost::asio::detail::spawn_entry_point<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0>, RGWDataChangesLog::add_entry(const DoutPrefixProvider*, const RGWBucketInfo&, const rgw::bucket_log_layout_generation&, int, optional_yield)::<lambda(boost::asio::yield_context)>, ceph::async::detail::blocked_handler<std::__exception_ptr::exception_ptr> >::call(const boost::asio::basic_yield_context<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0> > &, boost::asio::void_type<void>) (
    this=this@entry=0x56098ce01df0, yield=...) at /build/boost/include/boost/asio/impl/spawn.hpp:742
#9  0x000056097f14a22d in boost::asio::detail::spawn_entry_point<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0>, RGWDataChangesLog::add_entry(const DoutPrefixProvider*, const RGWBucketInfo&, const rgw::bucket_log_layout_generation&, int, optional_yield)::<lambda(boost::asio::yield_context)>, ceph::async::detail::blocked_handler<std::__exception_ptr::exception_ptr> >::operator()(boost::asio::detail::spawned_thread_base *) (this=this@entry=0x56098ce01df0, spawned_thread=spawned_thread@entry=0x56098ce01da0)
    at /build/boost/include/boost/asio/io_context.hpp:501
#10 0x000056097f14a35b in boost::asio::detail::spawned_fiber_thread::entry_point<boost::asio::detail::spawn_entry_point<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0>, RGWDataChangesLog::add_entry(const DoutPrefixProvider*, const RGWBucketInfo&, const rgw::bucket_log_layout_generation&, int, optional_yield)::<lambda(boost::asio::yield_context)>, ceph::async::detail::blocked_handler<std::__exception_ptr::exception_ptr> > >::operator()(boost::asio::detail::spawned_fiber_thread::fiber_type &&) (this=this@entry=0x56098ce01f18, caller=...)
    at /build/boost/include/boost/asio/spawn.hpp:67
#11 0x000056097f14a483 in std::__invoke_impl<boost::context::fiber, boost::asio::detail::spawned_fiber_thread::entry_point<boost::asio::detail::spawn_entry_point<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0>, RGWDataChangesLog::add_entry(const DoutPrefixProvider*, const RGWBucketInfo&, const rgw::bucket_log_layout_generation&, int, optional_yield)::<lambda(boost::asio::yield_context)>, ceph::async::detail::blocked_handler<std::__exception_ptr::exception_ptr> > >&, boost::context::fiber> (__f=...)
--Type <RET> for more, q to quit, c to continue without paging--q
Quit
(gdb) f 6
#6  0x000056097f1485be in RGWDataChangesLog::add_entry (this=this@entry=0x5609893fe400, dpp=<optimized out>, bucket_info=..., gen=..., shard_id=0, y=...) at /opt/rh/gcc-toolset-12/root/usr/include/c++/12/bits/unique_ptr.h:461
461           get() const noexcept
(gdb) p down_flag
$1 = std::atomic<bool> = { true }

I'll add a fix for this issue as well as this seems to be popping up during realm reload as well.

OO Updated by Oguzhan Ozmen 12 months ago Actions #7

  • Status changed from New to Fix Under Review
  • Assignee set to Oguzhan Ozmen
  • Pull request ID changed from 57640 to 66369

JM Updated by Joseph Mundackal 12 months ago Actions #8

  • Backport set to squid tentacle

UB Updated by Upkeep Bot 10 months ago Actions #9

  • Status changed from Fix Under Review to Pending Backport
  • Merge Commit set to 9be6024ee6eaa9465bfe198e7aa5cef6e2283323
  • Fixed In set to v20.3.0-5091-g9be6024ee6
  • Upkeep Timestamp set to 2026-02-03T17:31:21+00:00

UB Updated by Upkeep Bot 10 months ago Actions #10

  • Copied to Backport #74737: tentacle: period-update-commit causes rgw instances to hang while reloading the new realm added

UB Updated by Upkeep Bot 10 months ago Actions #11

  • Copied to Backport #74738: squid: period-update-commit causes rgw instances to hang while reloading the new realm added

UB Updated by Upkeep Bot 10 months ago Actions #12

  • Tags (freeform) set to backport_processed

UB Updated by Upkeep Bot 3 months ago Actions #13

  • Status changed from Pending Backport to Backporting
  • Tags (freeform) deleted (backport_processed)
  • Upkeep Timestamp changed from 2026-02-03T17:31:21+00:00 to 2026-08-27T18:25:19+00:00

UB Updated by Upkeep Bot about 1 month ago Actions #14

  • Released In set to v21.2.0~1337
  • Upkeep Timestamp changed from 2026-08-27T18:25:19+00:00 to 2026-10-24T01:14:26+00:00

UB Updated by Upkeep Bot 29 days ago Actions #15

  • Released In changed from v21.2.0~1337 to v21.2.0~1338
  • Upkeep Timestamp changed from 2026-10-24T01:14:26+00:00 to 2026-11-04T01:08:26+00:00
Actions

Also available in: PDF Atom