From 00c2afcd386d47412b1c0f248333bc5bd1834230 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Thu, 16 Apr 2015 19:31:10 -0700 Subject: [PATCH] Fix bug in ExpandWhileOverlapping() Summary: If ExpandWhileOverlapping() we don't clear inputs. That's a bug introduced by my recent patch https://reviews.facebook.net/D36687. However, we have no tests covering ExpandWhileOverlapping(). I created a task t6771252 to add ExpandWhileOverlapping() tests. Test Plan: make check Reviewers: sdong, rven, yhchiang Reviewed By: yhchiang Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D37077 --- db/compaction_picker.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/compaction_picker.cc b/db/compaction_picker.cc index c25a41cad..953e44b32 100644 --- a/db/compaction_picker.cc +++ b/db/compaction_picker.cc @@ -825,6 +825,8 @@ bool LevelCompactionPicker::PickCompactionBySize(VersionStorageInfo* vstorage, return false; } + inputs->clear(); + assert(level >= 0); // Pick the largest file in this level that is not already