1. 30 4月, 2014 7 次提交
    • Y
      Add a new mem-table representation based on cuckoo hash. · 9d9d2965
      Yueh-Hsuan Chiang 提交于
      Summary:
      = Major Changes =
      * Add a new mem-table representation, HashCuckooRep, which is based cuckoo hash.
        Cuckoo hash uses multiple hash functions.  This allows each key to have multiple
        possible locations in the mem-table.
      
        - Put: When insert a key, it will try to find whether one of its possible
          locations is vacant and store the key.  If none of its possible
          locations are available, then it will kick out a victim key and
          store at that location.  The kicked-out victim key will then be
          stored at a vacant space of its possible locations or kick-out
          another victim.  In this diff, the kick-out path (known as
          cuckoo-path) is found using BFS, which guarantees to be the shortest.
      
       - Get: Simply tries all possible locations of a key --- this guarantees
         worst-case constant time complexity.
      
       - Time complexity: O(1) for Get, and average O(1) for Put if the
         fullness of the mem-table is below 80%.
      
       - Default using two hash functions, the number of hash functions used
         by the cuckoo-hash may dynamically increase if it fails to find a
         short-enough kick-out path.
      
       - Currently, HashCuckooRep does not support iteration and snapshots,
         as our current main purpose of this is to optimize point access.
      
      = Minor Changes =
      * Add IsSnapshotSupported() to DB to indicate whether the current DB
        supports snapshots.  If it returns false, then DB::GetSnapshot() will
        always return nullptr.
      
      Test Plan:
      Run existing tests.  Will develop a test specifically for cuckoo hash in
      the next diff.
      
      Reviewers: sdong, haobo
      
      Reviewed By: sdong
      
      CC: leveldb, dhruba, igor
      
      Differential Revision: https://reviews.facebook.net/D16155
      9d9d2965
    • I
      More unsigned/signed compare fixes · f1c9aa6e
      Igor Canadi 提交于
      f1c9aa6e
    • I
      Fix more signed/unsigned comparsions · 38693d99
      Igor Canadi 提交于
      38693d99
    • I
      Fix unsigned and signed integer compare · d0b006ab
      Igor Canadi 提交于
      d0b006ab
    • I
      Make ttl_test a bit more robust · 76c3dbf5
      Igor Canadi 提交于
      76c3dbf5
    • I
      Cache result of ReadFirstRecord() · dd9eb7a7
      Igor Canadi 提交于
      Summary:
      ReadFirstRecord() reads the actual log file from disk on every call. This diff introduces a cache layer on top of ReadFirstRecord(), which should significantly speed up repeated calls to GetUpdatesSince().
      
      I also cleaned up some stuff, but the whole TransactionLogIterator could use some refactoring, especially if we see increased usage.
      
      Test Plan: make check
      
      Reviewers: haobo, sdong, dhruba
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18387
      dd9eb7a7
    • I
      Create new branch instead of tag in make_new_version · de825e73
      Igor Canadi 提交于
      de825e73
  2. 29 4月, 2014 5 次提交
  3. 28 4月, 2014 3 次提交
  4. 27 4月, 2014 2 次提交
  5. 26 4月, 2014 5 次提交
  6. 25 4月, 2014 10 次提交
    • I
      Column family logging · ad3cd39c
      Igor Canadi 提交于
      Summary:
      Now that we have column families involved, we need to add extra context to every log message. They now start with "[column family name] log message"
      
      Also added some logging that I think would be useful, like level summary after every flush (I often needed that when going through the logs).
      
      Test Plan: make check + ran db_bench to confirm I'm happy with log output
      
      Reviewers: dhruba, haobo, ljin, yhchiang, sdong
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18303
      ad3cd39c
    • I
      Better stack trace in MAC · 46b3076c
      Igor Canadi 提交于
      Summary:
      Now this gives us the real deal stack trace:
      
          Assertion failed: (false), function GetProperty, file db/db_impl.cc, line 4072.
          Received signal 6 (Abort trap: 6)
          #0   0x7fff57ce39b9
          #1   abort (in libsystem_c.dylib) + 125
          #2   basename (in libsystem_c.dylib) + 0
          #3   rocksdb::DBImpl::GetProperty(rocksdb::ColumnFamilyHandle*, rocksdb::Slice const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) (in db_test) (db_impl.cc:4072)
          #4   rocksdb::_Test_Empty::_Run() (in db_test) (testharness.h:68)
          #5   rocksdb::_Test_Empty::_RunIt() (in db_test) (db_test.cc:1005)
          #6   rocksdb::test::RunAllTests() (in db_test) (testharness.cc:60)
          #7   main (in db_test) (db_test.cc:6697)
          #8   start (in libdyld.dylib) + 1
      
      Test Plan: added artificial assert, saw great stack trace
      
      Reviewers: haobo, dhruba, ljin
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18309
      46b3076c
    • Y
      a82c492a
    • Y
      e537a840
    • Y
      [Java] Fixed a compile error. · 3e0b93b5
      Yueh-Hsuan Chiang 提交于
      3e0b93b5
    • Y
      [Java] Enable filluniquerandom, readseq, BloomFilter, and 70+ command-line... · 05979493
      Yueh-Hsuan Chiang 提交于
      [Java] Enable filluniquerandom, readseq, BloomFilter, and 70+ command-line options to DbBenchmark.java
      
      Summary:
      * Add filluniquerandom
      * Add readseq, implemented using iterator.
      * Realize most command-line-arguments from db_bench.cc (70+).
      * Some code are commented out as some of the options in Options
        not yet have Java bindings.
      * Add default option to DbBenchmark.
      * RocksDB will now take the ownership of all c++ raw-pointers from Options, which includes a c++ raw-pointer for Filter.
      
      Test Plan: ./jdb_bench.sh --db=/tmp/rocksjava-bench/db --num_levels=6 --key_size=20 --prefix_size=20 --keys_per_prefix=0 --value_size=100 --block_size=4096 --cache_size=17179869184 --cache_numshardbits=6 --compression_ratio=1 --min_level_to_compress=-1 --disable_seek_compaction=1 --hard_rate_limit=2 --write_buffer_size=134217728 --max_write_buffer_number=2 --level0_file_num_compaction_trigger=8 --target_file_size_base=134217728 --max_bytes_for_level_base=1073741824 --disable_wal=0 --wal_dir=/tmp/rocksjava-bench/wal --sync=0 --disable_data_sync=1 --verify_checksum=1 --delete_obsolete_files_period_micros=314572800 --max_grandparent_overlap_factor=10 --max_background_compactions=4 --max_background_flushes=0 --level0_slowdown_writes_trigger=16 --level0_stop_writes_trigger=24 --statistics=0 --stats_per_interval=0 --stats_interval=1048576 --histogram=0 --use_plain_table=1 --open_files=-1 --mmap_read=1 --mmap_write=0 --memtablerep=prefix_hash --bloom_bits=10 --bloom_locality=1 --perf_level=0 --benchmarks=filluniquerandom,readseq,readrandom --use_existing_db=0 --threads=4
      
      Reviewers: haobo, dhruba, sdong, ankgup87, rsumbaly, swapnilghike, zzbennett
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18267
      05979493
    • I
      Fix corruption test · 4cd9f58c
      Igor Canadi 提交于
      4cd9f58c
    • I
      Make CompactionInputErrorParanoid less flakey · 478990c8
      Igor Canadi 提交于
      Summary:
      I'm getting lots of e-mails with CompactionInputErrorParanoid failing. Most recent example early morning today was: http://ci-builds.fb.com/job/rocksdb_valgrind/562/consoleFull
      
      I'm putting a stop to these e-mails. I investigated why the test is flakey and it turns out it's because of non-determinsim of compaction scheduling. If there is a compaction after the last flush, CorruptFile will corrupt the compacted file instead of file at level 0 (as it assumes). That makes `Check(9, 9)` fail big time.
      
      I also saw some errors with table file getting outputed to >= 1 levels instead of 0. Also fixed that.
      
      Test Plan: Ran corruption_test 100 times without a failure. Previously it usually failed at 10th occurrence.
      
      Reviewers: dhruba, haobo, ljin
      
      Reviewed By: ljin
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18285
      478990c8
    • I
      Install stack trace handlers in unit tests · fc3127e8
      Igor Canadi 提交于
      Summary: Sometimes, our tests fail because of normal `assert` call. It would be helpful to see stack trace in that case, too.
      
      Test Plan: Added `assert(false)` and verified it prints out stack trace
      
      Reviewers: haobo, dhruba, sdong, ljin, yhchiang
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18291
      fc3127e8
    • I
      Run whitebox test before black box · a40970aa
      Igor Canadi 提交于
      a40970aa
  7. 24 4月, 2014 4 次提交
    • 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
    • Y
      [Java] Add Java bindings and Java tests for 30+ rocksdb::Options. · d8fe0060
      Yueh-Hsuan Chiang 提交于
      Summary:
      Add Java bindings and Java tests for 30+ rocksdb::Options.  Codes are
      machine-genearted based on include/rocksdb/options.h with manual-polishment.
      
      Test Plan:
      make rocksdbjava
      make jtest
      
      Reviewers: haobo, dhruba, sdong, ankgup87, rsumbaly, swapnilghike, zzbennett
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18273
      d8fe0060
    • S
      Fix a bug in IterKey · 4de5b84e
      sdong 提交于
      Summary: IterKey set buffer_size_ to a wrong initial value, causing it to always allocate values from heap instead of stack if the key size is smaller. Fix it.
      
      Test Plan: make all check
      
      Reviewers: haobo, ljin
      
      Reviewed By: haobo
      
      CC: igor, dhruba, yhchiang, leveldb
      
      Differential Revision: https://reviews.facebook.net/D18279
      4de5b84e
  8. 23 4月, 2014 4 次提交
    • I
      Print out stack trace in mac, too · f9f8965e
      Igor Canadi 提交于
      Summary: While debugging Mac-only issue with ThreadLocalPtr, this was very useful. Let's print out stack trace in MAC OS, too.
      
      Test Plan: Verified that somewhat useful stack trace was generated on mac. Will run PrintStack() on linux, too.
      
      Reviewers: ljin, haobo
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18189
      f9f8965e
    • S
      Expose number of entries in mem tables to users · a5707407
      sdong 提交于
      Summary: In this patch, two new DB properties are defined: rocksdb.num-immutable-mem-table and rocksdb.num-entries-imm-mem-tables, from where number of entries in mem tables can be exposed to users
      
      Test Plan:
      Cover the codes in db_test
      make all check
      
      Reviewers: haobo, ljin, igor
      
      Reviewed By: igor
      
      CC: nkg-, igor, yhchiang, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D18207
      a5707407
    • L
      get rid of shared_ptr in memtable.cc · 5f1daf7a
      Lei Jin 提交于
      Summary: Get rid of the devil. Probably won't impact anything on the perf side.
      
      Test Plan: make all check
      
      Reviewers: igor, haobo, sdong, yhchiang
      
      Reviewed By: haobo
      
      CC: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D18153
      5f1daf7a
    • L
      simplify ThreadLocalPtr a little bit · 547bb6a6
      Lei Jin 提交于
      Summary:
      make singleton a static member instead of dynamic object. This should
      also avoid the race on unique_ptr
      
      Test Plan: make all check
      
      Reviewers: igor, haobo, sdong
      
      Reviewed By: igor
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18177
      547bb6a6