Igor Canadi 7413306d94 Take a chance on a random file when choosing compaction
Summary:
When trying to compact entire database with SuggestCompactRange(), we'll first try the left-most files. This is pretty bad, because:
1) the left part of LSM tree will be overly compacted, but right part will not be touched
2) First compaction will pick up the left-most file. Second compaction will try to pick up next left-most, but this will not be possible, because there's a big chance that second's file range on N+1 level is already being compacted.

I observe both of those problems when running Mongo+RocksDB and trying to compact the DB to clean up tombstones. I'm unable to clean them up :(

This diff adds a bit of randomness into choosing a file. First, it chooses a file at random and tries to compact that one. This should solve both problems specified here.

Test Plan: make check

Reviewers: yhchiang, rven, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D38379
2015-05-15 14:14:40 -07:00
..
2015-03-17 14:08:00 -07:00
2015-05-05 19:01:12 -07:00
2015-05-05 09:57:47 -07:00
2015-05-05 19:01:12 -07:00
2015-04-25 18:14:27 +09:00
2015-05-13 10:03:41 -07:00
2015-04-25 18:14:27 +09:00
2015-03-17 14:08:00 -07:00
2015-04-23 12:10:36 -07:00
2015-03-17 14:08:00 -07:00
2015-01-26 11:48:07 -08:00
2015-04-07 16:25:56 -07:00
2015-03-17 14:08:00 -07:00
2015-04-07 16:25:56 -07:00
2015-04-25 18:14:27 +09:00
2015-04-27 20:23:50 -07:00
2015-04-27 20:23:50 -07:00
2015-02-26 11:28:41 -08:00
2015-03-30 16:05:35 -04:00
2015-03-17 14:08:00 -07:00
2015-05-05 19:01:12 -07:00
2014-11-06 11:14:28 -08:00
2015-02-06 08:44:30 -08:00
2015-03-17 14:08:00 -07:00
2014-10-31 11:59:54 -07:00
2015-04-30 11:11:35 -07:00
2015-02-26 11:28:41 -08:00
2014-11-10 17:39:38 -05:00
2014-09-13 14:14:10 -07:00
2014-09-12 16:23:58 -07:00