1. 08 6月, 2016 1 次提交
    • K
      Persistent Read Cache (5) Volatile cache tier implementation · d755c62f
      krad 提交于
      Summary:
      This provides provides an implementation of PersistentCacheTier that is
      specialized for RAM. This tier does not persist data though.
      
      Why do we need this tier ?
      
      This is ideal as tier 0. This tier can host data that is too hot.
      
      Why can't we use Cache variants ?
      
      Yes you can use them instead. This tier can potentially outperform BlockCache
      in RAW mode by virtue of compression and compressed cache in block cache doesn't
      seem very popular. Potentially this tier can be modified to under stand the
      disadvantage of the tier below and retain data that the tier below is bad at
      handling (for example index and bloom data that is huge in size)
      
      Test Plan: Run unit tests added
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D57069
      d755c62f
  2. 07 6月, 2016 6 次提交
  3. 06 6月, 2016 3 次提交
  4. 04 6月, 2016 5 次提交
    • A
      env_basic_test library for testing new Envs [pluggable Env part 3] · 5aca977b
      Andrew Kryczka 提交于
      Summary:
      - Provide env_test as a static library. We will build it for future releases so internal Envs can use env_test by linking against this library.
      - Add tests for CustomEnv, which is configurable via ENV_TEST_URI environment variable. It uses the URI-based Env lookup (depends on D58449).
      - Refactor env_basic_test cases to use a unique/configurable directory for test files.
      
      Test Plan:
      built a test binary against librocksdb_env_test.a. It registered the
      default Env with URI prefix "a://".
      
      - verify runs all CustomEnv tests when URI with correct prefix is provided
      
      ```
      $ ENV_TEST_URI="a://ok" ./tmp --gtest_filter="CustomEnv/*"
      ...
      [  PASSED  ] 12 tests.
      ```
      
      - verify runs no CustomEnv tests when URI with non-matching prefix is provided
      
      ```
      $ ENV_TEST_URI="b://ok" ./tmp --gtest_filter="CustomEnv/*"
      ...
      [  PASSED  ] 0 tests.
      ```
      
      Reviewers: ldemailly, IslamAbdelRahman, lightmark, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58485
      5aca977b
    • U
      Adding support for sharing throttler between multiple backup and restores · 1147e5b0
      Uddipta Maity 提交于
      Summary:
      Rocksdb backup and restore rate limiting is currently done per backup/restore.
      So, it is difficult to control rate across multiple backup/restores. With this
      change, a throttler can be provided. If a throttler is provided, it is used.
      Otherwise, a new throttler is created based on the actual rate limits specified
      in the options.
      
      Test Plan: Added unit tests
      
      Reviewers: ldemailly, andrewkr, sdong
      
      Reviewed By: andrewkr
      
      Subscribers: igor, yiwu, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D56265
      1147e5b0
    • A
      Create env_basic_test [pluggable Env part 2] · 6e6622ab
      Andrew Kryczka 提交于
      Summary:
      Extracted basic Env-related tests from mock_env_test and memenv_test into a
      parameterized test for Envs: env_basic_test.
      
      Depends on D58449. (The dependency is here only so I can keep this series of
      diffs in a chain -- there is no dependency on that diff's code.)
      
      Test Plan: ran tests
      
      Reviewers: IslamAbdelRahman, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58635
      6e6622ab
    • A
      Add statistics field to show total size of index and filter blocks in block cache · e5328779
      Aaron Gao 提交于
      Summary: With `table_options.cache_index_and_filter_blocks = true`, index and filter blocks are stored in block cache. Then people are curious how much of the block cache total size is used by indexes and bloom filters. It will be nice we have a way to report that. It can help people tune performance and plan for optimized hardware setting. We add several enum values for db Statistics. BLOCK_CACHE_INDEX/FILTER_BYTES_INSERT - BLOCK_CACHE_INDEX/FILTER_BYTES_ERASE = current INDEX/FILTER total block size in bytes.
      
      Test Plan:
      write a test case called `DBBlockCacheTest.IndexAndFilterBlocksStats`. The result is:
      ```
      [gzh@dev9927.prn1 ~/local/rocksdb]  make db_block_cache_test -j64 && ./db_block_cache_test --gtest_filter=DBBlockCacheTest.IndexAndFilterBlocksStats
      Makefile:101: Warning: Compiling in debug mode. Don't use the resulting binary in production
        GEN      util/build_version.cc
        make: `db_block_cache_test' is up to date.
        Note: Google Test filter = DBBlockCacheTest.IndexAndFilterBlocksStats
        [==========] Running 1 test from 1 test case.
        [----------] Global test environment set-up.
        [----------] 1 test from DBBlockCacheTest
        [ RUN      ] DBBlockCacheTest.IndexAndFilterBlocksStats
        [       OK ] DBBlockCacheTest.IndexAndFilterBlocksStats (689 ms)
        [----------] 1 test from DBBlockCacheTest (689 ms total)
      
        [----------] Global test environment tear-down
        [==========] 1 test from 1 test case ran. (689 ms total)
        [  PASSED  ] 1 test.
      ```
      
      Reviewers: IslamAbdelRahman, andrewkr, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58677
      e5328779
    • A
      a791a2cf
  5. 03 6月, 2016 7 次提交
    • A
      Env registry for URI-based Env selection [pluggable Env part 1] · af0c9ac0
      Andrew Kryczka 提交于
      Summary:
      This enables configurable Envs without recompiling. For example, my
      next diff will make env_test test an Env created by NewEnvFromUri(). Then,
      users can determine which Env is tested simply by providing the URI for
      NewEnvFromUri() (e.g., through a CLI argument or environment variable).
      
      The registration process allows us to register any Env that is linked with the
      RocksDB library, so we can register our internal Envs as well.
      
      The registration code is inspired by our internal InitRegistry.
      
      Test Plan: new unit test
      
      Reviewers: IslamAbdelRahman, lightmark, ldemailly, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb, dhruba, andrewkr
      
      Differential Revision: https://reviews.facebook.net/D58449
      af0c9ac0
    • J
      allow updating block cache capacity from C (#1149) · 02ec8154
      Jan Doms 提交于
      02ec8154
    • A
      fix flaky sim_cache_test · 630b732c
      Aaron Gao 提交于
      Summary: fix flaky test
      
      Test Plan: `make all check`
      
      Reviewers: sdong, andrewkr
      
      Reviewed By: andrewkr
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D59157
      630b732c
    • K
      Add persistent cache to Windows build system · 62d54809
      krad 提交于
      Summary: Add hash table (under persistent cache) to CMake list
      
      Test Plan: Run hash_test in windows and make check in Linux
      
      Reviewers: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D59151
      62d54809
    • A
      Fix race condition in SwitchMemtable · 84295865
      Andrew Kryczka 提交于
      Summary:
      MemTableList::current_ could be written by background flush thread and
      simultaneously read in the user thread (NumNotFlushed() is used in
      SwitchMemtable()). Use the lock to prevent this case. Found the error from tsan.
      
      Related: D58833
      
      Test Plan:
        $ OPT=-g COMPILE_WITH_TSAN=1 make -j64 db_test
        $ TEST_TMPDIR=/dev/shm/rocksdb ./db_test --gtest_filter=DBTest.RepeatedWritesToSameKey
      
      Reviewers: lightmark, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D59139
      84295865
    • Y
      Allows db_bench to take an options file · 88acd932
      Yueh-Hsuan Chiang 提交于
      Summary:
      This patch allows db_bench to initialize it's RocksDB Options via a
      options file, specified by the --options_file flag.  Note that if
      --options_file flag is set, then it has higher priority than the
      command-line argument.
      
      Test Plan: db_bench_tool_test
      
      Reviewers: sdong, IslamAbdelRahman, kradhakrishnan, yiwu, andrewkr
      
      Reviewed By: andrewkr
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58533
      88acd932
    • P
      Add a callback for when memtable is moved to immutable (#1137) · 3a276b0c
      PraveenSinghRao 提交于
      * Create a callback for memtable becoming immutable
      
      Create a callback for memtable becoming immutable
      
      Create a callback for memtable becoming immutable
      
      moved notification outside the lock
      
      Move sealed notification to unlocked portion of SwitchMemtable
      
      * fix lite build
      3a276b0c
  6. 02 6月, 2016 5 次提交
    • Y
      Allow regression test to run db_bench at a remost host · 8cf0f86d
      Yueh-Hsuan Chiang 提交于
      Summary:
      This patch does the following improvement on the regression_test.sh
      * allows db_bench being executed at a remost host while storing the
        benchmark results locally.
      * kills all db_bench related processes before running db_bench
      * better error handling.
      
      Test Plan:
      1. Run regression_test.sh both locally and remotely
      2. Run multiple regression_test.sh at the same time and make sure
         i. Only one runs successfully.
         ii. The one that runs successfully will kill all other db_bench
             processes before it runs any benchmark.
      
      Reviewers: sdong, yiwu, gunnarku
      
      Reviewed By: gunnarku
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58611
      8cf0f86d
    • K
      Fix Windows build break · 27ad1707
      krad 提交于
      Summary:
      Direct IO checkin breaks Windows build. Fixing the code to work for
      Windows.
      
      Test Plan: Run env_test in Windows 10 and make check in Linux
      
      Reviewers: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D59073
      27ad1707
    • M
      Small tweaks to logging to track the number of immutable memtables · 936973d1
      Mike Kolupaev 提交于
      Summary:
      We see some write stalls because of number of unflushed memtables. With existing logging I couldn't figure out what's happening exactly. See internal task t11446054 for details if interested. This diff adds:
      - logging of memtable creation at info level; I wanted it on multiple occasions for different reasons; also include number of immutable memtables,
      - logging of number of remaining immutable memtables after a flush.
      
      Test Plan: ran tests
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58833
      936973d1
    • S
      add readahead size option (#1146) · 21c047ab
      siddontang 提交于
      21c047ab
    • V
      Assert boundary checks for SetPerfLevel() · 71c7eed9
      Vasile Paraschiv 提交于
      Summary: Add asserts around PerfLevel enum
      
      Test Plan: make all check -j32
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D59007
      71c7eed9
  7. 01 6月, 2016 2 次提交
    • R
      add missing lock · 5d85fdb2
      Reid Horuff 提交于
      5d85fdb2
    • S
      LDBCommand::SelectCommand to use a struct as the parameter · c40c4cae
      sdong 提交于
      Summary: The function wrapper for LDBCommand::SelectCommand is too long so that Windows build fails with warning "decorated name length exceeded, name was truncated". Shrink the length by using a struct.
      
      Test Plan: Build on both of Linux and Windows and make sure the warning doesn't show in either platform.
      
      Reviewers: andrewkr, adsharma, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58965
      c40c4cae
  8. 30 5月, 2016 1 次提交
  9. 28 5月, 2016 6 次提交
    • A
      Add statically-linked library for tools/benchmarks · 8dfa980c
      Andrew Kryczka 提交于
      Summary:
      Currently all the tools are included in librocksdb.a (db_bench is not). With
      this separate library, we can access db_bench functionality from our internal
      repo and eventually move tools out of librocksdb.a.
      
      Test Plan: built a simple binary against this library that invokes db_bench_tool().
      
      Reviewers: IslamAbdelRahman, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58977
      8dfa980c
    • S
      Handle overflow case of rate limiter's paramters · f62fbd2c
      sdong 提交于
      Summary: When rate_bytes_per_sec * refill_period_us_ overflows, the actual limited rate is very low. Handle this case so the rate will be large.
      
      Test Plan: Add a unit test for it.
      
      Reviewers: IslamAbdelRahman, andrewkr
      
      Reviewed By: andrewkr
      
      Subscribers: yiwu, lightmark, leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58929
      f62fbd2c
    • A
      In-memory environment read beyond EOF · 57461fba
      Andrew Kryczka 提交于
      Summary:
      Made it consistent with posix Env, which uses pread() that returns 0
      (success) when an offset is given beyond EOF. The purpose of making these Envs
      behave consistently is I am repurposing the in-memory Envs' tests for the basic
      Env tests in D58635.
      
      Test Plan: ran mock_env_test and memenv_test
      
      Reviewers: IslamAbdelRahman, lightmark, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58845
      57461fba
    • S
      LDBCommand::InitFromCmdLineArgs() to move from template to function wrapper · 0e200001
      sdong 提交于
      Summary:
      Build failure with some compiler setting with
      
      tools/reduce_levels_test.cc:97: undefined reference to `rocksdb::LDBCommand* rocksdb::LDBCommand::InitFromCmdLineArgs<rocksdb::LDBCommand* (*)(std::string const&, std::vector<std::string, std::allocator<std::string> > const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, std::vector<std::string, std::allocator<std::string> > const&)>(std::vector<std::string, std::allocator<std::string> > const&, rocksdb::Options const&, rocksdb::LDBOptions const&, std::vector<rocksdb::ColumnFamilyDescriptor, std::allocator<rocksdb::ColumnFamilyDescriptor> > const*, rocksdb::LDBCommand* (*)(std::string const&, std::vector<std::string, std::allocator<std::string> > const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, std::vector<std::string, std::allocator<std::string> > const&))'
      
      Fix it by changing to function pointer instead
      
      Test Plan: Run all existing tests
      
      Reviewers: andrewkr, kradhakrishnan, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: adsharma, lightmark, yiwu, leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58905
      0e200001
    • V
      Add low and upper bound values for rocksdb::PerfLevel enum · 472c06e9
      Vasile Paraschiv 提交于
      Summary:
      Add under and over limits for rocksdb::PerfLevel enum
      to allow us to do boundary checks before casting ints or unints
      to this enum.
      
      Test Plan: make all check -j32
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D58521
      472c06e9
    • S
      MutexLock -> ThreadPoolMutexLock in util/threadpool.cc · 157e0633
      sdong 提交于
      Summary: util/threadpool.cc's function name is the same as a well-known class name. It breaks unity build. Rename it.
      
      Test Plan: Run all existing test.
      
      Reviewers: yiwu, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58881
      157e0633
  10. 27 5月, 2016 2 次提交
    • S
      include/rocksdb/sst_file_writer.h should not depend on util/mutable_cf_options.h · 23d4cf48
      sdong 提交于
      Summary: I don't think util/mutable_cf_options.h is needed inside include/rocksdb/sst_file_writer.h and it is not allowed. Remove it.
      
      Test Plan: Run all tests
      
      Reviewers: IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: lightmark, leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58827
      23d4cf48
    • S
      Fix flaky DBTestDynamicLevel.DynamicLevelMaxBytesBase2 · 345fd73f
      sdong 提交于
      Summary: We added more table properties for each SST file, so when using 2KB SST file size, the estimated size of SST files is off by almost half, causing the LSM tree structure not as expected. Fix it by making file size 4x as previously, as well as LSM base size. Also avoid the sleeping based synchronization and turn to use sync points.
      
      Test Plan: Run paralell unit tests multiple times and make sure they always pass.
      
      Reviewers: IslamAbdelRahman, kradhakrishnan
      
      Reviewed By: kradhakrishnan
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D58749
      345fd73f
  11. 25 5月, 2016 2 次提交