Mayank Agarwal 184343a061 Max_mem_compaction_level can have maximum value of num_levels-1
Summary:
Without this files could be written out to a level greater than the maximum level possible and is the source of the segfaults that wormhole awas getting. The sequence of steps that was followed:
1. WriteLevel0Table was called when memtable was to be flushed for a file.
2. PickLevelForMemTableOutput was called to determine the level to which this file should be pushed.
3. PickLevelForMemTableOutput returned a wrong result because max_mem_compaction_level was equal to 2 even when num_levels was equal to 0.
The fix to re-initialize max_mem_compaction_level based on num_levels passed seems correct.

Test Plan: make all check; Also made a dummy file to mimic the wormhole-file behaviour which was causing the segfaults and found that the same segfault occurs without this change and not with this.

Reviewers: dhruba, haobo

Reviewed By: dhruba

CC: leveldb

Differential Revision: https://reviews.facebook.net/D11157
2013-06-09 10:38:55 -07:00
..
2013-03-14 16:00:23 -07:00
2013-05-23 11:49:38 -07:00
2012-09-16 19:33:43 -07:00
2013-06-05 17:25:16 -07:00
2012-12-16 08:58:28 -08:00
2012-12-17 11:26:59 -08:00
2012-12-17 11:26:59 -08:00
2013-02-28 18:04:58 -08:00
2013-02-28 18:04:58 -08:00
2013-02-28 18:04:58 -08:00
2013-02-28 18:04:58 -08:00
2013-02-28 18:04:58 -08:00