From ed71319aa6f437210c9268bbe1a48a3430fdfb5f Mon Sep 17 00:00:00 2001
From: Vladimir Davydov <vdavydov.dev@gmail.com>
Date: Wed, 14 Sep 2016 17:35:55 +0300
Subject: [PATCH] vinyl: do not free dropped indexes on sched stop

Currently, a dropped index might have compaction scheduled on scheduler
stop, in which case its ranges are inter-linked and cannot be easily
freed (dumb free of all ranges would result in double free). So let's
drop the final index cleanup for now. We need to rework it anyway,
because we never free active indexes on shutdown, although we should to
make valgrind happy.
---
 src/box/vinyl.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/box/vinyl.c b/src/box/vinyl.c
index c18d59c112..e898c04a36 100644
--- a/src/box/vinyl.c
+++ b/src/box/vinyl.c
@@ -3269,13 +3269,6 @@ vy_scheduler_delete(struct vy_scheduler *scheduler)
 
 	mempool_destroy(&scheduler->task_pool);
 
-	struct vy_index *index, *next;
-	rlist_foreach_entry_safe(index, &scheduler->shutdown, link, next) {
-		/* Remove all ranges from scheduler */
-		vy_range_tree_iter(&index->tree, NULL,
-				   vy_range_tree_unsched_cb, index);
-		vy_index_delete(index);
-	}
 	free(scheduler->indexes);
 	vy_compact_heap_destroy(&scheduler->compact_heap);
 	vy_dump_heap_destroy(&scheduler->dump_heap);
-- 
GitLab