]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix RGWSyncTraceNode crash in reload 22926/head
authorTianshan Qu <tianshan@xsky.com>
Wed, 6 Jun 2018 06:39:37 +0000 (14:39 +0800)
committerNathan Cutler <ncutler@suse.com>
Sat, 7 Jul 2018 08:06:41 +0000 (10:06 +0200)
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 <tianshan@xsky.com>
(cherry picked from commit 3536c7810ae1c1ed508d4eb62b08b7da0c098c07)

src/rgw/rgw_sync_trace.cc

index 38219f9cd6d0c824f138730d68cddd8456daf29f..3015f9c114d7636ba65c10d286fec4598086e73b 100644 (file)
@@ -134,6 +134,8 @@ RGWSyncTraceManager::~RGWSyncTraceManager()
 
   service_map_thread->stop();
   delete service_map_thread;
+
+  nodes.clear();
 }
 
 int RGWSyncTraceManager::hook_to_admin_command()