From a6bcfc2c719a26c2bbd19a1604c579c751e058fe Mon Sep 17 00:00:00 2001 From: Tianshan Qu Date: Wed, 6 Jun 2018 14:39:37 +0800 Subject: [PATCH] rgw: fix RGWSyncTraceNode crash in reload reload or restart will finalize RGWSyncTraceManager and destroy complete_nodes, which will trigger RGWSyncTraceNode release twice. A situation is sync more than 4096 objects and get full complete_nodes, complete_nodes have a member A who's parent is P which is not finished and A is the last child of P. In destroy complete_nodes, nodes will be released one by one. Release A will trigger release P, and call finish_node(P). there is trap that circular_buffer won't change size until destroy all items, so circular_buffer is still full and pop the first item which is A, and released A again. fixes: http://tracker.ceph.com/issues/24432 Signed-off-by: Tianshan Qu (cherry picked from commit 3536c7810ae1c1ed508d4eb62b08b7da0c098c07) --- src/rgw/rgw_sync_trace.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rgw/rgw_sync_trace.cc b/src/rgw/rgw_sync_trace.cc index 38219f9cd6d0c..3015f9c114d76 100644 --- a/src/rgw/rgw_sync_trace.cc +++ b/src/rgw/rgw_sync_trace.cc @@ -134,6 +134,8 @@ RGWSyncTraceManager::~RGWSyncTraceManager() service_map_thread->stop(); delete service_map_thread; + + nodes.clear(); } int RGWSyncTraceManager::hook_to_admin_command() -- 2.39.5