1. 26 4月, 2014 1 次提交
  2. 24 4月, 2014 2 次提交
    • I
      Initialize verification_failed in db_stress · 472a80a3
      Igor Canadi 提交于
      472a80a3
    • I
      Improve stability of db_stress · 2413a06c
      Igor Canadi 提交于
      Summary:
      Currently, whenever DB Verification fails we bail out by calling `exit(1)`. This is kind of bad since it causes unclean shutdown and spew of error log messages like:
      
          05:03:27 pthread lock: Invalid argument
          05:03:27 pthread lock: Invalid argument
          05:03:27 pthread lock: Invalid argument
          05:03:27 pthread lock: Invalid argument
          05:03:27 pthread lock: Invalid argument
          05:03:27 pthread lock: Invalid argument
          05:03:27 pthread lock: Invalid argument
          05:03:27 pthread lock: Invalid argument
          05:03:27 pthread lock: Invalid argument
      
      This diff adds a new parameter that is set to true when verification fails. It can then use the parameter to bail out safely.
      
      Test Plan: Casued artificail failure. Verified that exit was clean.
      
      Reviewers: dhruba, haobo, ljin
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18243
      2413a06c
  3. 22 4月, 2014 1 次提交
    • L
      hints for narrowing down FindFile range and avoiding checking unrelevant L0 files · 0f2d7681
      Lei Jin 提交于
      Summary:
      The file tree structure in Version is prebuilt and the range of each file is known.
      On the Get() code path, we do binary search in FindFile() by comparing
      target key with each file's largest key and also check the range for each L0 file.
      With some pre-calculated knowledge, each key comparision that has been done can serve
      as a hint to narrow down further searches:
      (1) If a key falls within a L0 file's range, we can safely skip the next
      file if its range does not overlap with the current one.
      (2) If a key falls within a file's range in level L0 - Ln-1, we should only
      need to binary search in the next level for files that overlap with the current one.
      
      (1) will be able to skip some files depending one the key distribution.
      (2) can greatly reduce the range of binary search, especially for bottom
      levels, given that one file most likely only overlaps with N files from
      the level below (where N is max_bytes_for_level_multiplier). So on level
      L, we will only look at ~N files instead of N^L files.
      
      Some inital results: measured with 500M key DB, when write is light (10k/s = 1.2M/s), this
      improves QPS ~7% on top of blocked bloom. When write is heavier (80k/s =
      9.6M/s), it gives us ~13% improvement.
      
      Test Plan: make all check
      
      Reviewers: haobo, igor, dhruba, sdong, yhchiang
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D17205
      0f2d7681
  4. 10 4月, 2014 2 次提交
    • I
      Turn on -Wmissing-prototypes · 4daea663
      Igor Canadi 提交于
      Summary: Compiling for iOS has by default turned on -Wmissing-prototypes, which causes rocksdb to fail compiling. This diff turns on -Wmissing-prototypes in our compile options and cleans up all functions with missing prototypes.
      
      Test Plan: compiles
      
      Reviewers: dhruba, haobo, ljin, sdong
      
      Reviewed By: ljin
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D17649
      4daea663
    • I
      Column family support for DB::OpenForReadOnly() · b947fdc8
      Igor Canadi 提交于
      Summary: When opening DB in read-only mode, client can choose to only specify a subset of column families ("default" column family can't be omitted, though)
      
      Test Plan: added a unit test in column_family_test
      
      Reviewers: haobo, sdong, ljin, dhruba
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D17565
      b947fdc8
  5. 21 3月, 2014 1 次提交
  6. 20 3月, 2014 1 次提交
  7. 18 3月, 2014 2 次提交
  8. 15 3月, 2014 1 次提交
  9. 13 3月, 2014 4 次提交
  10. 12 3月, 2014 4 次提交
  11. 11 3月, 2014 1 次提交
    • L
      Consolidate SliceTransform object ownership · 8d007b4a
      Lei Jin 提交于
      Summary:
      (1) Fix SanitizeOptions() to also check HashLinkList. The current
      dynamic case just happens to work because the 2 classes have the same
      layout.
      (2) Do not delete SliceTransform object in HashSkipListFactory and
      HashLinkListFactory destructor. Reason: SanitizeOptions() enforces
      prefix_extractor and SliceTransform to be the same object when
      Hash**Factory is used. This makes the behavior strange: when
      Hash**Factory is used, prefix_extractor will be released by RocksDB. If
      other memtable factory is used, prefix_extractor should be released by
      user.
      
      Test Plan: db_bench && make asan_check
      
      Reviewers: haobo, igor, sdong
      
      Reviewed By: igor
      
      CC: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D16587
      8d007b4a
  12. 09 2月, 2014 1 次提交
  13. 25 1月, 2014 3 次提交
    • S
      Moving Some includes from options.h to forward declaration · 8477255d
      Siying Dong 提交于
      Summary: By removing some includes form options.h and reply on forward declaration, we can more easily reason the dependencies.
      
      Test Plan: make all check
      
      Reviewers: kailiu, haobo, igor, dhruba
      
      Reviewed By: kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15411
      8477255d
    • I
      Revert "Moving to glibc-fb" · e832e72b
      Igor Canadi 提交于
      This reverts commit d24961b6.
      
      For some reason, glibc2.17-fb breaks gflags. Reverting for now
      e832e72b
    • I
      Moving to glibc-fb · d24961b6
      Igor Canadi 提交于
      Summary:
      It looks like we might have some trouble when building the new release with 4.8, since fbcode is using glibc2.17-fb by default and we are using glibc2.17. It was reported by Benjamin Renard in our internal group.
      
      This diff moves our fbcode build to use glibc2.17-fb by default. I got some linker errors when compiling, complaining that `google::SetUsageMessage()` was undefined. After deleting all offending lines, the compile was successful and everything works.
      
      Test Plan:
      Compiled
      Ran ./db_bench ./db_stress ./db_repl_stress
      
      Reviewers: kailiu
      
      Reviewed By: kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15405
      d24961b6
  14. 18 1月, 2014 1 次提交
  15. 04 12月, 2013 1 次提交
    • I
      Killing Transform Rep · eb12e47e
      Igor Canadi 提交于
      Summary:
      Let's get rid of TransformRep and it's children. We have confirmed that HashSkipListRep works better with multifeed, so there is no benefit to keeping this around.
      
      This diff is mostly just deleting references to obsoleted functions. I also have a diff for fbcode that we'll need to push when we switch to new release.
      
      I had to expose HashSkipListRepFactory in the client header files because db_impl.cc needs access to GetTransform() function for SanitizeOptions.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14397
      eb12e47e
  16. 20 11月, 2013 1 次提交
    • I
      Fix two nasty use-after-free-bugs · 469a9f32
      Igor Canadi 提交于
      Summary:
      These bugs were caught by ASAN crash test.
      1. The first one, in table/filter_block.cc is very nasty. We first reference entries_ and store the reference to Slice prev. Then, we call entries_.append(), which can change the reference. The Slice prev now points to junk.
      2. The second one is a bug in a test, so it's not very serious. Once we set read_opts.prefix, we never clear it, so some other function might still reference it.
      
      Test Plan: asan crash test now runs more than 5 mins. Before, it failed immediately. I will run the full one, but the full one takes quite some time (5 hours)
      
      Reviewers: dhruba, haobo, kailiu
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14223
      469a9f32
  17. 17 11月, 2013 1 次提交
  18. 13 11月, 2013 1 次提交
    • K
      Add the index/filter block cache · 88ba331c
      Kai Liu 提交于
      Summary: This diff leverage the existing block cache and extend it to cache index/filter block.
      
      Test Plan:
      Added new tests in db_test and table_test
      
      The correctness is checked by:
      
      1. make check
      2. make valgrind_check
      
      Performance is test by:
      
      1. 10 times of build_tools/regression_build_test.sh on two versions of rocksdb before/after the code change. Test results suggests no significant difference between them. For the two key operatons `overwrite` and `readrandom`, the average iops are both 20k and ~260k, with very small variance).
      2. db_stress.
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb, haobo, xjin
      
      Differential Revision: https://reviews.facebook.net/D13167
      88ba331c
  19. 02 11月, 2013 1 次提交
    • D
      Implement a compressed block cache. · b4ad5e89
      Dhruba Borthakur 提交于
      Summary:
      Rocksdb can now support a uncompressed block cache, or a compressed
      block cache or both. Lookups first look for a block in the
      uncompressed cache, if it is not found only then it is looked up
      in the compressed cache. If it is found in the compressed cache,
      then it is uncompressed and inserted into the uncompressed cache.
      
      It is possible that the same block resides in the compressed cache
      as well as the uncompressed cache at the same time. Both caches
      have their own individual LRU policy.
      
      Test Plan: Unit test case attached.
      
      Reviewers: kailiu, sdong, haobo, leveldb
      
      Reviewed By: haobo
      
      CC: xjin, haobo
      
      Differential Revision: https://reviews.facebook.net/D12675
      b4ad5e89
  20. 24 10月, 2013 1 次提交
  21. 17 10月, 2013 1 次提交
  22. 06 10月, 2013 1 次提交
  23. 05 10月, 2013 1 次提交
  24. 03 10月, 2013 1 次提交
  25. 01 10月, 2013 1 次提交
    • N
      Phase 2 of iterator stress test · 7edb92b8
      Natalie Hildebrandt 提交于
      Summary: Using an iterator instead of the Get method, each thread goes through a portion of the database and verifies values by comparing to the shared state.
      
      Test Plan:
      ./db_stress --db=/tmp/tmppp --max_key=10000 --ops_per_thread=10000
      
      To test some basic cases, the following lines can be added (each set in turn) to the verifyDb method with the following expected results:
      
          // Should abort with "Unexpected value found"
          shared.Delete(start);
      
          // Should abort with "Value not found"
          WriteOptions write_opts;
          db_->Delete(write_opts, Key(start));
      
          // Should succeed
          WriteOptions write_opts;
          shared.Delete(start);
           db_->Delete(write_opts, Key(start));
      
          // Should abort with "Value not found"
          WriteOptions write_opts;
          db_->Delete(write_opts, Key(start + (end-start)/2));
      
          // Should abort with "Value not found"
          db_->Delete(write_opts, Key(end-1));
      
          // Should abort with "Unexpected value"
          shared.Delete(end-1);
      
          // Should abort with "Unexpected value"
          shared.Delete(start + (end-start)/2);
      
          // Should abort with "Value not found"
          db_->Delete(write_opts, Key(start));
          shared.Delete(start);
          db_->Delete(write_opts, Key(end-1));
          db_->Delete(write_opts, Key(end-2));
      
      To test the out of range abort, change the key in the for loop to Key(i+1), so that the key defined by the index i is now outside of the supposed range of the database.
      
      Reviewers: emayanke
      
      Reviewed By: emayanke
      
      CC: dhruba, xjin
      
      Differential Revision: https://reviews.facebook.net/D13071
      7edb92b8
  26. 20 9月, 2013 1 次提交
    • N
      Phase 1 of an iterator stress test · 43354182
      Natalie Hildebrandt 提交于
      Summary:
      Added MultiIterate() which does a seek and some Next/Prev
      calls.  Iterator status is checked only, no data integrity check
      
      Test Plan:
      make db_stress
      ./db_stress --iterpercent=<nonzero value> --readpercent=, etc.
      
      Reviewers: emayanke, dhruba, xjin
      
      Reviewed By: emayanke
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12915
      43354182
  27. 14 9月, 2013 1 次提交
    • D
      Added a parameter to limit the maximum space amplification for universal compaction. · 4012ca1c
      Dhruba Borthakur 提交于
      Summary:
      Added a new field called max_size_amplification_ratio in the
      CompactionOptionsUniversal structure. This determines the maximum
      percentage overhead of space amplification.
      
      The size amplification is defined to be the ratio between the size of
      the oldest file to the sum of the sizes of all other files. If the
      size amplification exceeds the specified value, then min_merge_width
      and max_merge_width are ignored and a full compaction of all files is done.
      A value of 10 means that the size a database that stores 100 bytes
      of user data could occupy 110 bytes of physical storage.
      
      Test Plan: Unit test DBTest.UniversalCompactionSpaceAmplification added.
      
      Reviewers: haobo, emayanke, xjin
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12825
      4012ca1c
  28. 24 8月, 2013 1 次提交
  29. 23 8月, 2013 1 次提交
    • J
      Add three new MemTableRep's · 74781a0c
      Jim Paton 提交于
      Summary:
      This patch adds three new MemTableRep's: UnsortedRep, PrefixHashRep, and VectorRep.
      
      UnsortedRep stores keys in an std::unordered_map of std::sets. When an iterator is requested, it dumps the keys into an std::set and iterates over that.
      
      VectorRep stores keys in an std::vector. When an iterator is requested, it creates a copy of the vector and sorts it using std::sort. The iterator accesses that new vector.
      
      PrefixHashRep stores keys in an unordered_map mapping prefixes to ordered sets.
      
      I also added one API change. I added a function MemTableRep::MarkImmutable. This function is called when the rep is added to the immutable list. It doesn't do anything yet, but it seems like that could be useful. In particular, for the vectorrep, it means we could elide the extra copy and just sort in place. The only reason I haven't done that yet is because the use of the ArenaAllocator complicates things (I can elaborate on this if needed).
      
      Test Plan:
      make -j32 check
      ./db_stress --memtablerep=vector
      ./db_stress --memtablerep=unsorted
      ./db_stress --memtablerep=prefixhash --prefix_size=10
      
      Reviewers: dhruba, haobo, emayanke
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12117
      74781a0c