1. 14 8月, 2014 3 次提交
  2. 13 8月, 2014 1 次提交
  3. 12 8月, 2014 1 次提交
    • M
      Changes to support unity build: · 93e6b5e9
      miguelportilla 提交于
      * Script for building the unity.cc file via Makefile
      * Unity executable Makefile target for testing builds
      * Source code changes to fix compilation of unity build
      93e6b5e9
  4. 01 8月, 2014 1 次提交
  5. 31 7月, 2014 1 次提交
    • S
      Fix ldb dump_manifest · 473e8297
      sdong 提交于
      Summary:
      We now reads table properties in VersionSet::LogAndApply(), which requires options.db_paths to be set. But since ldb_cmd directly creates VersionSet without initialization db_paths, causing a seg fault. This patch fix it by initializing db_paths.
      
      log_and_apply_bench still shows segfault, because table cache is nullptr in VersionSet created.
      
      Test Plan: Run ldb dump_manifest which used to fail.
      
      Reviewers: yhchiang, ljin, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20751
      473e8297
  6. 29 7月, 2014 3 次提交
    • L
      Change StopWatch interface · 1bd3431f
      Lei Jin 提交于
      Summary: So that we can avoid calling NowSecs() in MakeRoomForWrite twice
      
      Test Plan: make all check
      
      Reviewers: yhchiang, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20529
      1bd3431f
    • L
      make statistics forward-able · f6ca226c
      Lei Jin 提交于
      Summary:
      Make StatisticsImpl being able to forward stats to provided statistics
      implementation. The main purpose is to allow us to collect internal
      stats in the future even when user supplies custom statistics
      implementation. It avoids intrumenting 2 sets of stats collection code.
      One immediate use case is tuning advisor, which needs to collect some
      internal stats, users may not be interested.
      
      Test Plan:
      ran db_bench and see stats show up at the end of run
      Will run make all check since some tests rely on statistics
      
      Reviewers: yhchiang, sdong, igor
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D20145
      f6ca226c
    • L
      make statistics forward-able · 40fa8a4c
      Lei Jin 提交于
      Summary:
      Make StatisticsImpl being able to forward stats to provided statistics
      implementation. The main purpose is to allow us to collect internal
      stats in the future even when user supplies custom statistics
      implementation. It avoids intrumenting 2 sets of stats collection code.
      One immediate use case is tuning advisor, which needs to collect some
      internal stats, users may not be interested.
      
      Test Plan:
      ran db_bench and see stats show up at the end of run
      Will run make all check since some tests rely on statistics
      
      Reviewers: yhchiang, sdong, igor
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D20145
      40fa8a4c
  7. 26 7月, 2014 1 次提交
    • L
      expose RateLimiter definition · d650612c
      Lei Jin 提交于
      Summary:
      User gets undefinied error since the definition is not exposed.
      Also re-enable the db test with only upper bound check
      
      Test Plan: db_test, rate_limit_test
      
      Reviewers: igor, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20403
      d650612c
  8. 24 7月, 2014 1 次提交
    • Y
      Fixed a compile error in util/options_builder.cc · 00f56dfa
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fixed the following compile error by replacing pow by shift, as it computes
      power of 2.
      
      util/options_builder.cc:133:14: error: no member named 'pow' in namespace 'std'
              std::pow(2, std::max(0, std::min(3, level0_stop_writes_trigger -
              ~~~~~^
      1 error generated.
      make: *** [util/options_builder.o] Error 1
      
      Test Plan: make success in mac and linux
      
      Reviewers: ljin, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20475
      00f56dfa
  9. 23 7月, 2014 2 次提交
    • I
      Move include/utilities/*.h to include/rocksdb/utilities/*.h · 0ff183a0
      Igor Canadi 提交于
      Summary:
      All public headers need to be under `include/rocksdb` directory. Otherwise, clients include our header files like this:
      
          #include <rocksdb/db.h>
          #include <utilities/backupable_db.h> // still our public header!
      
      Also, internally, we include:
      
          #include "utilities/backupable/backupable_db.h" // internal header
          #include "utilities/backupable_db.h" // public header
      
      which is confusing.
      
      This way, when we install rocksdb as a system library, we can just copy `include/rocksdb` directory to system's header files. We can't really copy `utilities` directory to system's header files.
      
      Test Plan: compiles
      
      Reviewers: dhruba, ljin, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20409
      0ff183a0
    • S
      Add a utility function to guess optimized options based on constraints · e6de0210
      sdong 提交于
      Summary:
      Add a function GetOptions(), where based on four parameters users give: read/write amplification threshold, memory budget for mem tables and target DB size, it picks up a compaction style and parameters for them. Background threads are not touched yet.
      
      One limit of this algorithm: since compression rate and key/value size are hard to predict, it's hard to predict level 0 file size from write buffer size. Simply make 1:1 ratio here.
      
      Sample results: https://reviews.facebook.net/P477
      
      Test Plan: Will add some a unit test where some sample scenarios are given and see they pick the results that make sense
      
      Reviewers: yhchiang, dhruba, haobo, igor, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18741
      e6de0210
  10. 19 7月, 2014 1 次提交
  11. 16 7月, 2014 1 次提交
  12. 15 7月, 2014 1 次提交
    • I
      Remove stats logger · 20c05630
      Igor Canadi 提交于
      Summary: Browsing through the code, looks like StatsLogger is not used at all!
      
      Test Plan: compiles
      
      Reviewers: ljin, sdong, yhchiang, dhruba
      
      Reviewed By: dhruba
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D19827
      20c05630
  13. 11 7月, 2014 2 次提交
  14. 09 7月, 2014 2 次提交
    • L
      integrate rate limiter into rocksdb · 534357ca
      Lei Jin 提交于
      Summary:
      Add option and plugin rate limiter for PosixWritableFile. The rate
      limiter only applies to flush and compaction. WAL and MANIFEST are
      excluded from this enforcement.
      
      Test Plan: db_test
      
      Reviewers: igor, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19425
      534357ca
    • L
      generic rate limiter · 5ef1ba7f
      Lei Jin 提交于
      Summary:
      A generic rate limiter that can be shared by threads and rocksdb
      instances. Will use this to smooth out write traffic generated by
      compaction and flush. This will help us get better p99 behavior on flash
      storage.
      
      Test Plan:
      unit test output
      ==== Test RateLimiterTest.Rate
      request size [1 - 1023], limit 10 KB/sec, actual rate: 10.374969 KB/sec, elapsed 2002265
      request size [1 - 2047], limit 20 KB/sec, actual rate: 20.771242 KB/sec, elapsed 2002139
      request size [1 - 4095], limit 40 KB/sec, actual rate: 41.285299 KB/sec, elapsed 2202424
      request size [1 - 8191], limit 80 KB/sec, actual rate: 81.371605 KB/sec, elapsed 2402558
      request size [1 - 16383], limit 160 KB/sec, actual rate: 162.541268 KB/sec, elapsed 3303500
      
      Reviewers: yhchiang, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19359
      5ef1ba7f
  15. 04 7月, 2014 2 次提交
    • Y
      Finer report I/O stats about Flush and Compaction. · 90a6aca4
      Yueh-Hsuan Chiang 提交于
      Summary:
      This diff allows the I/O stats about Flush and Compaction to be reported
      in a more accurate way.  Instead of measuring the size of a file, it
      measure I/O cost in per read / write basis.
      
      Test Plan: make all check
      
      Reviewers: sdong, igor, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19383
      90a6aca4
    • Y
      Add timeout_hint_us to WriteOptions and introduce Status::TimeOut. · d4d338de
      Yueh-Hsuan Chiang 提交于
      Summary:
      This diff adds timeout_hint_us to WriteOptions.  If it's non-zero, then
      1) writes associated with this options MAY be aborted when it has been
        waiting for longer than the specified time.  If an abortion happens,
        associated writes will return Status::TimeOut.
      2) the stall time of the associated write caused by flush or compaction
        will be limited by timeout_hint_us.
      
      The default value of timeout_hint_us is 0 (i.e., OFF.)
      
      The statistics of timeout writes will be recorded in WRITE_TIMEDOUT.
      
      Test Plan:
      export ROCKSDB_TESTS=WriteTimeoutAndDelayTest
      make db_test
      ./db_test
      
      Reviewers: igor, ljin, haobo, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D18837
      d4d338de
  16. 03 7月, 2014 1 次提交
  17. 02 7月, 2014 2 次提交
  18. 01 7月, 2014 1 次提交
    • F
      use arena to allocate memtable's bloomfilter and hashskiplist's buckets_ · 56563674
      Feng Zhu 提交于
      Summary:
          Bloomfilter and hashskiplist's buckets_ allocated by memtable's arena
          DynamicBloom: pass arena via constructor, allocate space in SetTotalBits
          HashSkipListRep: allocate space of buckets_ using arena.
             do not delete it in deconstructor because arena would take care of it.
          Several test files are changed.
      
      Test Plan:
          make all check
      
      Reviewers: ljin, haobo, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: igor, dhruba
      
      Differential Revision: https://reviews.facebook.net/D19335
      56563674
  19. 26 6月, 2014 3 次提交
    • Y
      Fixed a comparison between signed and unsigned integers in options.cc · 81c5d989
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fixed the following warning:
      
      util/options.cc: In constructor ‘rocksdb::ColumnFamilyOptions::ColumnFamilyOptions(const rocksdb::Options&)’:
      util/options.cc:157:58: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         if (max_bytes_for_level_multiplier_additional.size() < num_levels) {
                                                                   ^
      
      Test Plan: make all check
      
      Reviewers: haobo, sdong, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19293
      81c5d989
    • S
      Remove MemTableRep::GetIterator(const Slice& slice) · 19de6a7a
      sdong 提交于
      Summary: It seems to me that when ever function MemTableRep::GetIterator(const Slice& slice) is used, we can use MemTableRep::GetDynamicPrefixIterator() instead. Just delete it to simplify the codes.
      
      Test Plan: make all check
      
      Reviewers: yhchiang, ljin
      
      Reviewed By: ljin
      
      Subscribers: xjin, dhruba, haobo, leveldb
      
      Differential Revision: https://reviews.facebook.net/D19281
      19de6a7a
    • Y
      Fixed heap-buffer-overflow issue when Options.num_levels > 7. · 55531fd0
      Yueh-Hsuan Chiang 提交于
      Summary:
      Currently, when num_levels has been changed to > 7, internally
      it will not resize max_bytes_for_level_multiplier_additional.
      As a result, max_bytes_for_level_multiplier_additional.size() will
      be smaller than num_levels, which causes heap-buffer-overflow.
      
      Test Plan: make all check
      
      Reviewers: haobo, sdong, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19275
      55531fd0
  20. 24 6月, 2014 3 次提交
    • Y
      Revert the default setting of InitFromCmdLineArgs(). · 82c31792
      Yueh-Hsuan Chiang 提交于
      Summary:
      Revert the default setting of InitFromCmdLineArgs() as all the callers
      currently provide full set of arguments.
      
      Test Plan:
      make reduce_levels_test
      ./reduce_levels_test
      
      Reviewers: haobo, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19257
      82c31792
    • Y
      Fix compile error caused in LDB tool · e5e6f55b
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fixed the following compile error.
          tools/reduce_levels_test.cc:89:31: error: no matching function for call to 'InitFromCmdLineArgs'
            LDBCommand* level_reducer = LDBCommand::InitFromCmdLineArgs(args);
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          ./util/ldb_cmd.h:56:22: note: candidate function not viable: requires 3 arguments, but 1 was provided
            static LDBCommand* InitFromCmdLineArgs(
                               ^
          ./util/ldb_cmd.h:62:22: note: candidate function not viable: requires 4 arguments, but 1 was provided
            static LDBCommand* InitFromCmdLineArgs(
                               ^
          1 error generated.
      
      Test Plan:
      make reduce_levels_test
      ./reduce_levels_test
      
      Reviewers: haobo, ljin, sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19251
      e5e6f55b
    • H
      [RocksDB] allow LDB tool to have customized key formatter · dfb31d15
      Haobo Xu 提交于
      Summary: Currently ldb tool dump keys either in ascii format or hex format - neither is ideal if the key has a binary structure and is not readable in ascii. This diff also allows LDB tool to be customized in ways beyond DB options.
      
      Test Plan: verify that key formatter works with some simple db with binary key.
      
      Reviewers: sdong, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19209
      dfb31d15
  21. 20 6月, 2014 2 次提交
    • I
      JSONDocument · 00b26c3a
      Igor Canadi 提交于
      Summary:
      After evaluating options for JSON storage, I decided to implement our own. The reason is that we'll be able to optimize it better and we get to reduce unnecessary dependencies (which is what we'd get with folly).
      
      I also plan to write a serializer/deserializer for JSONDocument with our own binary format similar to BSON. That way we'll store binary JSON format in RocksDB instead of the plain-text JSON. This means less storage and faster deserialization.
      
      There are still some inefficiencies left here. I plan to optimize them after we develop a functioning DocumentDB. That way we can move and iterate faster.
      
      Test Plan: added a unit test
      
      Reviewers: dhruba, haobo, sdong, ljin, yhchiang
      
      Reviewed By: haobo
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18831
      00b26c3a
    • I
      Remove seek compaction · d4a84233
      Igor Canadi 提交于
      Summary:
      As discussed in our internal group, we don't get much use of seek compaction at the moment, while it's making code more complicated and slower in some cases.
      
      This diff removes seek compaction and (hopefully) all code that was introduced to support seek compaction.
      
      There is one test case that relied on didIO information. I'll try to find another way to implement it.
      
      Test Plan: make check
      
      Reviewers: sdong, haobo, yhchiang, ljin, dhruba
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19161
      d4a84233
  22. 18 6月, 2014 1 次提交
  23. 17 6月, 2014 2 次提交
    • B
      Add separate Read/WriteUnlock methods in MutexRW. · 2d02ec65
      Bradley Grainger 提交于
      Some platforms, particularly Windows, do not have a single method that can
      release both a held reader lock and a held writer lock; instead, a
      separate method (ReleaseSRWLockShared or ReleaseSRWLockExclusive) must be
      called in each case.
      
      This may also be necessary to back MutexRW with a shared_mutex in C++14;
      the current language proposal includes both an unlock() and a
      shared_unlock() method.
      2d02ec65
    • Y
      Fix a bug causing LOG is not created when max_log_file_size is set. · 4d913cfb
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fix a bug causing LOG is not created when max_log_file_size is set.
      This bug is reported in issue #174.
      
      Test Plan:
      Add TEST(AutoRollLoggerTest, LogFileExistence).
      make auto_roll_logger_test
      ./auto_roll_logger_test
      
      Reviewers: haobo, sdong, ljin, igor, igor2
      
      Reviewed By: igor2
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D19053
      4d913cfb
  24. 13 6月, 2014 1 次提交
  25. 10 6月, 2014 1 次提交
    • S
      Clean PlainTableReader's variables for better data locality · 80f409ea
      sdong 提交于
      Summary:
      Clean PlainTableReader's data structures:
      (1) inline bloom_ (in order to do this, change DynamicBloom to allow lazy initialization)
      (2) remove some variables only used when initialization from the class
      (3) put variables not used in normal read code paths to the end of the class and reference prefix_extractor directly
      (4) make Options a reference.
      
      Test Plan: make all check
      
      Reviewers: haobo, ljin
      
      Reviewed By: ljin
      
      Subscribers: igor, yhchiang, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D18891
      80f409ea