From 291088ae4e583ccdf4de0881a8762bb5412f7d27 Mon Sep 17 00:00:00 2001 From: sdong Date: Mon, 7 Dec 2015 10:13:58 -0800 Subject: [PATCH] Fix undeterministic failure of ColumnFamilyTest.DifferentWriteBufferSizes Summary: After the skip list optimization, ColumnFamilyTest.DifferentWriteBufferSizes can occasionally fail with flush triggering of column family 3. Insert more data to it to make sure flush will trigger. Test Plan: Run it multiple times with both of jemaloc on and off and see it always passes. (Without thd commit the run with jemalloc fails with chance of about one in two) Reviewers: rven, yhchiang, IslamAbdelRahman, anthony, kradhakrishnan, igor Reviewed By: igor Subscribers: leveldb, dhruba Differential Revision: https://reviews.facebook.net/D51645 --- db/column_family_test.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/db/column_family_test.cc b/db/column_family_test.cc index e776ae115..b6d6b3c6d 100644 --- a/db/column_family_test.cc +++ b/db/column_family_test.cc @@ -720,7 +720,7 @@ TEST_F(ColumnFamilyTest, DifferentWriteBufferSizes) { two.max_write_buffer_number = 10; two.min_write_buffer_number_to_merge = 3; two.max_write_buffer_number_to_maintain = 2; - three.write_buffer_size = 4096 * 22 + 2048; + three.write_buffer_size = 4096 * 22; three.arena_block_size = 4096; three.max_write_buffer_number = 10; three.min_write_buffer_number_to_merge = 4; @@ -745,15 +745,15 @@ TEST_F(ColumnFamilyTest, DifferentWriteBufferSizes) { env_->SleepForMicroseconds(micros_wait_for_flush); AssertNumberOfImmutableMemtables({0, 1, 2, 0}); AssertCountLiveLogFiles(4); - PutRandomData(3, 91, 990); + PutRandomData(3, 93, 990); env_->SleepForMicroseconds(micros_wait_for_flush); AssertNumberOfImmutableMemtables({0, 1, 2, 1}); AssertCountLiveLogFiles(5); - PutRandomData(3, 90, 990); + PutRandomData(3, 88, 990); env_->SleepForMicroseconds(micros_wait_for_flush); AssertNumberOfImmutableMemtables({0, 1, 2, 2}); AssertCountLiveLogFiles(6); - PutRandomData(3, 90, 990); + PutRandomData(3, 88, 990); env_->SleepForMicroseconds(micros_wait_for_flush); AssertNumberOfImmutableMemtables({0, 1, 2, 3}); AssertCountLiveLogFiles(7); @@ -765,11 +765,11 @@ TEST_F(ColumnFamilyTest, DifferentWriteBufferSizes) { WaitForFlush(2); AssertNumberOfImmutableMemtables({0, 1, 0, 3}); AssertCountLiveLogFiles(9); - PutRandomData(3, 90, 990); + PutRandomData(3, 88, 990); WaitForFlush(3); AssertNumberOfImmutableMemtables({0, 1, 0, 0}); AssertCountLiveLogFiles(10); - PutRandomData(3, 90, 990); + PutRandomData(3, 88, 990); env_->SleepForMicroseconds(micros_wait_for_flush); AssertNumberOfImmutableMemtables({0, 1, 0, 1}); AssertCountLiveLogFiles(11); @@ -777,9 +777,9 @@ TEST_F(ColumnFamilyTest, DifferentWriteBufferSizes) { WaitForFlush(1); AssertNumberOfImmutableMemtables({0, 0, 0, 1}); AssertCountLiveLogFiles(5); - PutRandomData(3, 90 * 3, 990); + PutRandomData(3, 88 * 3, 990); WaitForFlush(3); - PutRandomData(3, 90 * 4, 990); + PutRandomData(3, 88 * 4, 990); WaitForFlush(3); AssertNumberOfImmutableMemtables({0, 0, 0, 0}); AssertCountLiveLogFiles(12);