1. 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
  2. 25 7月, 2014 1 次提交
  3. 24 7月, 2014 3 次提交
  4. 23 7月, 2014 1 次提交
    • 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
  5. 22 7月, 2014 3 次提交
    • S
      Allow user to specify DB path of output file of manual compaction · f6b7e1ed
      sdong 提交于
      Summary: Add a parameter path_id to DB::CompactRange(), to indicate where the output file should be placed to.
      
      Test Plan: add a unit test
      
      Reviewers: yhchiang, ljin
      
      Reviewed By: ljin
      
      Subscribers: xjin, igor, dhruba, MarkCallaghan, leveldb
      
      Differential Revision: https://reviews.facebook.net/D20085
      f6b7e1ed
    • L
      make internal stats independent of statistics · f6f1533c
      Lei Jin 提交于
      Summary:
      also make it aware of column family
      output from db_bench
      
      ```
      ** Compaction Stats [default] **
      Level Files Size(MB) Score Read(GB)  Rn(GB) Rnp1(GB) Write(GB) Wnew(GB) RW-Amp W-Amp Rd(MB/s) Wr(MB/s)  Rn(cnt) Rnp1(cnt) Wnp1(cnt) Wnew(cnt)  Comp(sec) Comp(cnt) Avg(sec) Stall(sec) Stall(cnt) Avg(ms)
      ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        L0    14      956   0.9      0.0     0.0      0.0       2.7      2.7    0.0   0.0      0.0    111.6        0         0         0         0         24        40    0.612      75.20     492387    0.15
        L1    21     2001   2.0      5.7     2.0      3.7       5.3      1.6    5.4   2.6     71.2     65.7       31        43        55        12         82         2   41.242      43.72      41183    1.06
        L2   217    18974   1.9     16.5     2.0     14.4      15.1      0.7   15.6   7.4     70.1     64.3       17       182       185         3        241        16   15.052       0.00          0    0.00
        L3  1641   188245   1.8      9.1     1.1      8.0       8.5      0.5   15.4   7.4     61.3     57.2        9        75        76         1        152         9   16.887       0.00          0    0.00
        L4  4447   449025   0.4     13.4     4.8      8.6       9.1      0.5    4.7   1.9     77.8     52.7       38        79       100        21        176        38    4.639       0.00          0    0.00
       Sum  6340   659201   0.0     44.7    10.0     34.7      40.6      6.0   32.0  15.2     67.7     61.6       95       379       416        37        676       105    6.439     118.91     533570    0.22
       Int     0        0   0.0      1.2     0.4      0.8       1.3      0.5    5.2   2.7     59.1     65.6        3         7         9         2         20        10    2.003       0.00          0    0.00
      Stalls(secs): 75.197 level0_slowdown, 0.000 level0_numfiles, 0.000 memtable_compaction, 43.717 leveln_slowdown
      Stalls(count): 492387 level0_slowdown, 0 level0_numfiles, 0 memtable_compaction, 41183 leveln_slowdown
      
      ** DB Stats **
      Uptime(secs): 202.1 total, 13.5 interval
      Cumulative writes: 6291456 writes, 6291456 batches, 1.0 writes per batch, 4.90 ingest GB
      Cumulative WAL: 6291456 writes, 6291456 syncs, 1.00 writes per sync, 4.90 GB written
      Interval writes: 1048576 writes, 1048576 batches, 1.0 writes per batch, 836.0 ingest MB
      Interval WAL: 1048576 writes, 1048576 syncs, 1.00 writes per sync, 0.82 MB written
      
      Test Plan: ran it
      
      Reviewers: sdong, yhchiang, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19917
      f6f1533c
    • F
      add options.block_restart_interval in db_bench · 50c2dcb7
      Feng Zhu 提交于
      Summary:
        Add block_restart_interval in db_bench, default value 16
      
      Test Plan:
        make
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Differential Revision: https://reviews.facebook.net/D20331
      50c2dcb7
  6. 20 7月, 2014 1 次提交
  7. 19 7月, 2014 1 次提交
  8. 18 7月, 2014 5 次提交
  9. 17 7月, 2014 6 次提交
    • Y
      Add struct CompactionInputFiles to manage compaction input files. · 296e3407
      Yueh-Hsuan Chiang 提交于
      Summary: Add struct CompactionInputFiles to manage compaction input files.
      
      Test Plan:
      export ROCKSDB_TESTS=Compact
      make db_test
      ./db_test
      
      Reviewers: ljin, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20061
      296e3407
    • F
      enable kHashSearch for blocktable in db_bench · bc6b2ab4
      Feng Zhu 提交于
      Summary:
        add a flag called use_hash_search in db_bench
      
      Test Plan:
        make all check
        ./db_bench --use_hash_search=1
      
      Reviewers: ljin, haobo, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: igor, dhruba
      
      Differential Revision: https://reviews.facebook.net/D20067
      bc6b2ab4
    • F
      fix bug in LOG for flush memtable · 87895c62
      Feng Zhu 提交于
      Summary:
        One line change to fix a bug in the LOG when flush memtable
      
      Test Plan:
        NONE
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Differential Revision: https://reviews.facebook.net/D20049
      87895c62
    • S
      Fix db_test · 1c9f190a
      Stanislau Hlebik 提交于
      Summary: Added deletion of DBIterators in DBIterator's tests
      
      Test Plan: make valgrind_check
      
      Reviewers: igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20043
      1c9f190a
    • R
      Refactoring Version::Get() · 0418e66e
      Radheshyam Balasundaram 提交于
      Summary: Refactoring Version::Get() method to move file picker logic to a separate class.
      
      Test Plan: make check all
      
      Reviewers: igor, sdong, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19713
      0418e66e
    • F
      store file_indexer info in sequential memory · c11d604a
      Feng Zhu 提交于
      Summary:
        use arena to allocate space for next_level_index_ and level_rb_
        Thus increasing data locality and make Version::Get faster.
      
      Benchmark detail
      Base version: commit d2a727c1
      
      command used:
      ./db_bench --db=/mnt/db/rocksdb --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_type=none --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=2097152 --max_bytes_for_level_base=1073741824 --disable_wal=0 --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=fillseq, readrandom,readrandom,readrandom --use_existing_db=0 --num=52428800 --threads=1
      
      Result:
      cpu running percentage:
      Version::Get, improved from 7.98% to 7.42%
      FileIndexer::GetNextLevelIndex, improved from 1.18% to 0.68%.
      
      Test Plan:
        make all check
      
      Reviewers: ljin, haobo, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, igor
      
      Differential Revision: https://reviews.facebook.net/D19845
      c11d604a
  10. 16 7月, 2014 2 次提交
  11. 15 7月, 2014 2 次提交
  12. 14 7月, 2014 1 次提交
  13. 12 7月, 2014 2 次提交
    • L
      improve InternalStats output · 46f0f6dd
      Lei Jin 提交于
      Summary: as title
      
      Test Plan:
      sampe output:
      Level Files Size(MB) Score Read(GB)  Rn(GB) Rnp1(GB) Write(BG) Wnew(GB) RW-Amp W-Amp Rd(MB/s) Wr(MB/s)  Rn(cnt) Rnp1(cnt) Wnp1(cnt) Wnew(cnt)  Comp(sec) Comp(cnt) Avg(sec) Stall(sec) Stall(cnt) Avg(ms)
      ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        L0    15     1024   1.0      0.0     0.0      0.0       8.2      8.2    0.0   0.0      0.0    111.4        0         0         1         1         75       123    0.612     295.94    1939238    0.15
        L1    23     2118   2.1     20.9     8.3     12.7      20.0      7.3    5.0   2.4     73.2     69.9      124       141       208        67        293         8   36.582      17.05      16100    1.06
        L2   162    15333   1.5     47.0     7.1     40.0      42.6      2.6   12.7   6.0     67.9     61.5       62       457       482        25        709        55   12.898       0.00          0    0.00
        L3   985   108065   1.1     37.8     4.0     33.9      36.9      3.0   18.8   9.3     60.1     58.5       41       338       363        25        645        31   20.812       0.00          0    0.00
        L4  2788   356033   0.3      0.0     0.0      0.0       0.0      0.0    0.0   0.0      0.0      0.0        0         0         0         0          0         0    0.000       0.00          0    0.00
       Sum  3973   482572   0.0    105.8    19.3     86.5     107.7     21.2   11.1   5.6     62.9     64.0      227       936      1054       118       1723       217    7.938     312.99    1955338    0.16
      
      Reviewers: sdong, yhchiang, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19707
      46f0f6dd
    • F
      use FileLevel in LevelFileNumIterator · 178fd6f9
      Feng Zhu 提交于
      Summary:
        Use FileLevel in LevelFileNumIterator, thus use new version of findFile.
        Old version of findFile function is deleted.
        Write a function in version_set.cc to generate FileLevel from files_.
        Add GenerateFileLevelTest in version_set_test.cc
      
      Test Plan:
        make all check
      
      Reviewers: ljin, haobo, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: igor, dhruba
      
      Differential Revision: https://reviews.facebook.net/D19659
      178fd6f9
  14. 11 7月, 2014 6 次提交
    • T
      ForwardIterator seek bugfix · 3b97ee96
      Tomislav Novak 提交于
      Summary:
      If `NeedToSeekImmutable()` returns false, `SeekInternal()` won't reset the
      contents of `immutable_min_heap_`. However, since it calls `UpdateCurrent()`
      unconditionally, if `current_` is one of immutable iterators (previously popped
      from `immutable_min_heap_`), `UpdateCurrent()` will overwrite it. As a result,
      if old `current_` in fact pointed to the smallest entry, forward iterator will
      skip some records.
      
      Fix implemented in this diff pushes `current_` back to `immutable_min_heap_`
      before calling `UpdateCurrent()`.
      
      Test Plan:
      New unit test (courtesy of @lovro):
         $ ROCKSDB_TESTS=TailingIteratorSeekToSame ./db_test
      
      Reviewers: igor, dhruba, haobo, ljin
      
      Reviewed By: ljin
      
      Subscribers: lovro, leveldb
      
      Differential Revision: https://reviews.facebook.net/D19653
      3b97ee96
    • R
      C API: create missing cf's, cleanup · 1fc71a4b
      Reed Allman 提交于
      1fc71a4b
    • T
      ForwardIterator::status() checks all child iterators · 105c1e09
      Tomislav Novak 提交于
      Summary:
      Forward iterator only checked `status_` and `mutable_iter_->status()`, which is
      not sufficient. For example, when reading exclusively from cache
      (kBlockCacheTier), `mutable_iter_->status()` may return kOk (e.g. there's
      nothing in the memtable), but one of immutable iterators could be in
      kIncomplete. In this case, `ForwardIterator::status()` ought to return that
      status instead of kOk.
      
      This diff changes `status()` to also check `imm_iters_`, `l0_iters_`, and
      `level_iters_`.
      
      Test Plan:
        ROCKSDB_TESTS=TailingIteratorIncomplete ./db_test
      
      Reviewers: ljin, igor
      
      Reviewed By: igor
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D19581
      105c1e09
    • S
      Add a function to return current perf level · 36de0e53
      sdong 提交于
      Summary: Add a function to return the perf level. It is to allow a wrapper of DB to increase the perf level and restore the original perf level after finishing the function call.
      
      Test Plan: Add a verification in db_test
      
      Reviewers: yhchiang, igor, ljin
      
      Reviewed By: ljin
      
      Subscribers: xjin, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D19551
      36de0e53
    • S
      Removing NewTotalOrderPlainTableFactory · 30c81e77
      Stanislau Hlebik 提交于
      Summary:
      Seems like NewTotalOrderPlainTableFactory is useless and is semantically incorrect.
      Total order mode indicator is prefix_extractor == nullptr,
      but NewTotalOrderPlainTableFactory doesn't set it to be nullptr. That's why some tests
      in plain_table_db_tests is incorrect.
      
      Test Plan: make all check
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19587
      30c81e77
    • I
      JSON (Document) API sketch · f0a8be25
      Igor Canadi 提交于
      Summary:
      This is a rough sketch of our new document API. Would like to get some thoughts and comments about the high-level architecture and API.
      
      I didn't optimize for performance at all. Leaving some low-hanging fruit so that we can be happy when we fix them! :)
      
      Currently, bunch of features are not supported at all. Indexes can be only specified when creating database. There is no query planner whatsoever. This will all be added in due time.
      
      Test Plan: Added a simple unit test
      
      Reviewers: haobo, yhchiang, dhruba, sdong, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18747
      f0a8be25
  15. 10 7月, 2014 4 次提交
    • F
      change the init parameter for FileDescriptor · 222cf255
      Feng Zhu 提交于
      Summary:
        fix a bug in improve_file_key_search, change the parameter for FileDescriptor
      
      Test Plan:
        make all check
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Differential Revision: https://reviews.facebook.net/D19611
      222cf255
    • L
      disable rate limiter test · 8a7d1fe6
      Lei Jin 提交于
      Summary:
      The test is not stable because it relies on disk and only runs for a
      short period of time. So misisng a compaction/flush would greatly affect
      the rate. I am disabling it for now. What do you guys think?
      
      Test Plan: make
      
      Reviewers: yhchiang, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19599
      8a7d1fe6
    • F
      create compressed_levels_ in Version, allocate its space using arena. Make... · f697cad1
      Feng Zhu 提交于
      create compressed_levels_ in Version, allocate its space using arena. Make Version::Get, Version::FindFile faster
      
      Summary:
          Define CompressedFileMetaData that just contains fd, smallest_slice, largest_slice. Create compressed_levels_ in Version, the space is allocated using arena
          Thus increase the file meta data locality, speed up "Get" and "FindFile"
      
          benchmark with in-memory tmpfs, could have 4% improvement under "random read" and 2% improvement under "read while writing"
      
      benchmark command:
      ./db_bench --db=/mnt/db/rocksdb --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_type=none --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=33554432 --max_bytes_for_level_base=1073741824 --disable_wal=0 --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=readwhilewriting,readwhilewriting,readwhilewriting --use_existing_db=1 --num=52428800 --threads=1 —writes_per_second=81920
      
      Read Random:
      From 1.8363 ms/op, improve to 1.7587 ms/op.
      Read while writing:
      From 2.985 ms/op, improve to 2.924 ms/op.
      
      Test Plan:
          make all check
      
      Reviewers: ljin, haobo, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, igor
      
      Differential Revision: https://reviews.facebook.net/D19419
      f697cad1
    • Y
      Some fixes on size compensation logic for deletion entry in compaction · 70828557
      Yueh-Hsuan Chiang 提交于
      Summary:
      This patch include two fixes:
      1. newly created Version will now takes the aggregated stats for average-value-size from the latest Version.
      2. compensated size of a file is now computed only for newly created / loaded file, this addresses the issue where files are already sorted by their compensated file size but might sometimes observe some out-of-order due to later update on compensated file size.
      
      Test Plan:
      export ROCKSDB_TESTS=CompactionDele
      ./db_test
      
      Reviewers: ljin, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19557
      70828557
  16. 09 7月, 2014 1 次提交