[CF] Test fixes and speedup

This commit is contained in:
Igor Canadi 2014-02-26 16:24:56 -08:00
parent 343c32be7b
commit 4c42201204
2 changed files with 8 additions and 5 deletions

View File

@ -566,7 +566,7 @@ TEST(ColumnFamilyTest, DifferentWriteBufferSizes) {
Reopen({default_cf, one, two, three});
int micros_wait_for_flush = 100000;
int micros_wait_for_flush = 300000;
PutRandomData(0, 100, 1000);
env_->SleepForMicroseconds(micros_wait_for_flush);
AssertNumberOfImmutableMemtables({0, 0, 0, 0});
@ -669,13 +669,15 @@ TEST(ColumnFamilyTest, DifferentCompactionStyles) {
CreateColumnFamilies({"one", "two"});
ColumnFamilyOptions default_cf, one, two;
db_options_.max_open_files = 20; // only 10 files in file cache
db_options_.disableDataSync = true;
default_cf.compaction_style = kCompactionStyleLevel;
default_cf.num_levels = 3;
default_cf.write_buffer_size = 64 << 10; // 64KB
default_cf.target_file_size_base = 512;
default_cf.target_file_size_base = 30 << 10;
default_cf.filter_policy = nullptr;
default_cf.no_block_cache = true;
default_cf.source_compaction_factor = 100;
one.compaction_style = kCompactionStyleUniversal;
// trigger compaction if there are >= 4 files
@ -699,7 +701,8 @@ TEST(ColumnFamilyTest, DifferentCompactionStyles) {
PutRandomData(0, 2000, 4096);
ASSERT_OK(Flush(0));
// clear levels 0 and 1
CompactAll(0);
dbfull()->TEST_CompactRange(0, nullptr, nullptr, handles_[0]);
dbfull()->TEST_CompactRange(1, nullptr, nullptr, handles_[0]);
ASSERT_EQ(NumTableFilesAtLevel(0, 0), 0);
ASSERT_EQ(NumTableFilesAtLevel(1, 0), 0);
// write some new keys into level 0

View File

@ -2235,7 +2235,7 @@ Status DBImpl::InstallCompactionResults(CompactionState* compact) {
compact->compaction->num_input_files(0),
compact->compaction->level(),
compact->compaction->num_input_files(1),
compact->compaction->level() + 1);
compact->compaction->output_level());
return Status::Corruption("Compaction input files inconsistent");
}
@ -2243,7 +2243,7 @@ Status DBImpl::InstallCompactionResults(CompactionState* compact) {
compact->compaction->num_input_files(0),
compact->compaction->level(),
compact->compaction->num_input_files(1),
compact->compaction->level() + 1,
compact->compaction->output_level(),
static_cast<long long>(compact->total_bytes));
// Add compaction outputs