]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
RGW: set down_flag early on sync processor threads during shutdown
authorOguzhan Ozmen <oozmen@bloomberg.net>
Fri, 21 Nov 2025 21:13:34 +0000 (21:13 +0000)
committerOguzhan Ozmen <oozmen@bloomberg.net>
Wed, 26 Nov 2025 03:37:18 +0000 (03:37 +0000)
Set down_flag on all sync-related threads (meta sync, data sync,
and log trimmer) before draining or joining them in RGWRados::finalize().

This early flagging ensures that any in-progress data sync operations
can detect shutdown sooner and stop issuing new async processor requests,
reducing the chance of deadlock during realm reload.

Fixes: https://tracker.ceph.com/issues/66100
Signed-off-by: Oguzhan Ozmen <oozmen@bloomberg.net>
src/rgw/driver/rados/rgw_rados.cc

index 8a24c38f6691f6358fd02f987666bf9835555052..2774321c95b348ffcb76b1095d3873c177c061cd 100644 (file)
@@ -1067,6 +1067,19 @@ bool RGWIndexCompletionManager::handle_completion(completion_t cb, complete_op_d
 
 void RGWRados::finalize()
 {
+  if (run_sync_thread) {
+    std::lock_guard l{meta_sync_thread_lock};
+    meta_sync_processor_thread->set_down_flag();
+    std::lock_guard dl{data_sync_thread_lock};
+    for (auto iter : data_sync_processor_threads) {
+      RGWDataSyncProcessorThread *thread = iter.second;
+      thread->set_down_flag();
+    }
+    if (sync_log_trimmer) {
+      sync_log_trimmer->set_down_flag();
+    }
+  }
+
   /* Before joining any sync threads, drain outstanding requests &
    * mark the async_processor as going_down() */
   if (svc.async_processor) {