[PATCH 1/9] vinyl: update lsm->range_heap in one go on dump completion

Vladimir Davydov vdavydov.dev at gmail.com
Mon Jan 21 00:17:00 MSK 2019


Upon LSM tree dump completion, we iterate over all ranges of the LSM
tree to update their priority and the position in the compaction heap.
Since typically we need to update all ranges, we better use update_all
heap method instead of updating the heap entries one by one.
---
 src/box/vy_scheduler.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/box/vy_scheduler.c b/src/box/vy_scheduler.c
index c59bedee..5ec6d171 100644
--- a/src/box/vy_scheduler.c
+++ b/src/box/vy_scheduler.c
@@ -1227,10 +1227,8 @@ vy_task_dump_complete(struct vy_task *task)
 		vy_range_add_slice(range, slice);
 		vy_range_update_compaction_priority(range, &lsm->opts);
 		vy_lsm_acct_range(lsm, range);
-		if (!vy_range_is_scheduled(range))
-			vy_range_heap_update(&lsm->range_heap,
-					     &range->heap_node);
 	}
+	vy_range_heap_update_all(&lsm->range_heap);
 	free(new_slices);
 
 delete_mems:
-- 
2.11.0




More information about the Tarantool-patches mailing list