1. 21 4月, 2015 1 次提交
    • I
      Fix compile with two gflags · 742fa9e3
      Igor Canadi 提交于
      Summary:
      If the system has gflags with both `google` and `gflags` namespaces installed, we try to define GFLAGS as two things. This breaks the compile.
      
      Fix: Use `else if` -- try compiling with `google` namespace only if compile with `gflags` failed
      
      Test Plan: build_tools/build_detect_platform correctly identifies gflags
      
      Reviewers: lgalanis
      
      Reviewed By: lgalanis
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D37389
      742fa9e3
  2. 18 4月, 2015 4 次提交
    • J
      skip ioctl-using tests when not supported · 79c21ec0
      Jim Meyering 提交于
      Summary:
      [NB: this is a prerequisite for the /tmp-abuse-fixing patch]
      This avoids spurious test failure on Linux systems
      like Fedora for which /tmp is a tmpfs file system.
      
      On a devtmpfs file
      system, ioctl(fd, FS_IOC_GETVERSION, &version) returns -1 with
      errno == ENOTTTY, indicating that that ioctl is not supported
      on such a file system.  Do not let this cause test failures, e.g.,
      where env_test would assert that file->GetUniqueId(...) > 0.
      
      Before this change, ./env_test would fail these three tests
      on a fedora rawhide system:
      
        [  FAILED  ] 3 tests, listed below:
        [  FAILED  ] EnvPosixTest.RandomAccessUniqueID
        [  FAILED  ] EnvPosixTest.RandomAccessUniqueIDConcurrent
        [  FAILED  ] EnvPosixTest.RandomAccessUniqueIDDeletes
         3 FAILED TESTS
      
      The fix:
        When support for that ioctl is lacking, skip each affected test.
        Could be improved by noting which sub-tests are being skipped.
      
      Test Plan:
      run these on F21 and note that they now pass.
      
        TEST_TMPDIR=/dev/shm/rdb ./env_test
        ./env_test
      
      Reviewers: ljin, rven, igor.sugak, yhchiang, sdong, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D37323
      79c21ec0
    • I
      Add experimental API MarkForCompaction() · 6059bdf8
      Igor Canadi 提交于
      Summary:
      Some Mongo+Rocks datasets in Parse's environment are not doing compactions very frequently. During the quiet period (with no IO), we'd like to schedule compactions so that our reads become faster. Also, aggressively compacting during quiet periods helps when write bursts happen. In addition, we also want to compact files that are containing deleted key ranges (like old oplog keys).
      
      All of this is currently not possible with CompactRange() because it's single-threaded and blocks all other compactions from happening. Running CompactRange() risks an issue of blocking writes because we generate too much Level 0 files before the compaction is over. Stopping writes is very dangerous because they hold transaction locks. We tried running manual compaction once on Mongo+Rocks and everything fell apart.
      
      MarkForCompaction() solves all of those problems. This is very light-weight manual compaction. It is lower priority than automatic compactions, which means it shouldn't interfere with background process keeping the LSM tree clean. However, if no automatic compactions need to be run (or we have extra background threads available), we will start compacting files that are marked for compaction.
      
      Test Plan: added a new unit test
      
      Reviewers: yhchiang, rven, MarkCallaghan, sdong
      
      Reviewed By: sdong
      
      Subscribers: yoshinorim, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D37083
      6059bdf8
    • J
      maint: use ASSERT_TRUE, not ASSERT_EQ(true; same for false · acf8a414
      Jim Meyering 提交于
      Summary:
      The usage I'm fixing here caused trouble on Fedora 21 when
      compiling with the current gcc version 4.9.2 20150212 (Red Hat 4.9.2-6) (GCC):
      
        db/write_controller_test.cc: In member function ‘virtual void rocksdb::WriteControllerTest_SanityTest_Test::TestBody()’:
        db/write_controller_test.cc:23:165: error: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Werror=conversion-null]
           ASSERT_EQ(false, controller.IsStopped());
                                                                                                                                                                                ^
      
      This change was induced mechanically via:
      
        git grep -l -E 'ASSERT_EQ\(false'|xargs perl -pi -e 's/ASSERT_EQ\(false, /ASSERT_FALSE(/'
        git grep -l -E 'ASSERT_EQ\(true'|xargs perl -pi -e 's/ASSERT_EQ\(true, /ASSERT_TRUE(/'
      
      Except for the three in utilities/backupable/backupable_db_test.cc for which
      I ended up reformatting (joining lines) in the result.
      
      As for why this problem is exhibited with that version of gcc, and none
      of the others I've used (from 4.8.1 through gcc-5.0.0 and newer), I suspect
      it's a bug in F21's gcc that has been fixed in gcc-5.0.0.
      
      Test Plan:
        "make" now succeed on Fedora 21
      
      Reviewers: ljin, rven, igor.sugak, yhchiang, sdong, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D37329
      acf8a414
    • I
      Kill dead code · b5400f90
      Igor Canadi 提交于
      Summary: this is not used anywhere
      
      Test Plan: compiles
      
      Reviewers: yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D37053
      b5400f90
  3. 17 4月, 2015 2 次提交
    • I
      Speed up reduce_levels_test · 48b0a045
      Igor Canadi 提交于
      Summary: For some reason reduce_levels is opening the databse with 65.000 levels. This makes ComputeCompactionScore() function terribly slow and the tests is also very slow (20seconds).
      
      Test Plan: mr reduce_levels_test now takes 20ms
      
      Reviewers: sdong, rven, kradhakrishnan, yhchiang
      
      Reviewed By: yhchiang
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D37059
      48b0a045
    • I
      Fix bug in ExpandWhileOverlapping() · 00c2afcd
      Igor Canadi 提交于
      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
      00c2afcd
  4. 16 4月, 2015 5 次提交
  5. 15 4月, 2015 4 次提交
    • S
      Bug of trivial move of dynamic level · debaf85e
      sdong 提交于
      Summary: D36669 introduces a bug that trivial moved data is not going to specific level but the next level, which will incorrectly be level 1 for level 0 compaciton if base level is not level 1. Fixing it by appreciating the output level
      
      Test Plan: Run all tests
      
      Reviewers: MarkCallaghan, rven, yhchiang, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D37119
      debaf85e
    • S
      Fix and Improve DBTest.DynamicLevelCompressionPerLevel2 · 12d7d3d2
      sdong 提交于
      Summary:
      Recent change of DBTest.DynamicLevelCompressionPerLevel2 has a bug that the second sync point is not enabled. Fix it. Also add an assert for that.
      Also, flush compression is not tracked in the test. Add it.
      
      Test Plan: Build everything
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D37101
      12d7d3d2
    • S
      Fix build break introduced by new SyncPoint interface change · a1271c6c
      sdong 提交于
      Summary: When commiting the sync point interface change, didn't resolve the new occurance of the old interface in rebase. Fix it.
      
      Test Plan: Build and see it pass
      
      Reviewers: igor, yhchiang, rven, anthony, kradhakrishnan
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D37095
      a1271c6c
    • S
      SyncPoint to allow a callback with an argument and use it to get... · fcb206b6
      sdong 提交于
      SyncPoint to allow a callback with an argument and use it to get DBTest.DynamicLevelCompressionPerLevel2 more straight-forward
      
      Summary:
      Allow users to give a callback function with parameter using sync point, so more complicated verification can be done in tests.
      Use it in DBTest.DynamicLevelCompressionPerLevel2 so that failures will be more easy to debug.
      
      Test Plan: Run all tests. Run DBTest.DynamicLevelCompressionPerLevel2 with valgrind check.
      
      Reviewers: rven, yhchiang, anthony, kradhakrishnan, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D36999
      fcb206b6
  6. 14 4月, 2015 10 次提交
    • I
      Temporarily disable test CompactFilesOnLevelCompaction · 281db8bb
      Igor Canadi 提交于
      Summary: https://reviews.facebook.net/D36963 made the debug build much faster and that triggered failures of CompactFilesOnLevelCompaction test. 3 out of 4 last tests on Jenkins failed. I'm disabling this test temporarily, since we likely know the reason why it's failing and there's already work in progress to address it -- https://reviews.facebook.net/D36225
      
      Test Plan: none
      
      Reviewers: sdong, rven, yhchiang, meyering
      
      Reviewed By: meyering
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D36993
      281db8bb
    • P
      Added falloc.h in build_detect_platform · e8808b91
      Pooya Shareghi 提交于
      On Centos 6, you need to explicitely include linux/falloc.h which is
      whele the  FALLOC_FL_* flags are defined. Otherwise, the fallocate()
      support test defined in build_detect_platform will fail.
      Signed-off-by: NPooya Shareghi <shareghi@gmail.com>
      e8808b91
    • I
      assert(sorted) in vector rep · 1983fadc
      Igor Canadi 提交于
      Summary: based on discussion on https://reviews.facebook.net/D36969
      
      Test Plan: will let jenkins do its job
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D36975
      1983fadc
    • M
      Get benchmark.sh loads to run faster · 9da87480
      Mark Callaghan 提交于
      Summary:
      This changes loads to use vector memtable and disable the WAL. This also
      increases the chance we will see IO bottlenecks during loads which is good to stress
      test HW. But I also think it is a good way to load data quickly as this is a bulk
      operation and the WAL isn't needed.
      
      The two numbers below are the MB/sec rates for fillseq, bulkload using a skiplist
      or vector memtable and the WAL enabled or disabled. There is a big benefit from
      using the vector memtable and WAL disabled. Alas there is also a perf bug in
      the use of std::sort for ordered input when the vector is flushed. Task is open
      for that.
        112, 66 - skiplist with wal
        250, 116 - skiplist without wal
        110, 108 - vector with wal
        232, 370 - vector without wal
      
      Task ID: #
      
      Blame Rev:
      
      Test Plan:
      Revert Plan:
      
      Database Impact:
      
      Memcache Impact:
      
      Other Notes:
      
      EImportant:
      
      - begin *PUBLIC* platform impact section -
      Bugzilla: #
      - end platform impact -
      
      Reviewers: igor
      
      Reviewed By: igor
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D36957
      9da87480
    • I
      Fix flakiness of WalManagerTest · 9b983bef
      Igor Canadi 提交于
      Summary: We should use mocked-out env for these tests to make it more realiable. Added benefit is that instead of actually sleeping for 3 seconds, we can instead pretend to sleep and just increase time counters.
      
      Test Plan: for i in `seq 100`; do ./wal_manager_test --gtest_filter=WalManagerTest.WALArchivalTtl ;done
      
      Reviewers: rven, meyering
      
      Reviewed By: meyering
      
      Subscribers: meyering, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D36951
      9b983bef
    • I
      Don't do O(N^2) operations in debug mode for vector memtable · d41a565a
      Igor Canadi 提交于
      Summary: As title. For every operation we're asserting Valid(), which sorts the data. That's pretty terrible. We have to be careful to have decent performance even with DEBUG builds.
      
      Test Plan: make check
      
      Reviewers: sdong, rven, yhchiang, MarkCallaghan
      
      Reviewed By: MarkCallaghan
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D36969
      d41a565a
    • I
      Fix bad performance in debug mode · 08be1803
      Igor Canadi 提交于
      Summary:
      See github issue 574: https://github.com/facebook/rocksdb/issues/574
      
      Basically when we're running in DEBUG mode we're calling `usleep(0)` on
      every mutex lock. I bisected the issue to
      https://reviews.facebook.net/D36963. Instead of calling sleep(0), this
      diff just avoids calling SleepForMicroseconds() when delay is not set.
      
      Test Plan:
          bpl=10485760;overlap=10;mcz=2;del=300000000;levels=2;ctrig=10000000; delay=10000000; stop=10000000; wbn=30; mbc=20; mb=1073741824;wbs=268435456; dds=1; sync=0; r=100000; t=1; vs=800; bs=65536; cs=1048576; of=500000; si=1000000; ./db_bench --benchmarks=fillrandom --disable_seek_compaction=1 --mmap_read=0 --statistics=1 --histogram=1 --num=$r --threads=$t --value_size=$vs --block_size=$bs --cache_size=$cs --bloom_bits=10 --cache_numshardbits=4 --open_files=$of --verify_checksum=1 --db=/tmp/rdb10test --sync=$sync --disable_wal=1 --compression_type=snappy --stats_interval=$si --compression_ratio=0.5 --disable_data_sync=$dds --write_buffer_size=$wbs --target_file_size_base=$mb --max_write_buffer_number=$wbn --max_background_compactions=$mbc --level0_file_num_compaction_trigger=$ctrig --level0_slowdown_writes_trigger=$delay --level0_stop_writes_trigger=$stop --num_levels=$levels --delete_obsolete_files_period_micros=$del --min_level_to_compress=$mcz --max_grandparent_overlap_factor=$overlap --stats_per_interval=1 --max_bytes_for_level_base=$bpl --memtablerep=vector --use_existing_db=0 --disable_auto_compactions=1 --source_compaction_factor=10000000 | grep ops
      
      Before:
      fillrandom   :     117.525 micros/op 8508 ops/sec;    6.6 MB/s
      After:
      fillrandom   :       1.283 micros/op 779502 ops/sec;  606.6 MB/s
      
      Reviewers: rven, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: meyering, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D36963
      08be1803
    • V
      Add Xfunc to makefile · 0a0501c8
      Venkatesh Radhakrishnan 提交于
      Summary: Make target for running all xfunc tests
      
      Test Plan: make xfunc
      
      Reviewers: igor, sdong, meyering
      
      Reviewed By: meyering
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D36873
      0a0501c8
    • I
      Fix flakiness in FIFOCompaction test (github issue #573) · e7ad1492
      Igor Canadi 提交于
      Summary:
      The problem is that sometimes two memtables will be compacted together into a single file. In that case, our assertion
      
              ASSERT_EQ(NumTableFilesAtLevel(0), 5);
      
      fails because same amount of data is in 4 files instead of 5. We should wait for flush so that we prevent two memtables merging into a single file.
      
      Test Plan: `for i in `seq 20`; do mrtest FIFOCompactionTest; done` -- fails at least once before. fails zero times after.
      
      Reviewers: rven
      
      Reviewed By: rven
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D36939
      e7ad1492
    • I
      Kill benchharness · abb40522
      Igor Canadi 提交于
      Summary:
      1. it doesn't work
      2. we're not using it
      
      In the future, if we need general benchmark framework, we should probably use https://github.com/google/benchmark
      
      Test Plan: make all
      
      Reviewers: yhchiang, rven, anthony, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D36777
      abb40522
  7. 13 4月, 2015 1 次提交
  8. 11 4月, 2015 5 次提交
    • I
      Fix compile warning on CLANG · 590fadc4
      Igor Canadi 提交于
      Summary: oops
      
      Test Plan: compiles now
      
      Reviewers: sdong, yhchiang
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D36867
      590fadc4
    • I
      Make Compaction class easier to use · 47b87439
      Igor Canadi 提交于
      Summary:
      The goal of this diff is to make Compaction class easier to use. This should also make new compaction algorithms easier to write (like CompactFiles from @yhchiang and dynamic leveled and multi-leveled universal from @sdong).
      
      Here are couple of things demonstrating that Compaction class is hard to use:
      1. we have two constructors of Compaction class
      2. there's this thing called grandparents_, but it appears to only be setup for leveled compaction and not compactfiles
      3. it's easy to introduce a subtle and dangerous bug like this: D36225
      4. SetupBottomMostLevel() is hard to understand and it shouldn't be. See this comment: https://github.com/facebook/rocksdb/blob/afbafeaeaebfd27a0f3e992fee8e0c57d07658fa/db/compaction.cc#L236-L241. It also made it harder for @yhchiang to write CompactFiles, as evidenced by this: https://github.com/facebook/rocksdb/blob/afbafeaeaebfd27a0f3e992fee8e0c57d07658fa/db/compaction_picker.cc#L204-L210
      
      The problem is that we create Compaction object, which holds a lot of state, and then pass it around to some functions. After those functions are done mutating, then we call couple of functions on Compaction object, like SetupBottommostLevel() and MarkFilesBeingCompacted(). It is very hard to see what's happening with all that Compaction's state while it's travelling across different functions. If you're writing a new PickCompaction() function you need to try really hard to understand what are all the functions you need to run on Compaction object and what state you need to setup.
      
      My proposed solution is to make important parts of Compaction immutable after construction. PickCompaction() should calculate compaction inputs and then pass them onto Compaction object once they are finalized. That makes it easy to create a new compaction -- just provide all the parameters to the constructor and you're done. No need to call confusing functions after you created your object.
      
      This diff doesn't fully achieve that goal, but it comes pretty close. Here are some of the changes:
      * have one Compaction constructor instead of two.
      * inputs_ is constant after construction
      * MarkFilesBeingCompacted() is now private to Compaction class and automatically called on construction/destruction.
      * SetupBottommostLevel() is gone. Compaction figures it out on its own based on the input.
      * CompactionPicker's functions are not passing around Compaction object anymore. They are only passing around the state that they need.
      
      Test Plan:
      make check
      make asan_check
      make valgrind_check
      
      Reviewers: rven, anthony, sdong, yhchiang
      
      Reviewed By: yhchiang
      
      Subscribers: sdong, yhchiang, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D36687
      47b87439
    • A
      Fix valgrind issues in memtable_list_test · 753dd1fd
      agiardullo 提交于
      Summary: Need to remember to unref MemTableList->current() before deleting.
      
      Test Plan: ran test with valgrind
      
      Reviewers: igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D36855
      753dd1fd
    • K
      Repairer documentation improvement. · 697380f3
      krad 提交于
      Summary: Adding verbosity to existing comments.
      
      Test Plan: None
      
      Reviewers: sdong
      
      CC: leveldb
      
      Task ID: #6718960
      
      Blame Rev:
      697380f3
    • I
      Add LinkedIn back to USERS.md · 2f66d7f9
      Igor Canadi 提交于
      Summary: Thanks Ankit!
      
      Test Plan: none
      
      Reviewers: ankgup87
      
      Subscribers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D36837
      2f66d7f9
  9. 10 4月, 2015 8 次提交